from itertools import * from bisect import * from math import * from collections import * from heapq import * from random import * import numpy as np import sys sys.setrecursionlimit(10 ** 6) int1 = lambda x: int(x) - 1 p2D = lambda x: print(*x, sep="\n") def II(): return int(sys.stdin.readline()) def MI(): return map(int, sys.stdin.readline().split()) def MI1(): return map(int1, sys.stdin.readline().split()) def MF(): return map(float, sys.stdin.readline().split()) def LI(): return list(map(int, sys.stdin.readline().split())) def LI1(): return list(map(int1, sys.stdin.readline().split())) def LF(): return list(map(float, sys.stdin.readline().split())) def LLI(rows_number): return [LI() for _ in range(rows_number)] dij = [(1, 0), (0, 1), (-1, 0), (0, -1)] def main(): def ok(line): if len(line)==1:return False if line[0]=="digi": e=line[-1] n=len(e) if n<3:return False i=n-1 while not e[i].isalnum(): i-=1 if i<2 or n-1-i>3:return False if e[i-2] not in ["N","n"]:return False if e[i-1] not in ["Y","y"]:return False if e[i] not in ["O","o"]:return False elif line[0] == "petit": e=line[-1] n=len(e) if n<3:return False i=n-1 while not e[i].isalnum(): i-=1 if i<2 or n-1-i>3:return False if e[i-2] not in ["N","n"]:return False if e[i-1] not in ["Y","y"]:return False if e[i] not in ["U","u"]:return False elif line[0]=="rabi": for word in line[1:]: for c in word: if c.isalnum():return True return False elif line[0]=="gema": e=line[-1] n=len(e) if n<4:return False i=n-1 while not e[i].isalnum(): i-=1 if i<3 or n-1-i>3:return False if e[i-3] not in ["G","g"]:return False if e[i-2] not in ["E","e"]:return False if e[i-1] not in ["M","m"]:return False if e[i] not in ["A","a"]:return False elif line[0]=="piyo": e=line[-1] n=len(e) if n<3:return False i=n-1 while not e[i].isalnum(): i-=1 if i<2 or n-1-i>3:return False if e[i-2] not in ["P","p"]:return False if e[i-1] not in ["Y","y"]:return False if e[i] not in ["O","o"]:return False else:return False return True s=sys.stdin.read()[:-1] s=s.split("\n") s=[line.split(" ") for line in s] for line in s: if ok(line):print("CORRECT (maybe)") else:print("WRONG!") main()