This page is still under construction.

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

Quadrants

Time limit1sMemory limit128 MB

Summary
Read points until 0 0 and print Q1 to Q4 from the signs of x and y, or AXIS on an axis.
Level

Easy1 of 10

Topics
Implementation
Solved
No attempts yet

Problem

You are given the coordinates (x,y)(x, y) of points on the 2-dimensional plane. For each point, decide whether it lies in quadrant 1, quadrant 2, quadrant 3, or quadrant 4, and print Q1, Q2, Q3, or Q4. A point on the xx-axis or the yy-axis belongs to no quadrant, so print AXIS for it.

The four quadrants

Input

Each line holds two real numbers separated by a space, the coordinates of one point. The input ends with the line 0 0.

Output

For each given point, print Q1, Q2, Q3, Q4, or AXIS on its own line. The terminating 0 0 is the origin, so print AXIS for that line as well.

Examples2

  1. Example 1

    Input
    1 2
    -1 -0.12
    4 0
    -10.4 200
    0 0
    
    Expected output
    Q1
    Q3
    AXIS
    Q2
    AXIS
    
  2. Example 2

    Input
    3 4
    -3 4
    -3 -4
    3 -4
    0 0
    
    Expected output
    Q1
    Q2
    Q3
    Q4
    AXIS