#include using namespace std; #ifdef LOCAL #include "settings/debug.cpp" #else #define Debug(...) void(0) #endif #define rep(i, n) for (int i = 0; i < (n); ++i) using ll = long long; using ull = unsigned long long; inline bool isDigit(string s) { if (s[0] == '0' && s.size() > 1) return false; return all_of(s.begin(), s.end(), ::isdigit); } int main() { string a, b; cin >> a >> b; if (isDigit(a) && isDigit(b)) { int x = stoi(a), y = stoi(b); if (0 <= x && x <= 12345 && 0 <= y && y <= 12345) { cout << "OK" << endl; return 0; } } cout << "NG" << endl; return 0; }