import numpy as np

import math

k = int(eval(input()))

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

ans = False

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

    if i%k == 0:

        ans = True

        break



if ans:

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

import numpy as np
import math

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

-import numpy as np -import math - -ans = False -        ans = True -        break -if ans: -    print("OK") -else: -    print("NG") +        print("OK") +        exit() +print("NG")