import sys #sys.stdin = open("data.in", "r") tests = int(sys.stdin.readline()) def incorrect(): print "Incorrect!" for test in xrange(tests): line = sys.stdin.readline()[0:9] elements = line[0:9].rstrip().split() if len(elements) != 3: incorrect() continue # first if len(elements[0]) == 1 and elements[0] != "B": incorrect() continue elif len(elements[0]) == 2 and not elements[0].isupper(): incorrect() continue elif elements[0] != "B" and len(elements[0]) != 2: incorrect() continue #second if not elements[1].isdigit(): incorrect() continue elif elements[0] == "B" and (len(elements[1]) != 2 and len(elements[1]) != 3): incorrect() continue elif elements[0] != "B" and len(elements[1]) != 2: incorrect() continue elif int(elements[1]) == 0: incorrect() continue #third if len(elements[2]) != 3 or not elements[2].isupper(): incorrect() continue print "Correct!"