Quarry Game

Time limit2sMemory limit512 MB

Summary
Each of N piles is a run of M consecutive pile sizes starting at X; a move takes at least one stone from one pile. Decide the winner under optimal play.
Level

Hard9 of 10

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

Problem

Koosaga and Cubelover own NN quarries. Today they want to play a game with the quarries.

Each quarry holds some dump trucks. The number of dump trucks parked in the ii-th quarry is MiM_i. Each dump truck carries stones: the first truck carries XiX_i stones, the second carries Xi+1X_i+1 stones, the third carries Xi+2X_i+2 stones, ..., and the MiM_i-th truck carries Xi+Mi−1X_i+M_i-1 stones.

The two players take turns, and Koosaga moves first. On your turn you must choose one dump truck and remove stones from it. The number of stones removed must be at least 1. The player who cannot remove any more stones loses.

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

Input

The first line gives the number of quarries NN (1≤N≤100,0001 \le N \le 100,000). The next NN lines give the quarry information. Each quarry is described by two integers Xi,MiX_i, M_i (1≤Xi,Mi≤10161 \le X_i, M_i \le 10^{16}).

Output

Print "koosaga" if Koosaga wins, and "cubelover" if Cubelover wins.

Examples2

  1. Example 1

    Input
    2
    2 1
    3 2
    
    Expected output
    koosaga
    
  2. Example 2

    Input
    4
    1 1
    1 1
    1 1
    1 1
    
    Expected output
    cubelover