#arc143d. [arc143_d]Bridges

[arc143_d]Bridges

Problem Statement

We have two sequences A1,ldots,AMA_1,\\ldots, A_M and B1,ldots,BMB_1,\\ldots,B_M consisting of intgers between 11 and NN (inclusive).

For a string of length MM consisting of 0 and 1, consider the following undirected graph with 2N2N vertices and (M+N)(M+N) edges corresponding to that string.

  • If the ii-th character of the string is 0, the ii-th edge connects Vertex AiA_i and Vertex (Bi+N)(B_i+N).
  • If the ii-th character of the string is 1, the ii-th edge connects Vertex BiB_i and Vertex (Ai+N)(A_i+N).
  • The (j+M)(j+M)-th edge connects Vertex jj and Vertex (j+N)(j+N).

Here, ii and jj are integers such that 1leqileqM1 \\leq i \\leq M and 1leqjleqN1 \\leq j \\leq N, and the vertices are numbered 11 to 2N2N.

Find one string of length MM consisting of 0 and 1 such that the corresponding undirected graph has the minimum number of bridges.

Notes on bridges A bridge is an edge of a graph whose removal increases the number of connected components.

Constraints

  • 1leqNleq2times1051 \\leq N \\leq 2 \\times 10^5
  • 1leqMleq2times1051 \\leq M \\leq 2 \\times 10^5
  • 1leqAi,BileqN1 \\leq A_i, B_i \\leq N

Input

Input is given from Standard Input in the following format:

NN MM A1A_1 A2A_2 cdots\\cdots AMA_M B1B_1 B2B_2 cdots\\cdots BMB_M

Output

Print one string that satisfies the requirement. If there are multiple such strings, you may print any of them.


Sample Input 1

2 2
1 1
2 2

Sample Output 1

01

The graph corresponding to 01 has no bridges.

In the graph corresponding to 00, the edge connecting Vertex 11 and Vertex 33 and the edge connecting Vertex 22 and Vertex 44 are bridges, so 00 does not satisfy the requirement.


Sample Input 2

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

Sample Output 2

0100010