using System; public class Hello { public static void Main() { for (int i = 0; i < 2; i++) { var s = Console.ReadLine().Trim(); if (!check(s)) { Console.WriteLine("NG"); goto end; } } Console.WriteLine("OK"); end:; } public static bool check (string s) { if (s.Length >= 6) return false; int a; if (!int.TryParse(s, out a)) return false; if (a < 0 | a > 12345) return false; if (s.Length != a.ToString().Length) return false; return true; } }