using System; using System.Linq; class No446 { static void Main() { var IsTrue = true; for (int i = 0; i < 2; ++i) { var str = Console.ReadLine(); if (str.All(x => char.IsNumber(x))) { var firstNum = Int32.Parse(str); IsTrue = firstNum <= 12345; if (!IsTrue) break; IsTrue = (int)Math.Log10(firstNum == 0 ? 1 : firstNum) + 1 == str.Count(); } else { IsTrue = false; break; } } Console.WriteLine(IsTrue ? "OK" : "NG"); } }