"Duel!"

Betting on the lovely princess Claris, the duel between Tokitsukaze and Quailty has started.

There are $n$ cards in a row. Each card has two sides, one of which has color. At first, some of these cards are with color sides facing up and others are with color sides facing down. Then they take turns flipping cards, in which Tokitsukaze moves first. In each move, one should choose exactly $k$ consecutive cards and flip them to the same side, which means to make their color sides all face up or all face down. If all the color sides of these $n$ cards face the same direction after one's move, the one who takes this move will win.

Princess Claris wants to know who will win the game if Tokitsukaze and Quailty are so clever that they won't make mistakes.


-----Input-----

The first line contains two integers $n$ and $k$ ($1 \le k \le n \le 10^5$).

The second line contains a single string of length $n$ that only consists of $0$ and $1$, representing the situation of these $n$ cards, where the color side of the $i$-th card faces up if the $i$-th character is $1$, or otherwise, it faces down and the $i$-th character is $0$.


-----Output-----

Print "once again" (without quotes) if the total number of their moves can exceed $10^9$, which is considered a draw.

In other cases, print "tokitsukaze" (without quotes) if Tokitsukaze will win, or "quailty" (without quotes) if Quailty will win.

Note that the output characters are case-sensitive, and any wrong spelling would be rejected.


-----Examples-----
Input
4 2
0101

Output
quailty

Input
6 1
010101

Output
once again

Input
6 5
010101

Output
tokitsukaze

Input
4 1
0011

Output
once again



-----Note-----

In the first example, no matter how Tokitsukaze moves, there would be three cards with color sides facing the same direction after her move, and Quailty can flip the last card to this direction and win.

In the second example, no matter how Tokitsukaze moves, Quailty can choose the same card and flip back to the initial situation, which can allow the game to end in a draw.

In the third example, Tokitsukaze can win by flipping the leftmost five cards up or flipping the rightmost five cards down.

The fourth example can be explained in the same way as the second example does.

Difficulty: competition

Starter code:

Solutions:
import sys
import copy
input = sys.stdin.readline

n,k=list(map(int,input().split()))
C=list(input().strip())

def JUDGE(C):
    ANS_one=0
    ANS_zero=0

    for c in C:
        if c=="0":
            ANS_zero+=1
        else:
            break

    for c in C[::-1]:
        if c=="0":
            ANS_zero+=1
        else:
            break

    for c in C:
        if c=="1":
            ANS_one+=1
        else:
            break

    for c in C[::-1]:
        if c=="1":
            ANS_one+=1
        else:
            break

    if ANS_zero>=n-k or ANS_one>=n-k:
        return 1
    else:
        return 0

if JUDGE(C)==1:
    print("tokitsukaze")
    return

if k>=n-1:
    print("quailty")
    return
if k<n/2:
    print("once again")
    return
    

CAN1=copy.copy(C)
CAN2=copy.copy(C)

if C[0]=="0":
    for i in range(1,k+1):
        CAN1[i]="1"
else:
    for i in range(1,k+1):
        CAN1[i]="0"

if C[-1]=="0":
    for i in range(n-1,n-k-1,-1):
        CAN2[i]="1"
else:
    for i in range(n-2,n-k-2,-1):
        CAN2[i]="0"

if JUDGE(CAN1)==1 and JUDGE(CAN2)==1:
    print("quailty")
    return
else:
    print("once again")
    return
    
    
    


import sys

def sum_range(l, r):
    if r < l: return 0
    if l == 0: return sum[r]
    return sum[r] - sum[l - 1]

n, k = map(int, input().split())

cards = input()

sum = [0] * n
sum[0] = 1 if cards[0] == '1' else 0
for i in range(1, n):
    sum[i] += sum[i - 1]
    if cards[i] == '1':
        sum[i] += 1

min0 = min1 = n
max0 = max1 = -1
for i in range(0, n):
    if cards[i] == '1':
        min1 = min(min1, i)
        max1 = i
    else:
        min0 = min(min0, i)
        max0 = i
        
toki = False
qual = True
for i in range(0, n - k + 1):
    if sum_range(0, i - 1) + sum_range(i + k, n - 1) + k == n:
        toki = True
    if sum_range(0, i - 1) + sum_range(i + k, n - 1) + 0 == 0:
        toki = True
        
    prefix = sum_range(0, i - 1) == 0
    suffix = sum_range(i + k, n - 1) == 0
    if i > 0 and i + k < n and (prefix ^ suffix) == 0:
        qual = False
    if i - min0 > k or i - min1 > k or max0 - (i + k - 1) > k or max1 - (i + k - 1) > k:
        qual = False

if toki == True:
    print('tokitsukaze')
elif qual == True:
    print('quailty')
else:
    print('once again')