import java.io.IOException; import java.io.InputStream; import java.util.NoSuchElementException; import java.util.Scanner; public class Main { 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 = line.replaceAll("[^\\w]{0,3}$", ""); ok = line.endsWith("nyo"); } else if (name.equals("petit")) { line = line.replaceAll("[^\\w]{0,3}$", ""); ok = line.endsWith("nyu"); } else if (name.equals("gema")) { line = line.replaceAll("[^\\w]{0,3}$", ""); ok = line.endsWith("gema"); } else if (name.equals("piyo")) { line = line.replaceAll("[^\\w]{0,3}$", ""); ok = line.endsWith("pyo"); } else if (name.equals("rabi")) { ok = line.matches(".*[a-z].*"); } System.out.println(ok ? "CORRECT (maybe)" : "WRONG!"); } } }