#arc111d. [arc111_d]Orientation

[arc111_d]Orientation

Problem Statement

Given is a simple undirected graph with NN vertices and MM edges. The vertices are numbered 1,cdots,N1, \\cdots, N, and the ii-th edge connects Vertices aia_i and bib_i. Also given is a sequence of positive integers: c1,c2,cdots,cNc_1, c_2, \\cdots, c_N.

Convert this graph into a directed graph that satisfies the condition below, that is, for each ii, delete the undirected edge (ai,bi)(a_i, b_i) and add one of the two direted edges aitobia_i \\to b_i and bitoaib_i \\to a_i.

  • For every i=1,2,cdots,Ni = 1, 2, \\cdots, N, there are exactly cic_i vertices reachable from Vertex ii (by traversing some number of directed edges), including Vertex ii itself.

In this problem, it is guaranteed that the given input always has a solution.

Constraints

  • 1leqNleq1001 \\leq N \\leq 100
  • 0leqMleqfracN(N1)20 \\leq M \\leq \\frac{N(N - 1)}{2}
  • 1leqai,bileqN1 \\leq a_i, b_i \\leq N
  • The given graph has no self-loops and no multi-edges.
  • 1leqcileqN1 \\leq c_i \\leq N
  • There always exists a valid solution.

Input

Input is given from Standard Input in the following format:

NN MM a1a_1 b1b_1 :: aMa_M bMb_M c1c_1 c2c_2 ...... cNc_N

Output

Print MM lines.

To add the edge aitobia_i \\to b_i for the ii-th edge, print -> in the ii-th line; to add the edge bitoaib_i \\to a_i for the ii-th edge, print <-.

If there are multiple solutions, any of them will be accepted.


Sample Input 1

3 3
1 2
2 3
3 1
3 3 3

Sample Output 1

->
->
->

In a cycle of length 33, you can reach every vertex from any vertex.


Sample Input 2

3 2
1 2
2 3
1 2 3

Sample Output 2

<-
<-

Sample Input 3

6 3
1 2
4 3
5 6
1 2 1 2 2 1

Sample Output 3

<-
->
->

The graph may be disconnected.