Under construction

Still being built. Things may change

1D Stone Game 2

Time limit1sMemory limit1024 MB

Summary
Two players take turns removing consecutive stones from a 1 by n row, with the move size capped by the previous move, and the task is to find the winner for each n.
Level

Hard8 of 10

Topics
Game theory, Math, Implementation
Solved
No attempts yet

Problem

This problem differs from 1D Stone Game 1 only in the bold part.

Dongwoo and Jaewoo play a game on a 1×n1\times n straight grid. At the start, each cell holds exactly one stone.

The game starts with Dongwoo, and the players take turns. Dongwoo plays on odd-numbered turns, and Jaewoo plays on even-numbered turns.

  • On the first turn, choose 1 cell and take the stone on it.
  • From the second turn on, if the opponent took xx stones on the previous turn, choose an integer yy with 1≤y≤x+11 \le y \le x+1, then choose yy consecutive cells that have stones, and take all stones in those cells.
  • After each move, if the remaining stones form two parts separated by the cells that were taken, discard all stones in the part with fewer stones. If both parts have the same number of stones, choose one part and discard its stones. If the remaining stones form only one part, discard nothing.
  • A player who cannot make a legal move on their turn loses, and the opponent wins.

Assuming both players play optimally, print who wins.

Input

The first line contains the number of test cases TT. (1≤T≤106)(1\le T \le 10^6)

Each of the following lines contains the initial number of stones nn for one test case. (1≤n≤1018)(1\le n\le 10^{18})

The same nn does not appear more than once.

Output

For each test case, print kidw0124 if Dongwoo wins, or eoaud0108 if Jaewoo wins. Print one result per line.

Examples1

  1. Example 1

    Input
    3
    1
    4
    8
    
    Expected output
    kidw0124
    kidw0124
    eoaud0108