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

        break



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):
    if i % K == 0:
        flag = True
        break
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())) +k = int(eval(input())) +a, b = list(map(int, input().split())) -for i in range(A, B + 1): -    if i % K == 0: -        flag = True -        break +if b - a >= k: +    flag = True +else: +    for i in range(a, b + 1): +        if i % k == 0: +            flag = True