K = int(eval(input()))

tmp = eval(input())

tmp = str.split(tmp,' ')

A = int(tmp[0])

B = int(tmp[1])

flag = 0

for i in list(range(A,B+1)):

    if(i%K == 0):

        flag = 1

        break;



if(flag == 1):

    print("OK")

else:

    print("NG")

K = int(eval(input()))

A,B = input().split()

A = int(A)

B = int(B)

largest = (B//K) * K



if A <= largest:

    print("OK")

else:

    print("NG")
K = int(eval(input()))
tmp = eval(input())
tmp = str.split(tmp, " ")
A = int(tmp[0])
B = int(tmp[1])
flag = 0
for i in list(range(A, B + 1)):
    if i % K == 0:
        flag = 1
        break
if flag == 1:
    print("OK")
else:
    print("NG")

K = int(eval(input()))
A, B = input().split()
A = int(A)
B = int(B)
largest = (B // K) * K
if A <= largest:
    print("OK")
else:
    print("NG")

-tmp = eval(input()) -tmp = str.split(tmp, " ") -A = int(tmp[0]) -B = int(tmp[1]) -flag = 0 -for i in list(range(A, B + 1)): -    if i % K == 0: -        flag = 1 -        break -if flag == 1: +A, B = input().split() +A = int(A) +B = int(B) +largest = (B // K) * K +if A <= largest: