import scala.io.StdIn.readLine import scala.util.matching.Regex object RainSnow446 { def main(args:Array[String]): Unit ={ def isNumContain(str:String) = str.matches("""^[1-9]+[0-9]*|0""") val a = readLine() val b = readLine() if(isNumContain(a) && isNumContain(b) && (a.toInt <= 12345) && (b.toInt <= 12345)) println("OK") else println("NG") } }