favorite We need a little bit of your help to keep things running, click on this banner to learn more

Graphs Representation

Traffic lights

In the cave there are m tunnels and n junctions, each tunnel connects two crossroads. Mouse King decided to install the traffic light in every tunnel before every intersection. Write a program to calculate how many traffic lights must be installed on each intersection. Intersections are numbered from 1 to n.


The first line contains two numbers n and m (0 < n100, 0mn ·(n - 1) / 2). The following m lines contain two integers i and j (1i, jn), which means that the intersections i and j are connected with a tunnel.


Print n numbers: k-th number indicates the number of traffic signals at the k-th intersection.

We can assume that any two crossing connected by no more than one tunnel. No tunnels from the intersection i to him.


Time limit 1 second
Memory limit 128 MiB
Input example #1
7 10
5 1
3 2
7 1
5 2
7 4
6 5
6 4
7 5
2 1
5 3
Output example #1
3 3 2 2 5 2 3