K = int(eval(input()))

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



if K == 1:

    print('OK')

elif B - (B % K) >= A:

    print('OK')

else:

    print('NG')

K = int(eval(input()))

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



if B - (B % K) >= A:

    print('OK')

else:

    print('NG')

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

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

-if K == 1: -    print("OK") -elif B - (B % K) >= A: +if B - (B % K) >= A: