In a regular table tennis match, the player who serves changes every time after 2 points are scored, regardless of which players scored them.
Chef and Cook are playing a different match — they decided that the player who serves would change every time after $K$ points are scored instead (again regardless of which players scored them). When the game starts, it's Chef's turn to serve.
You are given the current number of points scored by Chef and Cook ($P_1$ and $P_2$ respectively). Find out whether Chef or Cook has to serve next.

-----Input-----
- The first line of the input contains a single integer $T$ denoting the number of test cases. The description of $T$ test cases follows.
- The first and only line of each test case contains three space-separated integers $P_1$, $P_2$ and $K$.

-----Output-----
For each test case, print a single line containing the string "CHEF" if it is Chef's turn or "COOK" if it is Cook's turn.

-----Constraints-----
- $1 \le T \le 10^5$
- $1 \le K \le 10^{9}$
- $0 \le P_1, P_2 \le 10^{9}$ 

-----Subtasks-----
Subtask #1 (100 points): original constraints

-----Example Input-----
3
1 3 2
0 3 2
34 55 2

-----Example Output-----
CHEF
COOK
CHEF

-----Explanation-----
Example case 1: Chef serves for the first two points, Cook serves for the next two, so Chef has to serve again now.

Difficulty: interview

Starter code:

Solutions:
n=int(input())
for i in range(n):
  l=list(map(int,input().split()))
  k=l[0]+l[1]
  k=k%(2*l[2])
  
  if k>=0 and k<l[2]:
    print("CHEF")
  else:
    print("COOK")


t=int(input())
while t>0:
 p1,p2,k=map(int,input().split())
 s=(p1+p2)//k
 if s%2==0:
  print("CHEF")
 else:
  print("COOK")
 t=t-1

# cook your dish here
t=int(input())
while t>0:
 p1,p2,k=list(map(int,input().split()))
 s=(p1+p2)//k
 if s%2==0:
  print("CHEF")
 else:
  print("COOK")
 t=t-1
 


for _ in range(int(input())):
 chef,cook,k = map(int,input().split())
 ans = (chef+cook)//k 
 
 if ans%2 ==0:
  print("CHEF")
 else:
  print("COOK")

# cook your dish here
for _ in range(int(input())):
 p1,p2,k=map(int,input().split())
 x = (p1+p2)//k
 if(x%2 == 0):
  print("CHEF")
 else:
  print("COOK")

import collections
from collections import defaultdict
import math




#for _ in range(1):
for _ in range(int(input())):
 #n=int(input())
 
 #k=int(input())
 p1,p2,k=[int(x) for x in input().split()]
 
 #c=[int(x) for x in input().split()]
 r = math.floor((p1+p2)/k)
 #rem=(p1+p2)%k    
 if r%2==0:
   print("CHEF")
 else:
  print("COOK") 




for _ in range(int(input())):
 p1,p2,k = map(int,input().split())
 x = (p1+p2)//k 
 if x%2==0:
  print("CHEF")
 else:
  print("COOK")

# cook your dish here
t=int(input())
while t>0:
 p1,p2,k=map(int,input().split())
 if ((p1+p2)//k)%2==0:
  print("CHEF")
 else:
  print("COOK")
 t-=1

# cook your dish here
for l in range(int(input())):
 p1,p2,k=list(map(int,input().split()))
 p=p1+p2
 a=p//k
 if a%2==0:
  print("CHEF")
 else:
  print("COOK")


for _ in range(int(input())):
 a,b,k=map(int,input().split())
 c=a+b
 d=c//k
 if d%2==0:
  print('CHEF')
 elif d%2!=0:
  print('COOK')

# cook your dish here
t=int(input())
for i in range(t):
 p1,p2,k=list(map(int,(input()).split()))
 a=p1+p2
 if (a//k)%2==0:
  print("CHEF")
 else:
  print("COOK")



for k in range(int(input())):
 p1,p2,w = map(int,input().split())



 u = p1+p2
 u//=w
 if u%2:
  print('COOK')
 else:
  print('CHEF')

# cook your dish here
T=int(input())
for _ in range(T):
 p1,p2,k=map(int,input().split())
 num=p1+p2
 res=num//k
 if res%2:            
  print('COOK')
 else:
  print('CHEF')

# cook your dish here
T=int(input())
for _ in range(T):
 p1,p2,k=map(int,input().split())
 num=p1+p2
 res=num//k
 if res%2:            
  print('COOK')
 else:
  print('CHEF')

# cook your dish here
T=int(input())
for _ in range(T):
 p1,p2,k=map(int,input().split())
 num=p1+p2
 if num%k:
  res=num//k
  if res%2:
   print('COOK')
  else:
   print('CHEF')
 else:
  res=num//k
  if res%2:
   print('COOK')
  else:
   print('CHEF')

# cook your dish here
t=int(input())
for i in range(t):
 l,m,k=map(int,input().split())
 a=l+m+1
 if a%k==0:
  b=a/k
 else:
  b=int(a/k)+1
 if b%2==0:
  print("COOK")
 else:
  print("CHEF")

for _ in range(int(input())) :
 p1, p2, k = map(int,input().split())
 s = p1 + p2 + 1
 if s % k == 0 :
  c = s / k
 else :
  c = int(s/k) + 1
 if c % 2 == 0 :
  print("COOK")
 else :
  print("CHEF")

for _ in range(int(input())):
 p1,p2,k=list(map(int,input().split()))
 p=p1+p2
 a=p//k
 if a%2==0:
  print("CHEF")
 else:
  print("COOK")


for _ in range(int(input())):
 P1,P2,k=map(int, input().split())
 d=(P1+P2)//k
 if d%2==0:
  print("CHEF")
 else:
  print("COOK")

for _ in range(int(input())):
 P1,P2,k=map(int, input().split())
 d=(P1+P2)//k
 if d%2==0:
  print("CHEF")
 else:
  print("COOK")

for _ in range(int(input())):
 P1,P2,k=list(map(int, input().split()))
 d=(P1+P2)//k
 if d%2==0:
  print("CHEF")
 else:
  print("COOK")


t=int(input())
for i in range(t):
 p1,p2,k=list(map(int,input().split()))
 p=0
 p=p1+p2
 d=0
 d=p//k
 if(d%2==0):
  print("CHEF")
 else:
  print("COOK")


try:
 for _ in range(int(input())):
  p1,p2,k=list(map(int,input().split()))
  if ((p1+p2)//k)%2==0:
   print("CHEF")
  else:
   print("COOK")
except:
 pass


try:
 for _ in range(int(input())):
  p1,p2,k=list(map(int,input().split()))
  if ((p1+p2)//k)%2==0:
   print("CHEF")
  else:
   print("COOK")
except:
 pass


# cook your dish here
t=int(input())
for r in range(t):
  p1,p2,k=map(int,input().split())
  x=p1+p2
  y=x//k
  if(y%2==0):
   print("CHEF")
  else:
   print("COOK")