using System; using System.Collections.Generic; using System.Linq; class Program { public void Solve() { string[] AB = new string[2]; AB[0] = Console.ReadLine(); AB[1] = Console.ReadLine(); bool isOK = false; int chkNumeric = 0; foreach (string chkString in AB) { isOK = false; if (!int.TryParse(chkString, out chkNumeric)) { break; } if (1 < chkString.Length && chkString.Substring(0, 1) == "0") { break; } if (12345 < chkNumeric) { break; } isOK = true; } Console.WriteLine(isOK ? "OK" : "NG"); } static void Main() { var solver = new Program(); solver.Solve(); } }