Under construction

Still being built. Things may change

Juta's Route

Time limit1sMemory limit1024 MB

Summary
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 0…1000 \ldots 100.

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.

Examples2

  1. Example 1

    Input
    1
    8
    5
    
    Expected output
    JAH
    
  2. Example 2

    Input
    2
    18
    85
    
    Expected output
    EI