import java.util.Scanner; public class Main { private static boolean[] isMark = new boolean[256]; static { for (int i = 0; i < 256; i++) { if ('0' <= i && i <= '9' || 'a' <= i && i <= 'z' || 'A' <= i && i <= 'Z') { } else { isMark[i] = true; } } } public static void main(String[] args) { Scanner sc = new Scanner(System.in); while (sc.hasNext()) { String name = sc.next(); String line = sc.nextLine().toLowerCase(); boolean ok = false; if (name.equals("digi")) { line = trim(line); ok = line.endsWith("nyo"); } else if (name.equals("petit")) { line = trim(line); ok = line.endsWith("nyu"); } else if (name.equals("gema")) { line = trim(line); ok = line.endsWith("gema"); } else if (name.equals("piyo")) { line = trim(line); ok = line.endsWith("pyo"); } else if (name.equals("rabi")) { for (char c : line.toCharArray()) { if (!isMark[c]) { ok = true; break; } } } System.out.println(ok ? "CORRECT (maybe)" : "WRONG!"); } } private static String trim(String s) { for (int i = 0; s.length() > 0 && i < 3 && isMark[s.charAt(s.length() - 1)]; i++) { s = s.substring(0, s.length() - 1); } return s; } }