k = int(eval(input()))

a, b = list(map(int, input().split()))

if k == 1:

  print("OK")

else:

  if b//k - a//k == 0 and a%k != 0:

    print("NG")

  else:

    print("OK")
k = int(eval(input()))

a, b = list(map(int, input().split()))



if b//k - a//k == 0 and a%k != 0:

  print('NG')

else:

  print('OK')
k = int(eval(input()))
a, b = list(map(int, input().split()))
if k == 1:
    print("OK")
else:
    if b // k - a // k == 0 and a % k != 0:
        print("NG")
    else:
        print("OK")

k = int(eval(input()))
a, b = list(map(int, input().split()))
if b // k - a // k == 0 and a % k != 0:
    print("NG")
else:
    print("OK")

-if k == 1: +if b // k - a // k == 0 and a % k != 0: +    print("NG") +else: -else: -    if b // k - a // k == 0 and a % k != 0: -        print("NG") -    else: -        print("OK")