Under construction

Still being built. Things may change

Funny Number Game

Time limit0.5sMemory limit512 MB

Summary
Given a 4-digit N and M turns of incrementing one digit with 9 wrapping to 0, decide which player forces the final value above N.
Level

Hard8 of 10

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

Problem

Koosaga and Cubelover play a "number game". The game proceeds as follows.

  1. Choose a 4-digit integer NN and a number of turns MM.
  2. Koosaga moves first, and the two players alternate turns.
  3. On your turn, pick one digit of the integer and increase it by 1. If the chosen digit is 9, it becomes 0.

For example, 3590 can be changed to one of 4590, 3690, 3500, 3591. After the game ends, if the integer is greater than NN, Koosaga wins; otherwise Cubelover wins. Both players play optimally.

Given NN and MM, write a program that determines the winner.

Input

The first line contains a 4-digit integer NN and MM.

Output

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

Constraints

  • 0≤N<1040 \le N < 10^4
  • 0≤M≤1000 \le M \le 100

Examples5

  1. Example 1

    Input
    0000 0
    
    Expected output
    cubelover
    
  2. Example 2

    Input
    5566 3
    
    Expected output
    koosaga
    
  3. Example 3

    Input
    3333 10
    
    Expected output
    koosaga
    
  4. Example 4

    Input
    9999 9
    
    Expected output
    cubelover
    
  5. Example 5

    Input
    1234 30
    
    Expected output
    koosaga