def is_capital(c): return (c>='A')and(c<='Z') def is_number(c): return (c>='0')and(c<='9') def cor_plate(s): sl = s.split(); if len(s)==0: return False if len(sl[0])==2: if not(is_capital(sl[0][0])and(is_capital(sl[0][1]))): return False; if len(sl[1])!=2: return False; if not(is_number(sl[1][0])and(is_number(sl[1][1]))): return False; if len(sl[2])!=3: return False; if not(is_capital(sl[2][0])and(is_capital(sl[2][1]))and(is_capital(sl[2][2]))): return False; elif len(sl[0])==1: if sl[0]!='B': return False; if (len(sl[1])!=2)and(len(sl[1])!=3): return False; if not(is_number(sl[1][0])and(is_number(sl[1][1]))): return False; if len(sl[1])==3: if not(is_number(sl[1][2])): return False if len(sl[2])!=3: return False; if not(is_capital(sl[2][0])and(is_capital(sl[2][1]))and(is_capital(sl[2][2]))): return False; else: return False; return True; N = int(raw_input()) L = [] for i in range(N): s=raw_input() L.append(s) for s in L: if cor_plate(s): print('Correct!') else: print('Incorrect!')