## SAC '22 Code Challenge 3 Junior P2 - Normal Lines

View as PDF

Points: 3 (partial)
Time limit: 1.0s
Memory limit: 256M

Authors:
Problem type

Leo Zhuang, who just graduated elementary school, is working hard as always. This time, he has encountered a graphing problem:

Given a line segment from to , determine if the segment is parallel to either the x-axis or the y-axis.

If it is parallel to the x-axis, output x-axis; if it is parallel to the y-axis, output y-axis; if it is parallel to neither axis, output neither.

Can you determine this for him?

#### Constraints

Note that the coordinates of the points will not be identical.

#### Input Specification

The first line will contain the integer coordinates of the first point, and , respectively.

The second line will contain the integer coordinates of the second point, and , respectively.

#### Output Specification

Answer Leo's question: if it is parallel to the x-axis, output x-axis; if it is parallel to the y-axis, output y-axis; if it is parallel to neither axis, output neither.

#### Sample Input 1

7 -2
-3 -2

#### Sample Output 1

x-axis

#### Sample Input 2

-5 5
-5 10

#### Sample Output 2

y-axis

#### Sample Input 3

3 3
-3 -3

#### Sample Output 3

neither