k =int(eval(input()))

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

flag = False

if b-a >= k:

  flag=True

else:

  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()))

flag = False





for i in range(a,b+1):#range(a,b+1)=[a,a+1,a+2,.....,b]

  if i % k == 0:

    flag=True

      

if flag :

  print("OK")

else:

  print("NG")

  

  
k = int(eval(input()))
a, b = list(map(int, input().split()))
flag = False
if b - a >= k:
    flag = True
else:
    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()))
flag = False
for i in range(a, b + 1):  # range(a,b+1)=[a,a+1,a+2,.....,b]
    if i % k == 0:
        flag = True
if flag:
    print("OK")
else:
    print("NG")

-if b - a >= k: -    flag = True -else: -    for i in range(a, b + 1): -        if i % k == 0: -            flag = True +for i in range(a, b + 1):  # range(a,b+1)=[a,a+1,a+2,.....,b] +    if i % k == 0: +        flag = True