# Author: Ivan Kazmenko (gassa@mail.ru)
 
m = 0
def c (n):
	global m
	m = max (m, n)
	return n // 2 if n % 2 == 0 else n * 3 + 1
 
limit = 20
def steps (n):
	n0 = n
	for s in range (limit):
		n = c (n)
		if n < n0:
			return s
	return limit
 
t = int (input ())
for _ in range (t):
	n = int (input ())
	while n > 1:
		print ("random" if steps (n) >= limit else "collatz")
		n = int (input ())
 
import sys
print ("maximum visited is", m, file = sys.stderr)
