while 1:s=input().strip();print('XCO'[len(s)%-2|all(str(k*6+99).strip(s[:5])for k in b'%R[ckmsy')])