package no380; import java.util.Scanner; import java.util.regex.Pattern; public class Main { //無理 public static Pattern[] patterns = { Pattern.compile("digi +.*[nN][yY][oO][^a-zA-Z0-9]{0,3}"), Pattern.compile("petit +.*[nN][yY][uU][^a-zA-Z0-9]{0,3}"), Pattern.compile("rabi +.*[a-zA-Z0-9]+.*"), Pattern.compile("gema +.*[gG][eE][mM][aA][^a-zA-Z0-9]{0,3}"), Pattern.compile("piyo +.*[pP][yY][oO][^a-zA-Z0-9]{0,3}"),}; public static void main(String[] args) { Scanner sc = new Scanner(System.in); while(sc.hasNextLine()) { String s = sc.nextLine(); boolean correct = false; for(Pattern pat: patterns) { if (pat.matcher(s).matches()) { correct = true; break; } } if (correct) { System.out.println("CORRECT (maybe)"); }else{ System.out.println("WRONG!"); } } } }