#include int main(void){ char a[6],b[6]; int i,c; c = 0; scanf("%s",&a); scanf("%s",&b); for(i = 1;i >= 6;){ if(a[i] != 1 | a[i] != 2 | a[i] != 3 | a[i] != 4 | a[i] != 5 | a[i] != 6 | a[i] != 7 | a[i] != 8 | a[i] != 9){ c = 1; break; }else if(b[i] != 1 | b[i] != 2 | b[i] != 3 | b[i] != 4 | b[i] != 5 | b[i] != 6 | b[i] != 7 | b[i] != 8 | b[i] != 9){ c = 1; break; }else{ i++; } } if(c == 1){ printf("NG"); }else{ printf("OK"); } return 0; }