K = int(eval(input()))

score = input().split()

s1 = int(score[0])

s2 = int(score[1])

if ( s1 % K ) == 0:

		print('OK')

elif ( s2 % K ) == 0:

		print('OK')

elif ( s1 // K ) < ( s2 // K ):

		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()))
score = input().split()
s1 = int(score[0])
s2 = int(score[1])
if (s1 % K) == 0:
    print("OK")
elif (s2 % K) == 0:
    print("OK")
elif (s1 // K) < (s2 // K):
    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")

-score = input().split() -s1 = int(score[0]) -s2 = int(score[1]) -if (s1 % K) == 0: -    print("OK") -elif (s2 % K) == 0: -    print("OK") -elif (s1 // K) < (s2 // K): -    print("OK") -else: -    print("NG") +A, B = list(map(int, input().split())) +for i in range(A, B + 1): +    if i % K == 0: +        print("OK") +        exit() +print("NG")