Under construction

Still being built. Things may change

Chopsticks Game

Interview

Time limit1sMemory limit512 MB

Summary
Given the starting finger counts A and B (1 to 4 each), decide whether the first player Yongtae wins the one-hand chopsticks game under optimal play.
Level

Medium4 of 10

Topics
Game theory, Recursion, Brute force
Solved
No attempts yet

Problem

Yongtae and Yujin play a chopsticks game. The game proceeds as follows.

  1. Yongtae chooses the number of fingers A(1≤A≤4)A(1 \le A \le 4) raised on one hand at the start.
  2. Yujin chooses the number of fingers B(1≤B≤4)B(1 \le B \le 4) raised on one hand at the start.
  3. Starting with Yongtae, the two players take turns attacking the opponent to make the opponent raise more fingers. If a player with xx fingers raised attacks the opponent, the opponent must raise xx more fingers.
  4. The player who must raise five or more fingers loses. The game uses only one hand.

For example, if Yongtae starts with 1 finger raised and Yujin starts with 2, the game goes as follows.

  1. (1,2)→(1,3)(1, 2) → (1, 3) Yongtae attacks first, so Yujin raises 1 more finger.
  2. (1,3)→(4,3)(1, 3) → (4, 3) Yujin attacks Yongtae, so Yongtae raises 3 more fingers.
  3. (4,3)→(4,7)(4, 3) → (4, 7) Yongtae attacks Yujin, so Yujin must raise 7 fingers and loses.

Input

The first line contains AA (1≤A≤41 \le A \le 4), the number of fingers Yongtae raises on one hand at the start, and BB (1≤B≤41 \le B \le 4), the number of fingers Yujin raises on one hand at the start.

Output

Print yt if Yongtae wins when both players follow the game as described. Print yj if Yujin wins.

Examples3

  1. Example 1

    Input
    1 2
    
    Expected output
    yt
    
  2. Example 2

    Input
    2 2
    
    Expected output
    yj
    
  3. Example 3

    Input
    3 1
    
    Expected output
    yj