import strutils proc echoNG = echo "NG"; quit() let A, B = stdin.readLine var flgNG: bool for AorB in [A, B]: if AorB.len != 1 and AorB[0] == '0': echoNG() for c in AorB: if not c.isDigit: echoNG() echo "OK"