The Great Bytean Mountains occupy a rectangle in the Cartesian plane whose opposite corners are (0,0) and (w,h), where w and h are positive integers. Inside the rectangle there are n mountain peaks, each located at a grid point (a point with integer coordinates).
Tourists want to build houses on grid points. The park rules are strict: at most one house may stand on each grid point, and no house may be built on a peak. There are therefore (w+1)⋅(h+1)−n possible house locations.
Some locations are better than others. A grid point (x,y) that is not a peak has a northern neighbour if there is a peak at (x,y+d) for some positive integer d. Southern, eastern, and western neighbours are defined analogously — a peak in the same column below it, or in the same row to its east or west. Every non-peak grid point thus has between 0 and 4 neighbours, and the more neighbours it has, the better the view.
Count how many non-peak grid points have exactly 0, 1, 2, 3, and 4 neighbours.
The first line contains three integers w, h, and n (1≤w,h≤109, 1≤n≤500000), separated by single spaces. Each of the following n lines contains two integers x and y (0≤x≤w, 0≤y≤h), separated by a single space, giving the location of one peak. All peaks are at distinct grid points.
Print five integers separated by single spaces: the numbers of non-peak grid points that have exactly 0, 1, 2, 3, and 4 neighbours, in that order.
In the example, the non-peak points with exactly two neighbours are (3,1) and (3,3); those with three neighbours are (1,1), (0,2), and (1,3); the point (2,2) has four neighbours; the point (4,0) has none; and every remaining non-peak point has exactly one neighbour.