'''
Created on 26 apr. 2016

@author: Casian_
'''
def testUpper(t):
    ok = True
    for x in t:
        ok = ok and x.isupper()
    return ok

n = int(input())
for i in range(0,n):
    t = input()
    t = t.split(' ')
    if len(t)!=3:
        print ("Incorrect!")
        continue
    if ((testUpper(t[0])) and (t[1].isnumeric()) and (testUpper(t[2]))):
        pass
    else:
        print ("Incorrect!")
        continue
    if (len(t[0]) not in [1,2]) or (len(t[1]) not in [2,3]) or (len(t[2]) != 3):
        print ("Incorrect!")
    elif (len(t[0]) == 1) and (t[0] !="B"):
        print ("Incorrect!")
    elif (len(t[0]) == 2) and (len(t[1]) != 2):
        print ("Incorrect!")
    else:
        print ("Correct!")