k = int(eval(input()))

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



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

    if i%k == 0:

        print('OK')

        exit()



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

A,B=list(map(int,input().split()))

t=A%K

if t>=1 and B>=A+(K-t):

    print("OK")

elif t==0 and A<=B:

    print("OK")

else:

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

K = int(eval(input()))
A, B = list(map(int, input().split()))
t = A % K
if t >= 1 and B >= A + (K - t):
    print("OK")
elif t == 0 and A <= B:
    print("OK")
else:
    print("NG")

-k = int(eval(input())) -a, b = list(map(int, input().split())) -for i in range(a, b + 1): -    if i % k == 0: -        print("OK") -        exit() -print("NG") +K = int(eval(input())) +A, B = list(map(int, input().split())) +t = A % K +if t >= 1 and B >= A + (K - t): +    print("OK") +elif t == 0 and A <= B: +    print("OK") +else: +    print("NG")