k=int(eval(input()))

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

f=0

for i in range(1,1001):

    if a<=i*k<=b:

        f=1

        print("OK")

        break

if f==0:

    print("NG")

k=int(eval(input()))

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

f=0

for i in range(1,1001):

  if a<=i*k<=b:

    print("OK")

    f=1

    break

if f==0:

  print("NG")

k = int(eval(input()))
a, b = list(map(int, input().split()))
f = 0
for i in range(1, 1001):
    if a <= i * k <= b:
        f = 1
        print("OK")
        break
if f == 0:
    print("NG")

k = int(eval(input()))
a, b = list(map(int, input().split()))
f = 0
for i in range(1, 1001):
    if a <= i * k <= b:
        print("OK")
        f = 1
        break
if f == 0:
    print("NG")

+        print("OK") -        print("OK")