Under construction

Still being built. Things may change

Prime Calling Game

Time limit1sMemory limit512 MB

Summary
Two players take turns calling unused primes from their own ranges, and the player who cannot call one loses. Find the winner under optimal play.
Level

Medium6 of 10

Topics
Game theory, Number theory, Math
Solved
No attempts yet

문제

Yongtae and Eugene want to play a prime-calling game. The game proceeds as follows.

  1. Yongtae chooses a range of primes A,BA, B. Yongtae may only call primes AA or greater and BB or less.
  2. Eugene chooses a range of primes C,DC, D. Eugene may only call primes CC or greater and DD or less.
  3. Starting with Yongtae, the two players take turns calling a prime within their own range. A prime must not have been called by anyone earlier in the game.
  4. The player who cannot call a prime any more loses.

Given the ranges for Yongtae and Eugene, who wins if both players play optimally?

입력

The first line contains integers A,BA, B (2≤A≤B≤1 0002 \le A \le B \le 1\ 000), the range of primes Yongtae may call.

The second line contains integers C,DC, D (2≤C≤D≤1 0002 \le C \le D \le 1\ 000), the range of primes Eugene may call.

출력

If both players play optimally and Yongtae wins, print yt. If Eugene wins, print yj.

Examples4

  1. Example 1

    Input
    2 3
    5 11
    
    Expected output
    yj
    
  2. Example 2

    Input
    2 5
    7 13
    
    Expected output
    yj
    
  3. Example 3

    Input
    5 7
    7 11
    
    Expected output
    yt
    
  4. Example 4

    Input
    11 17
    13 19
    
    Expected output
    yj