k = int(eval(input()))

a, b = [int(e) for e in input().split()]



import numpy as np



ab = np.zeros((b-a)+1)



ab[:] = a



for i in range(b-a):

    ab[i+1:] +=1



if (ab % k == 0).sum() > 0:

    print('OK')

else:

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

a, b = [int(e) for e in input().split()]

ans='NG'

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

    if i%k == 0:

        ans='OK'

        break

    else:

        pass

print(ans)
k = int(eval(input()))
a, b = [int(e) for e in input().split()]
import numpy as np

ab = np.zeros((b - a) + 1)
ab[:] = a
for i in range(b - a):
    ab[i + 1 :] += 1
if (ab % k == 0).sum() > 0:
    print("OK")
else:
    print("NG")

k = int(eval(input()))
a, b = [int(e) for e in input().split()]
ans = "NG"
for i in range(a, b + 1):
    if i % k == 0:
        ans = "OK"
        break
    else:
        pass
print(ans)

-import numpy as np - -ab = np.zeros((b - a) + 1) -ab[:] = a -for i in range(b - a): -    ab[i + 1 :] += 1 -if (ab % k == 0).sum() > 0: -    print("OK") -else: -    print("NG") +ans = "NG" +for i in range(a, b + 1): +    if i % k == 0: +        ans = "OK" +        break +    else: +        pass +print(ans)