using System; using System.Collections.Generic; using System.Linq; public class yukicoder { public static bool numberCheck(string s) { foreach (char c in s) { if (!char.IsDigit(c)) { return false; } } return true; } public static bool zeroCheck(string s) { if (s.Length >= 2) { if (s.Substring(0, 1) == "0") { return false; } } return true; } public static bool rangeCheck(string s) { int n = int.Parse(s); if (n < 0 || n > 12345) { return false; } return true; } public static void Main() { string a = Console.ReadLine(); string b = Console.ReadLine(); bool checkFormat = true; if (!numberCheck(a) || !numberCheck(b)) { checkFormat = false; } else if (!zeroCheck(a) || !zeroCheck(b)) { checkFormat = false; } else if (!rangeCheck(a) || !rangeCheck(b)) { checkFormat = false; } if (checkFormat) { Console.WriteLine("OK"); } else { Console.WriteLine("NG"); } } }