{"raw_statement":[{"iden":"problem statement","content":"Given is a simple undirected graph with $N$ vertices and $M$ edges. The vertices are numbered $1, \\cdots, N$, and the $i$\\-th edge connects Vertices $a_i$ and $b_i$. Also given is a sequence of positive integers: $c_1, c_2, \\cdots, c_N$.\nConvert this graph into a directed graph that satisfies the condition below, that is, for each $i$, delete the undirected edge $(a_i, b_i)$ and add one of the two direted edges $a_i \\to b_i$ and $b_i \\to a_i$.\n\n*   For every $i = 1, 2, \\cdots, N$, there are exactly $c_i$ vertices reachable from Vertex $i$ (by traversing some number of directed edges), including Vertex $i$ itself.\n\nIn this problem, it is guaranteed that the given input **always has a solution**."},{"iden":"constraints","content":"*   $1 \\leq N \\leq 100$\n*   $0 \\leq M \\leq \\frac{N(N - 1)}{2}$\n*   $1 \\leq a_i, b_i \\leq N$\n*   The given graph has no self-loops and no multi-edges.\n*   $1 \\leq c_i \\leq N$\n*   **There always exists a valid solution.**"},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$N$ $M$\n$a_1$ $b_1$\n$:$\n$a_M$ $b_M$\n$c_1$ $c_2$ $...$ $c_N$"},{"iden":"sample input 1","content":"3 3\n1 2\n2 3\n3 1\n3 3 3"},{"iden":"sample output 1","content":"\\->\n->\n->\n\nIn a cycle of length $3$, you can reach every vertex from any vertex."},{"iden":"sample input 2","content":"3 2\n1 2\n2 3\n1 2 3"},{"iden":"sample output 2","content":"<-\n<-"},{"iden":"sample input 3","content":"6 3\n1 2\n4 3\n5 6\n1 2 1 2 2 1"},{"iden":"sample output 3","content":"<-\n->\n->\n\nThe graph may be disconnected."}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}