using System; using System.Collections.Generic; using System.Linq; namespace Test { class Program { static void Main(string[] args) { string s1 = Console.ReadLine(); string s2 = Console.ReadLine(); bool flag = !((s1[0] == '0' && s1.Length != 1) || (s2[0] == '0' && s2.Length != 1)); for (int i = 0; i < s1.Length; i++) { if (s1[i] < '0' || '9' < s1[i]) flag = false; } if (flag) { if (int.Parse(s1) > 12345) flag = false; } for (int i = 0; i < s2.Length; i++) { if (s2[i] < '0' || '9' < s2[i]) flag = false; } if (flag) { if (int.Parse(s2) > 12345) flag = false; } Console.WriteLine(flag ? "OK" : "NG"); } } }