Under construction

Still being built. Things may change

Ainta Game

Time limit1sMemory limit512 MB

Summary
Given K, N, and M, decide who wins a game where a piece moves down, right, or diagonally by K on an N by M board, starting from the top-left corner.
Level

Hard8 of 10

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

Problem

Koosaga and cubelover play the Ainta game. The game starts with one chess piece on an N×MN \times M board. The piece is called "Ainta", a piece modeled after Ainta itself. Ainta can move down one square or right one square. Ainta also has an integer kk written on it, and it can move kk squares diagonally down and right. In other words, if Ainta is at (r,c)(r, c), it can move in one step to (r+1,c)(r+1, c), (r,c+1)(r, c+1), or (r+k,c+k)(r+k, c+k). Ainta cannot move off the board.

At the start, Ainta is on the top-left square. The two players take turns moving Ainta once each. The player who cannot move Ainta any further loses.

Write a program that determines who wins when both players play optimally. Koosaga moves first.

Input

The first line contains the number of test cases TT (1≤T≤100,0001 \le T \le 100{,}000). Each of the next TT lines contains one test case, consisting of KK, NN, and MM (1≤K,N,M≤1091 \le K, N, M \le 10^9).

Output

For each test case, print the winner. Print "koosaga" if Koosaga wins, or "cubelover" if cubelover wins.

Examples1

  1. Example 1

    Input
    10
    1 1 1
    1 2 1
    2 1 2
    2 2 2
    1 3 2
    2 3 2
    3 1 3
    3 2 3
    3 3 3
    4 3 3
    
    Expected output
    cubelover
    koosaga
    koosaga
    cubelover
    koosaga
    koosaga
    cubelover
    koosaga
    cubelover
    cubelover