k = int(eval(input()))

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



if (a%k == 0 or b%k == 0):

  print('OK')

elif (a//k != b//k):

  print('OK')

else:

  print('NG')
k = int(eval(input()))

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



Flag = False

for i in range(a, b+1):

  if (i%k == 0):

    Flag = True



if (Flag):

  print('OK')

else:

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

k = int(eval(input()))
a, b = list(map(int, input().split()))
Flag = False
for i in range(a, b + 1):
    if i % k == 0:
        Flag = True
if Flag:
    print("OK")
else:
    print("NG")

-if a % k == 0 or b % k == 0: -    print("OK") -elif a // k != b // k: +Flag = False +for i in range(a, b + 1): +    if i % k == 0: +        Flag = True +if Flag: