#!/usr/bin/env python3 import sys import re suffix = '[^a-z0-9]?' * 3 + '$' for line in sys.stdin: words = line.rstrip().split(' ') p = words[0] words = [s.lower() for s in words[1:]] flg = False if p == 'digi': flg |= all([w == 'nyo' for w in words]) flg |= re.match('^.*nyo' + suffix, words[-1]) != None elif p == 'petit': flg |= all([w == 'nyu' for w in words]) flg |= re.match('^.*nyu' + suffix, words[-1]) != None elif p == 'rabi': flg |= all([re.match('^.*[a-z0-9].*$', w) != None for w in words]) elif p == 'gema': flg |= all([w == 'gema' for w in words]) flg |= re.match('^.*gema' + suffix, words[-1]) != None elif p == 'piyo': flg |= all([w == 'pyo' for w in words]) flg |= re.match('^.*pyo' + suffix, words[-1]) != None if flg: print('CORRECT (maybe)') else: print('WRONG!')