Half-degrees of vertices by edge lists#5075

Half-degrees of vertices by edge lists

1 second
64 megabytes
Very easy

The directed graph is represented by a list of edges.

Your task is to determine the in-degree and out-degree of each vertex in the graph.

Input

The input file begins with two numbers: (1 \leq n \leq 100), representing the number of vertices in the graph, and (1 \leq m \leq n(n - 1)), representing the number of edges. Following this are pairs of numbers, each pair representing an edge in the graph.

Output

For each vertex, output a pair of numbers: the in-degree followed by the out-degree. There should be such pairs in the output file.

Examples

Example 1

Loading
Loading