K = int(eval(input()))

A, B = list(map(int, input().split()))



cnt = 1

while cnt <= 1000:

    if K * cnt >= A and K * cnt <= B:

        print('OK')

        exit()

    cnt += 1

print('NG')

K = int(eval(input()))

A, B = list(map(int, input().split()))



if A <= (B // K)*K:

    print('OK')

else:

    print('NG')

K = int(eval(input()))
A, B = list(map(int, input().split()))
cnt = 1
while cnt <= 1000:
    if K * cnt >= A and K * cnt <= B:
        print("OK")
        exit()
    cnt += 1
print("NG")

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

-cnt = 1 -while cnt <= 1000: -    if K * cnt >= A and K * cnt <= B: -        print("OK") -        exit() -    cnt += 1 -print("NG") +if A <= (B // K) * K: +    print("OK") +else: +    print("NG")