using System.Numerics; public class Program { public static void Main() { //BigInteger num = BigInteger.Parse(Console.ReadLine() ?? string.Empty); //int num = int.Parse(Console.ReadLine() ?? string.Empty); //string[] moji = (Console.ReadLine() ?? string.Empty).Trim().Split(' '); string str = Console.ReadLine() ?? string.Empty; string str2 = Console.ReadLine() ?? string.Empty; if (str != "0" && str[0] == '0' || str != "0" && str2[0] == '0') { Console.WriteLine("NG"); return; } for (int i = 0; i < str.Length; i++) { if (Char.IsUpper(str[i]) || Char.IsLower(str[i])) { Console.WriteLine("NG"); return; } } for(int i = 0;i < str2.Length; i++) { if (Char.IsUpper(str2[i]) || Char.IsLower(str2[i])) { Console.WriteLine("NG"); return; } } if(int.Parse(str) > 12345||int.Parse(str2) > 12345) { Console.WriteLine("NG"); return; } Console.WriteLine("OK"); } }