Quadrants
Time limit1sMemory limit128 MB
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 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 -axis or the -axis belongs to no quadrant, so print AXIS for it.

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.