Triangle Trees

문제

A triangle tree is an undirected graph in which every cycle contains exactly three edges. Recall that a cycle is a sequence of at least 3 distinct vertices v1,v2,,vk such that there is an edge between vi and vi+1 for i=1,,k1 and there is also an edge between vk and v1.

A colouring of a graph is an assignment of colours to the vertices such that the two endpoints of each edge of the graph receive different colours. Given a triangle tree, your task is to find a colouring which uses the smallest possible number of colours.

Figure 1: Illustration of the second sample case. The number written just outside the vertex corresponds to the colour it receives corresponding to the output for that sample case.

입력

The first line of input contains two integers N (1N105) and M (0M105). The next M lines each contain two integers u and v (1u,vN) indicating that the graph contains an edge between u and v. It is guaranteed that uv, all edges are unique, and that the graph is indeed a triangle tree.

출력

Output N integers indicating the colours of vertices 1,2,,N in order. If you used k colours, the integers should be from the set {1,2,,k}. If there are multiple valid colourings, you may output any one of them. Recall the goal is to output such a colouring using the fewest colours possible, i.e. minimize k.

예제 입력 1 복사

3 3
1 2
2 3
3 1

예제 입력 2 복사

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

예제 입력 3 복사

5 4
1 2
1 3
2 4
2 5

예제 출력 1 복사

2 3 1

예제 출력 2 복사

3 2 3 2 2 2 1

예제 출력 3 복사

1 2 2 1 1