import java.io.UnsupportedEncodingException; import java.util.HashSet; import java.util.Scanner; import java.util.Set; public class Main { public static void main(String[] args) { new Main().solver(); } Set lowcase = new HashSet<>(); Set nonsymbol = new HashSet<>(); byte[] digi; byte[] petit; byte[] gema; byte[] piyo; @SuppressWarnings("unchecked") void solver() { byte[] l = null; byte[] d = null; try { d = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ123456789".getBytes("US-ASCII"); digi = "nyo".getBytes("US-ASCII"); petit = "nyu".getBytes("US-ASCII"); gema = "gema".getBytes("US-ASCII"); piyo = "pyo".getBytes("US-ASCII"); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } for (int i = 0; i < d.length; i++) { nonsymbol.add(d[i]); } Scanner sc = new Scanner(System.in); while (sc.hasNext()) { String who = sc.next(); if(who.contains("\n")){ System.out.println("WRONG!"); continue; } String line = sc.nextLine().toLowerCase(); if (isCorrect(who, line)) { System.out.println("CORRECT (maybe)"); } else { System.out.println("WRONG!"); } } } boolean isCorrect(String who, String line) { byte[] asciiCodes = null; try { asciiCodes = line.getBytes("US-ASCII"); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } if (who.equals("digi")) { if(bottom(digi, asciiCodes)){ return true; } } else if (who.equals("petit")) { if(bottom(petit,asciiCodes)){ return true; } } else if (who.equals("rabi")) { for(int i=0;i