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
t = input()
for T in range(t):
	n = input()
	if n<45:
		print "INCORRECT"
	elif n%3 == 0:
		print "CORRECT"
	else:
		print "INCORRECT"