import java.io.PrintWriter import java.util.* @JvmField val INPUT = System.`in` @JvmField val OUTPUT = System.out @JvmField val cin = INPUT.bufferedReader() fun readLine(): String? = cin.readLine() fun readLn() = cin.readLine()!! @JvmField var _tokenizer: StringTokenizer = StringTokenizer("") fun read(): String { while (_tokenizer.hasMoreTokens().not()) _tokenizer = StringTokenizer(cin.readLine() ?: return "", " ") return _tokenizer.nextToken() } fun readInt() = read().toInt() fun readDouble() = read().toDouble() fun readLong() = read().toLong() fun readStrings(n: Int) = List(n) { read() } fun readLines(n: Int) = List(n) { readLn() } fun readInts(n: Int) = List(n) { read().toInt() } fun readIntArray(n: Int) = IntArray(n) { read().toInt() } fun readDoubles(n: Int) = List(n) { read().toDouble() } fun readDoubleArray(n: Int) = DoubleArray(n) { read().toDouble() } fun readLongs(n: Int) = List(n) { read().toLong() } fun readLongArray(n: Int) = LongArray(n) { read().toLong() } @JvmField val cout = PrintWriter(OUTPUT, false) fun solve(line: String): Boolean { if(line.isEmpty()) return false var s = line.toLowerCase(); for (i in 0 until 3){ if(s.isEmpty()) return false if(!s.last().isLetterOrDigit()) s = s.dropLast(1) } if(s.isEmpty()) return false if (line.startsWith("digi ")){ return s.endsWith("nyo") && s != "digi" }else if (line.startsWith("petit ")){ return s.endsWith("nyu") && s != "nyu" }else if(line.startsWith("rabi ")){ return s.length >= 5 && s.subSequence(5, s.length).any { it.isLetterOrDigit()} }else if(line.startsWith("gema ")){ return s.endsWith("gema") && s != "gema" }else if(line.startsWith("piyo ")) return s.endsWith("pyo") && s != "pyo" else return false } fun main(args: Array) { var s : String? while (true) { s = readLine() if(s == null) break cout.print(if (solve(s)) "CORRECT (maybe)\n" else "WRONG!\n") } cout.flush() }