NIT Raipur student 'Bhalli' have 16 numbers(non negative) which are in Arithematic Progression(Increasing AP) such that a1,a2,a3........a16(all integers).
Bhalli anyhow know the value of a1+a4+a7+a10+a13+a16=n(Integer).
Help Bhalli by telling him that the value he know is  correct or not.
Correct/Incorrect states  whether the given value of N is possible or not.

Input Format
First line contains the number of test cases T. 
Then every line t contains the value N(Integer);

Output Format
For correct value print "CORRECT" 
For incorrect value print "INCORRECT"

Constraints 
0=< N ≤500

SAMPLE INPUT
2                             
69                             
56

SAMPLE OUTPUT
CORRECT
INCORRECT
'''
# Read input from stdin and provide input before running code

name = raw_input('What is your name?\n')
print 'Hi, %s.' % name
'''
for t in xrange(input()):
	num = input()
	if num < 45:
		print "INCORRECT"
	elif num % 3 == 0:
		print "CORRECT"
	else:
		print "INCORRECT"