This page is still under construction.

Parts of this page are still being built. What you see may change.

Quadrants and axes

Time limit1sMemory limit128 MB

Summary
Count how many of n points fall in each of the four quadrants and how many lie on an axis.
Level

Easy1 of 10

Topics
Implementation
Solved
No attempts yet

Problem

There are nn points on the two dimensional plane. Given the coordinates (x,y)(x, y) of each point, count how many points lie in each of the four quadrants and how many lie on an axis.

The quadrant of a point follows the signs of its two coordinates. x>0x > 0 and y>0y > 0 is the first quadrant, x<0x < 0 and y>0y > 0 is the second quadrant, x<0x < 0 and y<0y < 0 is the third quadrant, and x>0x > 0 and y<0y < 0 is the fourth quadrant.

A point whose xx or yy is 00 belongs to no quadrant and counts as a point on an axis. The origin is a point on an axis as well.

Input

The first line contains the number of points nn. (1≤n≤10001 \le n \le 1000)

Each of the next nn lines contains the coordinates xix_i and yiy_i of one point, separated by a space. (−106≤xi,yi≤106-10^6 \le x_i, y_i \le 10^6)

The same coordinates may be given more than once, and every occurrence is counted separately.

Output

Print five lines in this format.

Q1: <number of points in the first quadrant>
Q2: <number of points in the second quadrant>
Q3: <number of points in the third quadrant>
Q4: <number of points in the fourth quadrant>
AXIS: <number of points on an axis>

Write the labels in upper case, and put one space after the colon before the count.

Examples1

  1. Example 1

    Input
    5
    0 0
    0 1
    1 1
    3 -3
    2 2
    
    Expected output
    Q1: 2
    Q2: 0
    Q3: 0
    Q4: 1
    AXIS: 2