Skip to main content
LIVE CONTEST: ALGOR Contest: Round #4 (Special Challenge) is live now!

~/algor $ cat problems/graf-choqqi-darajalari

Vertex degrees

Easy 1000 ms 128 MB 20%
Share

An undirected graph with $n$ vertices and $m$ edges is given. The vertices are numbered from $1$ to $n$. The degree of a vertex is the number of edges incident to it. Find the degree of every vertex.

A graph: next to each vertex, the number of edges incident to it

Input

The first line contains two integers: $n$ and $m$. Each of the next $m$ lines contains two positive integers: $u$ and $v$ — the vertices joined by an edge.

Output

One line: $n$ space-separated integers — the degrees of vertices $1$, $2$, …, $n$.

Note

$1 \le n \le 10^{5}$
$0 \le m \le 2 * 10^{5}$
$1 \le u, v \le n$, $u \ne v$
The graph may have multiple edges: each one is counted separately.

Examples

Input #1
4 4
1 2
1 3
1 4
2 3
Output #1
3 2 2 1
Input #2
3 0
Output #2
0 0 0

Sign in to submit a solution

Signing up is free and takes a minute.