Juta's Route
Time limit1sMemory limit1024 MB
Given three numbers from 0 to 100, decide whether they can be the first three numbers written along a left-to-right route through the figure's roads.
- Level
Easy2 of 10
- Topics
- Implementation
- Solved
- No attempts yet
Problem
Juta walked along the roads shown in the figure. She always moved from left to right and never from right to left. At each junction she had two choices for the next step, and she picked one.

Juta wrote down the numbers on her path in order.
Write a program that reads three numbers and determines whether Juta could have written them down in this order.
Input
The input has three lines, each containing one integer. The first line is the number Juta wrote down first, the second line is the number she wrote second, and the third line is the number she wrote third. All numbers in the input are integers from .
Output
Print JAH if Juta could have written the numbers in the given order, and EI if it is impossible. Print the word in uppercase.