#include #include int main(){ int a=0,b=0,miss=0; char A[6],B[6]; scanf("%s %s",A,B); for(int i=0;iA[i] && A[i]>'9' && (i==0 && A[i]=='0' && strlen(A)>1) ){ miss=1;break; } a=a*10+A[i]-'0'; } for(int i=0;iB[i] || B[i]>'9' || (i==0 && B[i]=='0' && strlen(B)>1) ){ miss=1;break; } b=b*10+B[i]-'0'; } if(a>12345 || b>12345)miss=1; if(miss==0)printf("OK\n"); else printf("NG\n"); return 0; }