#include #include #include bool ok(std::string s) { if(s[0] == '0' && s != "0") return false; for(char c : s) { if(!std::isdigit(c)) return false; } if(atoi(s.c_str()) > 12345) return false; return true; } int main() { std::string a, b; std::cin >> a >> b; if(ok(a) && ok(b)) { std::cout << "OK" << std::endl; } else { std::cout << "NG" << std::endl; } }