k = int(eval(input()))

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

ok = False

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

    if i % k == 0: ok = True

if ok == 0: print("NG")

else : print("OK")
k = int(eval(input()))

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

r = (b // k) * k

if a <= r: print('OK')

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

k = int(eval(input()))
a, b = list(map(int, input().split()))
r = (b // k) * k
if a <= r:
    print("OK")
else:
    print("NG")

-ok = False -for i in range(a, b + 1): -    if i % k == 0: -        ok = True -if ok == 0: +r = (b // k) * k +if a <= r: +    print("OK") +else: -else: -    print("OK")