This page is still under construction.

Parts of this page are still being built. What you see may change.

Prime Jingle Bells

Time limit1sMemory limit512 MB

Summary
Two players alternately ring bells 1 to A times until the total reaches B; whoever rings on a prime-numbered count scores, and with optimal play we decide who wins.
Level

Medium7 of 10

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

Problem

Kuro and Siro are playing a game. The rules are as follows.

  1. The two players take turns, and on a turn a player may ring the jingle bells at least 11 time and at most AA times.
  2. The game ends the moment the total number of times the two players have rung the jingle bells reaches BB.
  3. A player scores 1 point each time the jingle bells are rung for a prime-numbered time.
  4. When the game ends, the player with the higher score wins.

Kuro and Siro are both very smart and always make the best choice. If Kuro starts first, who wins?

Input

The first line gives the number of test cases, an integer T(1≤T≤10)T(1 ≤ T ≤ 10).

From the second line, each test case is given on one line as integers A(1≤A≤2,000)A(1 ≤ A ≤ 2,000) and B(A≤B≤2,000)B(A ≤ B ≤ 2,000) separated by a space.

Output

For each test case, print kuro on its own line if Kuro wins, siro if Siro wins, and draw if the two have equal scores.

Examples2

  1. Example 1

    Input
    2
    2 4
    2 5
    
    Expected output
    draw
    kuro
    
  2. Example 2

    Input
    1
    2 5
    
    Expected output
    kuro