#include #include using namespace std; using namespace atcoder; using ll = long long; using ld = long double; string a, b; int main() { cin >> a >> b; for (int i = 0; i < a.size(); i++) { if (!isdigit(a[i])) { cout << "NG" << endl; return 0; } } for (int i = 0; i < b.size(); i++) { if (!isdigit(b[i])) { cout << "NG" << endl; return 0; } } ll A = stoll(a), B = stoll(b); if (a == to_string(A) && b == to_string(B)) { if (0 <= A && A <= 12345 && 0 <= B && B <= 12345) { cout << "OK" << endl; return 0; } } cout << "NG" << endl; return 0; }