Package for this problem was not updated by the problem writer or Codeforces administration after we’ve upgraded the judging servers. To adjust the time limit constraint, solution execution time will be multiplied by 2. For example, if your solution works for 400 ms on judging servers, then value 800 ms will be displayed and used to determine the verdict.

Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ICPC mode for virtual contests.
If you've seen these problems, a virtual contest is not for you - solve these problems in the archive.
If you just want to solve some problem from a contest, a virtual contest is not for you - solve this problem in the archive.
Never use someone else's code, read the tutorials or communicate with other person during a virtual contest.

No tag edit access

E. Yet Another Task with Queens

time limit per test

2 secondsmemory limit per test

256 megabytesinput

standard inputoutput

standard outputA queen is the strongest chess piece. In modern chess the queen can move any number of squares in any horizontal, vertical or diagonal direction (considering that there're no other pieces on its way). The queen combines the options given to the rook and the bishop.

There are *m* queens on a square *n* × *n* chessboard. You know each queen's positions, the *i*-th queen is positioned in the square (*r*_{i}, *c*_{i}), where *r*_{i} is the board row number (numbered from the top to the bottom from 1 to *n*), and *c*_{i} is the board's column number (numbered from the left to the right from 1 to *n*). No two queens share the same position.

For each queen one can count *w* — the number of other queens that the given queen threatens (attacks). For a fixed attack direction only the first queen in this direction is under attack if there are many queens are on the ray of the attack. Obviously, for any queen *w* is between 0 and 8, inclusive.

Print the sequence *t*_{0}, *t*_{1}, ..., *t*_{8}, where *t*_{i} is the number of queens that threaten exactly *i* other queens, i.e. the number of queens that their *w* equals *i*.

Input

The first line of the input contains a pair of integers *n*, *m* (1 ≤ *n*, *m* ≤ 10^{5}), where *n* is the size of the board and *m* is the number of queens on the board. Then *m* following lines contain positions of the queens, one per line. Each line contains a pair of integers *r*_{i}, *c*_{i} (1 ≤ *r*_{i}, *c*_{i} ≤ *n*) — the queen's position. No two queens stand on the same square.

Output

Print the required sequence *t*_{0}, *t*_{1}, ..., *t*_{8}, separating the numbers with spaces.

Examples

Input

8 4

4 3

4 8

6 5

1 6

Output

0 3 0 1 0 0 0 0 0

Input

10 3

1 1

1 2

1 3

Output

0 2 1 0 0 0 0 0 0

Codeforces (c) Copyright 2010-2020 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Jan/18/2020 07:48:35 (g1).

Desktop version, switch to mobile version.

Supported by

User lists

Name |
---|