#include #include #include using namespace std; int main(void){ // Here your code ! string a,b; cin >> a >> b; bool f = true; if(a[0] == '0' && a.size() != 1) f = false; if(b[0] == '0' && b.size() != 1) f = false; for(int i = 1; i < a.size(); i++){ if( !(a[i] >= '0' && a[i] <= '9') ){ f = false; } } for(int i = 1; i < b.size(); i++){ if( !(b[i] >= '0' && b[i] <= '9') ){ f = false; } } if(f){ if(stoi(a) <= 12345 && stoi(b) <= 12345) cout << "OK" << endl; else cout << "NG" << endl; } else cout << "NG" << endl; }