import sys import re di = re.compile(r'\n[^a-zA-Z0-9]{0,3}(o|O)(y|Y)(n|N)') pe = re.compile(r'\n[^a-zA-Z0-9]{0,3}(u|U)(y|Y)(n|N)') ra = re.compile(r'\n.*[a-zA-Z0-9]+') ge = re.compile(r'\n[^a-zA-Z0-9]{0,3}(a|A)(m|M)(e|E)(g|G)') pi = re.compile(r'\n[^a-zA-Z0-9]{0,3}(o|O)(y|Y)(p|P)') AC='CORRECT (maybe)' WA='WRONG!' def solve(pattern,s): if re.match(pattern,s): return True return False for s in sys.stdin: words = s.split() if len(words)<=1: print(WA) continue flag = False if solve('digi ',s): if solve(di,s[:4:-1]): flag=True elif solve('petit ',s): if solve(pe,s[:5:-1]): flag=True elif solve('rabi ',s): if solve(ra,s[:4:-1]): flag=True elif solve('gema ',s): if solve(ge,s[:4:-1]): flag=True elif solve('piyo ',s): if solve(pi,s[:4:-1]): flag=True if flag: print(AC) else: print(WA)