#include #include int main(void){ char A[6]; char B[6]; int i; for(int count = 0; count < 2; count++){ scanf("%s",A); if(strlen(A) > 1){ // 012 -> NG // A > 12345 -> NG if(A[0] == 48){ printf("NG\n"); return 0; }else if(strlen(A) == 5 && strcmp(A,"12345") > 0){ printf("NG\n"); return 0; }else{ for(i = 0; A[i] != 0; i++){ // out of 0 ~ 9 -> NG if(A[i] < 48 || A[i] > 57){ printf("NG\n"); return 0; } } } }else{ // out of 0 ~ 9 -> NG if(A[0] < 48 || A[0] > 57){ printf("NG\n"); return 0; } } } printf("OK\n"); return 0; }