import sys

input = sys.stdin.readline

from collections import *



K = int(eval(input()))

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



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

    if i%K==0:

        print('OK')

        exit()

    

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

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



if (A-1)//K!=B//K:

    print('OK')

else:

    print('NG')
import sys

input = sys.stdin.readline
from collections import *

K = int(eval(input()))
A, B = list(map(int, input().split()))
for i in range(A, B + 1):
    if i % K == 0:
        print("OK")
        exit()
print("NG")

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

-import sys - -input = sys.stdin.readline -from collections import * - -for i in range(A, B + 1): -    if i % K == 0: -        print("OK") -        exit() -print("NG") +if (A - 1) // K != B // K: +    print("OK") +else: +    print("NG")