#P1211I. Unusual Graph

    ID: 4932 Type: RemoteJudge 5000ms 256MiB Tried: 0 Accepted: 0 Difficulty: (None) Uploaded By: Tags>*special problemgraphs*3000

Unusual Graph

No submission language available for this problem.

Description

Ivan on his birthday was presented with array of non-negative integers a1,a2,,ana_1, a_2, \ldots, a_n. He immediately noted that all aia_i satisfy the condition 0ai150 \leq a_i \leq 15.

Ivan likes graph theory very much, so he decided to transform his sequence to the graph.

There will be nn vertices in his graph, and vertices uu and vv will present in the graph if and only if binary notations of integers aua_u and ava_v are differ in exactly one bit (in other words, auav=2ka_u \oplus a_v = 2^k for some integer k0k \geq 0. Where \oplus is Bitwise XOR).

A terrible thing happened in a couple of days, Ivan forgot his sequence aa, and all that he remembers is constructed graph!

Can you help him, and find any sequence a1,a2,,ana_1, a_2, \ldots, a_n, such that graph constructed by the same rules that Ivan used will be the same as his graph?

The first line of input contain two integers n,mn,m (1n500,0mn(n1)21 \leq n \leq 500, 0 \leq m \leq \frac{n(n-1)}{2}): number of vertices and edges in Ivan's graph.

Next mm lines contain the description of edges: ii-th line contain two integers ui,viu_i, v_i (1ui,vin;uivi1 \leq u_i, v_i \leq n; u_i \neq v_i), describing undirected edge connecting vertices uiu_i and viv_i in the graph.

It is guaranteed that there are no multiple edges in the graph. It is guaranteed that there exists some solution for the given graph.

Output nn space-separated integers, a1,a2,,ana_1, a_2, \ldots, a_n (0ai150 \leq a_i \leq 15).

Printed numbers should satisfy the constraints: edge between vertices uu and vv present in the graph if and only if auav=2ka_u \oplus a_v = 2^k for some integer k0k \geq 0.

It is guaranteed that there exists some solution for the given graph. If there are multiple possible solutions, you can output any.

Input

The first line of input contain two integers n,mn,m (1n500,0mn(n1)21 \leq n \leq 500, 0 \leq m \leq \frac{n(n-1)}{2}): number of vertices and edges in Ivan's graph.

Next mm lines contain the description of edges: ii-th line contain two integers ui,viu_i, v_i (1ui,vin;uivi1 \leq u_i, v_i \leq n; u_i \neq v_i), describing undirected edge connecting vertices uiu_i and viv_i in the graph.

It is guaranteed that there are no multiple edges in the graph. It is guaranteed that there exists some solution for the given graph.

Output

Output nn space-separated integers, a1,a2,,ana_1, a_2, \ldots, a_n (0ai150 \leq a_i \leq 15).

Printed numbers should satisfy the constraints: edge between vertices uu and vv present in the graph if and only if auav=2ka_u \oplus a_v = 2^k for some integer k0k \geq 0.

It is guaranteed that there exists some solution for the given graph. If there are multiple possible solutions, you can output any.

Samples

Sample Input 1

4 4
1 2
2 3
3 4
4 1

Sample Output 1

0 1 0 1

Sample Input 2

3 0

Sample Output 2

0 0 0