Balance Scale

No attempts yetTime limit1sMemory limit256 MB

Problem

There are NN objects, all of different weights, numbered 1 to NN. For some pairs of objects you already measured on a balance scale which one is heavier, and those results are collected in a table. From that table you can sometimes work out the comparison for a pair you never measured, and sometimes you cannot.

Suppose there are 6 objects and the five measured results are [1]>[2][1]>[2], [2]>[3][2]>[3], [3]>[4][3]>[4], [5]>[4][5]>[4], [6]>[5][6]>[5], where [i][i] means the weight of object ii. From [2]>[3][2]>[3] and [3]>[4][3]>[4] you get [2]>[4][2]>[4]. For objects 2 and 6, the table says nothing about which one is heavier. So object 2 has a known comparison against objects 1, 3, and 4, and an unknown comparison against objects 5 and 6. Object 4 has a known comparison against every other object.

The input never contradicts itself. Suppose [3]>[1][3]>[1] were added to the example above. From [1]>[2][1]>[2] and [2]>[3][2]>[3] you derive [1]>[3][1]>[3], which conflicts with the measured [3]>[1][3]>[1]. Such an input is never given.

Given the number of objects NN and the measured results for some pairs, write a program that prints, for each object, how many objects its comparison result is unknown against.

Input

The first line contains the number of objects NN. The second line contains the number of measured pairs MM. Here 5N1005 \le N \le 100 and 0M20000 \le M \le 2000. Each of the next MM lines holds one measured result: two integers separated by a space, where the first object is heavier than the second.

Output

Print the answers on NN lines. Line ii holds the number of objects whose comparison against object ii is unknown.