peterverebics/CodeNet_Python_118 huggingface dataset:
k = int(input())
a, b = map(int, input().split())
for i in range(a, b+1):
    if i%k == 0:
        print("OK")
        exit()
print("NG")
N = int(input())
lis = input().split()
a = int(lis[0])
b = int(lis[1])

#print(a, b)

li = []
zero = 0

for i in range(a, b+1):
    if i % N == 0:
        print("OK")
        zero = 1
        break

if zero == 0:
    print("NG")
def Main(K, A, B):
    for i in range(A, B+1):
        if i%K == 0:
            return 'OK'
    return 'NG'

def main():
    K = int(input())
    A, B = map(int, input().split())
    print(Main(K, A, B))

if __name__ == '__main__':
    main()
K = int(input())
A, B = map(int, input().split())

i = B - A
c = 0

for i in range(A, B + 1):
    if i % K == 0:
        c = 1

if c == 1:
    print('OK')
else:
    print('NG')
k = int(input())
a, b = map(int, input().split())


for i in range(a, b+1):
    if i % k == 0:
        print("OK")
        exit(0)

print("NG")
k = int(input())
abs = [int(e) for e in input().split()]

for i in range(abs[0],abs[1]+1):
  if i % k == 0:
    print("OK")
    break
else :
  print("NG")
k=int(input())
a,b = map(int,input().split())
c=0 
for i in range(a,b+1):
  if i%k == 0:
    c = c + 1
if c > 0:
  print("OK")
else:
  print("NG")
k=int(input())
a,b=map(int, input().split())
val=0
for i in range(a,b+1):
    if i%k==0:
        val=1
        break
if val==1:
    print("OK")
else:
    print("NG")
K = int(input())
A, B = [int(e) for e in input().split(" ")]

for i in range(A, B + 1):
    if i % K == 0:
        print("OK")
        exit()

print("NG")
k = int(input())
a, b = [int(x) for x in input().split()]
result = False
check = [x*k for x in range(0, 1000)]
for i in check:
    if (i >= a and i <= b):
        result = True
    else:
        continue

if result:
    print('OK')
else:
    print('NG')
k=int(input())
a,b=map(int,input().split( ))
for i in range(a,b+1):
 if i%k==0:
  print("OK")
  exit()
print("NG")
k=int(input())
a,b=map(int,input().split())
ans="NG"
for i in range(a,b+1):
    if i%k==0:
        ans="OK"
        break 
print(ans)
K = int(input())
A,B = map(int, input().split())

print("ONKG"[B%K>B-A::2])
k=int(input())
count=0
a,b=map(int,input().split())
for i in range(a,b+1):
  if(i%k==0):
    count+=1
    break
if(count==1):
  print("OK")
elif(count==0):
  print("NG")
# A - We Love Golf
def main():
    K, A, B = map(int, open(0).read().split())
    print("OK" if ((A + K - 1) // K) * K <= B else "NG")


if __name__ == "__main__":
    main()
k = int(input())
a,b = map(int,input().split())
flag = "ng"
for i in range(a,b+1):
    if i % k == 0:
        flag = "ok"
if flag == "ok":
    print("OK")
else:
    print("NG")
K=int(input())
a,b=map(int,input().split())
print("OK" if b%K<b-a+1 else "OK" if K==1 else "NG")
k = int(input())
a,b = map(int,input().split())
x = 0

for i in range(a,b+1):
  if i%k == 0:
    print('OK')
    x = 1
    break

if x == 0:
  print('NG')
k = int(input())
a, b = map(int, input().split())

flag = False
for i in range(a, b + 1):
    if i%k == 0:
        flag = True
        break

if flag:
    print ("OK")
else:
    print ("NG")
k = int(input())
a, b = map(int, input().split())

x = 0

# rangeは最後を取らない
for i in range(b - a + 1):
    # print(i)
    # print(i, b-a)
    # print("a")
    if a % k == 0:
        x = 1
        break
    # print(x)
    a += 1

# print(x)
if(x == 1):
    print('OK')
else:
    print('NG')
n = int(input())
a, b = map(int, input().split())
i = 0
ans = "NG"
while i <= b:
    if i >= a and i % n == 0:
        ans = "OK"
    i += n

print(ans)
K = int(input())
A,B = map(int,input().split())
for i in range(A,B+1):
  if i%K == 0:
    print("OK")
    exit()
print("NG")
import sys
k = int(input())
a,b = map(int,input().split())
for i in range(a,b+1):
    if i % k == 0:
        print("OK")
        sys.exit()
print("NG")
#1
import sys
K=int(input())
A,B=map(int, input().split())

if A==B:
    if A%K==0:
        print("OK")
        sys.exit()
else:
    for i in range(A,B+1):
        if i%K==0:
            print("OK")
            sys.exit()
print("NG")
import sys
K = int(input())
A, B = map(int, input().split())
for i in range(A, B+1):
    if i%K == 0:
        print('OK')
        sys.exit()
print('NG')
n = int(input())
low, high = map(int,input().split())
for i in range(low, high + 1):
    if i % n == 0:
        print("OK")
        exit()
        
print("NG")
k = int(input())
a, b = map(int, input().split())
flag = False
for i in range(a, b + 1):
    if i % k == 0:
        flag = True
        break
if flag == True:
    print("OK")
else:
    print("NG")
K=int(input())
A,B = map(int,input().split())
flg = False
for i in range(A,B+1):
    if i%K == 0:
        flg = True
if flg == True:
    print("OK")
else:
    print("NG")
k = int(input())
a,b = map(int, input().split())
cnt = 0
for i in range(a, b+1):
    if i%k == 0:
        print("OK")
        break
    else:
        cnt += 1
        if cnt == b-a+1:
            print("NG")
            break
K = int(input())
A, B = [int(x) for x in input().split()]

print("OK" if A // K < B // K or A % K == 0 or B % K == 0 else "NG")
import sys
k = int(input())
a, b = map(int, input().split())
i = a // k
while k * i <= b:
    if k * i >= a:
        print('OK')
        sys.exit()
    i += 1
print('NG')
k=int(input())
a,b=map(int,input().split())

ans=False
for i in range(a,b+1):
    if i%k==0:
        ans=True
        break

if ans:
    print('OK')
else:
    print('NG')
row1 = input()
row2 = input()
k = int(row1)
a = int(row2.split(' ')[0])
b = int(row2.split(' ')[1])
for i in range(a, b + 1):
    if i % k == 0:
        print('OK')
        break
else:
    print('NG')
K = int(input())
A, B = map(int, input().split())

flag = 0
for i in range(A,B+1):
    if i%K == 0:
        flag = 1
        break
if flag == 1:
    print("OK")
else:
    print("NG")
k = int(input())
a, b = map(int,input().split())
list1 = []
x =(k+a-1)//k
y = b // k

for i in range(x,y+1):
  list1.append(i)
if list1 == []:
  print('NG')
else:
  print('OK')
k=int(input())
a,b=map(int,input().split())
c=0
for i in range(a,b+1):
    if i%k==0:
        c=1
if c==1:   
    print("OK")
else:
    print("NG")
K = int(input())
A,B = map(int, input().split())

# K 
# A B
x = B-B%K
if x >= A:
    print('OK')
else:
    print('NG')
K = int(input())
A, B = (int(x) for x in input().split())
length = (B-A) + 1
answer = True

for i in range(length):
    if A%K == 0:
        answer = True
        break
    else:
        answer = False
    A += 1

if answer:
    print('OK')
else:
    print('NG')
K = input()
K = int(K)
ab = list(map(int, input().split()))
S = 0

for i in range(1000):
    if ab[0] <= (i + 1) * K and (i + 1) * K <= ab[1]:
        print("OK")
        break
    S += 1
if S == 1000:

    print("NG")
n = int(input())
x,y = map(int,input().split())
flg = "NG"
for i in range(x,y+1):
	if i%n==0:
		flg = "OK"
		break
	else:
		pass
print(flg)
K = int(input())
A,B = list(map(int,input().split()))
for i in range(A,B+1):
    if i%K == 0:
        print("OK")
        break
else:
    print("NG")
k = int(input())
a, b = map(int, input().split())
flag = 0
for i in range(a, b + 1):
  if i % k == 0:
    flag = 1
    break
if flag == 1:
  print("OK")
else:
  print("NG")
K=int(input())
A,B=map(int,input().split())
if (B//K)*K>=A:
    print("OK")
else:
    print("NG")
K = int(input())
list = list(map(int, input().split()))
while list[0]<=list[1]:
  if list[0]%K==0:
    print('OK')
    exit()
  list[0]+=1
print('NG')
K = int(input())
A,B = list(map(int, input().split()))

for i in range(A,B+1):
  if i%K == 0:
    print('OK')
    exit(0)
    
print('NG')
k = int(input())
#print(k)
i = list(map(int, input().split()))
#print(i[0])
#print(i[1])
x = 0
for n in range(i[0], i[1]+1):
  if n % k == 0:
    print("OK")
    x = 1
    break
if x == 0:    
  print("NG")
import sys

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

for n in range (A,B+1):
  if n%K == 0:
    print("OK")
    sys.exit()
print("NG")
import sys
readline = sys.stdin.readline

K = int(readline())
A, B = map(int, readline().split())
ans = 'NG'
for x in range(A, B+1):
    if x%K == 0:
        ans = 'OK'
print(ans)
k = int(input())
a, b = map(int, input().split())

for i in range(a, b+1):
    if i % k == 0:
        print ('OK')
        exit(0)
print('NG')
K = int(input())
A,B = map(int,input().split())

for i in range(A,B+1):
    if i % K == 0:
        print("OK")
        break
else:
    print("NG")
k = int(input())
a, b = map(int, input().split())
ans1 = a//k
ans2 = b//k

if ans1 == a/k:
    print("OK")
elif ans2 == b/k:
    print("OK")
elif ans1 < ans2:
    print("OK")
else:
    print("NG")
k = int(input())
a, b = map(int, input().split())

ans = "NG"
for i in range(a, b + 1):
    ans = "OK" if (i % k == 0) else ans

print(ans)
k = int(input())
a, b = map(int, input().split())

if a % k == 0 or b//k != a//k:
    print("OK")
else:
    print("NG")
K = int(input())
tmp = input()
A, B = tmp.split(' ')
A = int(A)
B = int(B)

flag = 0

list = range(A, B + 1)
for num in list:
  if num % K == 0:
    print('OK')
    flag = 1
    break

if flag == 0:
  print('NG')
K = int(input())
A,B = map(int,input().split())

for a in range(1000):
    if a * K >= A:
        if a * K <= B:
            print("OK")
            break
else:
    print("NG")
K = int(input())
A, B = map(int, input().split())
m = 0
for i in range(A, B+1):
  if i%K == 0:
    m = 1
print('OK' if m==1 else 'NG')
k = int(input())
line = input()
a, b = line.split(" ")
a, b = int(a), int(b)

for i in range(a, b+1):
    if i % k == 0:
        print("OK")
        break
    elif i == b:
        print("NG")
k = int(input())
a, b = map(int, input().split())
if b // k * k >= a:
    print("OK")
else:
    print("NG")
def main(K, A, B):
    a = int(A / K)
    b = int(B / K)
    if A == 0 or (a == b and A % K != 0):
        print('NG')
    else:
        print('OK')


if __name__ == '__main__':
    K = int(input())
    A, B = list(map(int, input().split()))
    main(K, A, B)
K = int(input())
A, B = map(int, input().split())
for i in range(A, B + 1):
    if i % K == 0:
        print('OK')
        break
else:
    print('NG')
k = int(input())
a, b = map(int, input().split())
re = False
for i in range(a, b+1):
    if (i % k) == 0:
        re = True
        break
if re == True:
    print("OK")
else:
    print("NG")
############ ---- USER DEFINED INPUT FUNCTIONS ---- ############
def inp():
    return(int(input().rstrip()))
def inlt():
    return(list(map(int,input().rstrip().split())))
def insr():
    s = input().rstrip()
    return(s[:len(s) - 1])
def invr():
    return(map(int,input().rstrip().split()))
################################################################
k = inp()
a,b = invr()

for i in range(a,b + 1):
    if i%k == 0:
        has = True
        break
else:
    has = False
if has:
    print('OK')
else:
    print('NG')
#print('Yes' if '7' in n else 'No')
#print('No')
#print()
K = int(input())
A,B = map(int,input().split())
f = True
for i in range(A,B+1):
    if i % K == 0:
        print("OK")
        f = False
        break
if f:
    print("NG")
#!/usr/bin/env python3
# sys.stdin.readline()
import sys
input = sys.stdin.readline

N = int(input())
x,y = map(int,input().split())
for i in range(x,y+1):
    if i % N ==0:
        print('OK')
        sys.exit()
print('NG')
k=int(input())
a,b=map(int,input().split())
for i in range(1000):
    if k*i>=a and k*i<=b:
        print("OK")
        exit()
print("NG")
import sys
k = int(input())
a, b = map(int, input().split())

for i in range(1000):
    if (k * i >= a and k * i <= b):
        print("OK")
        sys.exit()
    else:
        pass
print("NG")
K = int(input())
A,B = map(int, input().split())
for i in range(A, B+1):
	if i % K == 0:
		print('OK')
		exit()
print('NG')
k = int(input())
a,b = map(int,input().split())
lis = list(range(a,b + 1))


if all(j % k != 0 for j in lis):
    print('NG')
elif any(j % k == 0 for j in lis):
    print('OK')
k = int(input())
a,b = map(int,input().split())

for i in range(a, b+1):
    if i % k == 0:
        print("OK")
        exit()
print("NG")
k = int(input())
a, b = map(int, input().split())
flag = False

for num in range(a, b + 1):
    if num % k == 0:
        flag = True

if flag == True:
    print("OK")
else:
    print("NG")
K = int(input())
A,B = map(int, input().split())

res = [i for i in range(A,B+1) if i%K==0]

if res == []:
  print('NG')
else:
  print('OK')
# -*- coding: utf-8 -*-
k= int(input())
a, b = map(int, input().split())
p = 0
for i in range(a, b+1):
    if i % k == 0:
        print("OK")
        p = 1
        break
if p == 0:
    print("NG")
k = int(input())
a, b = map(int, input().split())
for i in range(a, b + 1):
    if i % k == 0:
        print('OK')
        exit()
print('NG')
k = int(input())
a, b = map(int,input().split())

for i in range(a,b+1):
    if i%k == 0:
        print("OK")
        exit()

print("NG")
import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines

def main():
    K = int(readline())
    A,B = map(int, readline().split())

    for i in range(A, B+1):
        if i % K == 0:
            print("OK")
            exit()
    
    print("NG")

    


if __name__ == "__main__":
    main()
k=int(input())
a,b=map(int,input().split())
x=b%k
y=b-x
if b-a>k:
    print('OK')
elif y>a:
    print('OK')
elif a%k==0:
    print('OK')
else:
    print('NG')
k = int(input())
a, b = list(map(int, input().split()))

ans = "NG"

if a//k != b // k:
    ans = "OK"
elif a % k == 0:
    ans = "OK"

print(ans)
k = int(input())
a,b = map(int, input().split())
j = False
for i in range(a,b + 1):
    if i%k == 0:
        j = True
if j:print("OK")
else:print("NG")
import math
a=int(input())
n,k=map(int,input().split())

for i in range(n,k+1):
    if i%a==0:
        print("OK")
        exit()
print("NG")

#items=[int(i) for i in input().split()]

#items=[i for i in range(n+1)]
k = int(input())
a,b = map(int,input().split())
if b//k > a//k or a%k==0 or b%k == 0:
    print('OK')
else:
    print('NG')
K=int(input())
A,B=map(int,input().split())
a=0
for i in range(A,B+1):
  if i%K==0:
    a+=1
    break
if a==1:
  print("OK")
else:
  print("NG")
import math
bai = (int)(input())
min, max = map(int, input().split(" "))
for i in range((math.ceil)(min / bai) * bai, ((int)(max / bai) * bai) + 1):
    print("OK")
    break
else:
    print("NG")
k = int(input())
a,b = map(int,input().split())
ans = "NG"
for i in range(a,b+1):
    if(i%k==0):
        ans = "OK"
        break
print(ans)
n=int(input())
a,b=[int(x) for x in input().split()]
flag=0
for i in range(a,b+1):
    if(i%n==0):
        flag=1
        break
if(flag==1):
    print('OK')
else:
    print('NG')
import sys
# input
k = int(input())
a, b = map(int, input().split())
#print(f"k >>{k}, a >>{a}, b >>{b}")


for i in range(a, b+1):
    if (i % k == 0):
        print("OK")
        sys.exit(0)

print("NG")
n=int(input())
a,b=map(int,input().split())
k=0
for i in range(a,b+1):
  if(i%n==0):
    k=1
    break
  else:
    k=0
if(k==1):print("OK")
else:print("NG")
k = int(input())
a, b = map(int, input().split())
count = 0
for i in range(1, b+1):
    number = k * i
    if number <= int(b):
        if number >= int(a):
            count += 1
            print("OK")
            break

if count == 0:
    print("NG")
import sys
from numba import njit
input = sys.stdin.buffer.readline

K = int(input())

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


@njit
def main(K: int, A: int, B: int):
    for i in range(A, B + 1):
        if i % K == 0:
            print('OK')
            return 0
    print('NG')
    return 0


if __name__ == '__main__':
    main(K, A, B)
K = int(input())
A, B = map(int, input().split())

for i in range(A, B + 1):
    if i % K == 0:
        print('OK')
        exit()
print('NG')
import math

def resolve():
    K = int(input())
    A, B= map(int, input().split()) 

    if A <= math.floor(B/K) * K:
        print("OK")
    else:
        print("NG")


if __name__ == "__main__":
    resolve()
k = int(input())
a, b = map(int, input().split())
key = 0
for i in range(1, b // k + 1):
    if a <= k * i <= b:
        key += 1
        break
    else:
        continue
if key == 1:
    print('OK')
else:
    print('NG')
## coding: UTF-8

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

ans = 'NG'
for i in range(A,B+1):
    #print(i)
    if(i % K == 0):
        ans = 'OK'

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


#print(k)
val = input()

a = int(val.split(" ")[0])
b = int(val.split(" ")[1])
# print(a + "and" + b)

result = 0

for i in range(a, b+1):
    if i%k == 0: result += 1

if result == 0:
    print("NG")
else: print("OK")
k=int(input())
a,b=map(int,input().split())
if b-a>=k-1:
    print("OK")
elif a%k==0:
    print("OK")
elif k-a%k>b-a:
    print("NG")
else:
    print("OK")
K = int(input())
A, B = map(int, input().split())
 
if (B // K)*K >= A: print('OK')
else: print('NG')
k = int(input())
a,b = (map(int,input().split()))
new_list = []
for i in range(a,b+1):
    if i%k == 0:
        print("OK")
        break
else:
    print('NG')
k = int(input())
a,b = map(int,input().split())

c = a//k
d = b//k

if a%k == 0:
  print("OK")
else:
  if c<d:
    print("OK")
  else:
    print("NG")
from sys import stdin
import math
import fractions
from collections import deque
from collections import Counter
import itertools

INF = 10 ** 10

K = int(stdin.readline().rstrip())
A, B = [int(x) for x in stdin.readline().rstrip().split()]

for i in range(A, B+1):
    if i % K ==0:
        print("OK")
        exit()

print("NG")
import sys
k = int(input())
a, b = map(int, input().split())
for i in range(a, b+1):
    if i%k==0:
        print('OK')
        sys.exit()
print('NG')
K = int(input())
A,B = map(int,input().split())
success = False
for i in range(A,B+1):
   if i%K==0:
      success = True
      break

if success:
   print("OK")
else:
   print("NG")
K=int(input())
A,B=map(int,input().split())
m=int(A/K)
if m*K==A:
  print('OK')
elif (m+1)*K>B:
  print('NG')
else:
  print('OK')
K=int(input())
A,B=map(int,input().split())

ans='NG'
i=1
while i*K<=1000:
    if A<=i*K<=B:
        ans='OK'
    i+=1

print(ans)
K = int(input())
A, B = map(int, input().split())
for i in range(A, B + 1):
    if i % K == 0:
        ans = 'OK'
        break
else:
    ans = 'NG'
print(ans)
k = int(input())
a,b = map(int,input().split())
ans = 'NG'
for i in range(a,b+1):
    if i%k == 0:
        ans = 'OK'
print(ans)
k = int(input())
a,b = list(map(int, input().split()))

n = a//k
ans = n * k
while ans <= b:
  if a <= ans <= b:
    exit(print('OK'))
  else:
    n += 1
    ans = k * n

print('NG')
n = int(input())
a, b = input().split()
a,b = int(a) , int(b)
flag = True
for i in range(1000,1,-1):
    if i%n==0:
        if a<=i and i<=b:
            print('OK')
            flag = False
            break
if flag:
    print('NG')
K=int(input())
A, B=map(int, input().split())
for i in range(A, B+1):
    if i%K==0:
        print('OK')
        exit()
print('NG')
def resolve():
    k = int(input())
    a, b = map(int, input().split())

    i = 1

    while k*i <= b:
        if a <= k*i <= b:
            print('OK')
            return
        i += 1
    else:
        print('NG')
resolve()
k = int(input())

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

c = 0
for i in range(a,b+1):
    if i % k == 0:
        c = 1
        break

if c == 0:
    print("NG")
else:
    print("OK")
import sys
sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline

k = int(input())
n, m = map(int, input().split())

if n%k==0:
    print('OK')
    exit()

if m%k==0:
    print('OK')
    exit()

mm= m//k
nn= n//k

if mm>nn:
    print('OK')
else:
    print('NG')
import sys

lines = sys.stdin.readlines()
a = int(lines[0].strip())
b = lines[1].split()
c = int(b[0])
d = int(b[1])
if (int(d/a)-d/a)*(int(c/a)-c/a) == 0:
    print("OK")
else:
    if (int(d/a)-int(c/a))>=1.0:
        print("OK")
    else:
        print("NG")
# -*- coding: utf-8 -*-

def input_one_number():
    return int(input())

def input_multiple_number():
    return map(int, input().split())

def input_multiple_number_as_list():
    return list(map(int, input().split()))

K = input_one_number()
A,B = input_multiple_number()


if (A // K == B // K and A % K != 0):
	print("NG")
else:
	print("OK")
K = int(input())
A,B = map(int,input().split())
if B//K -A//K == 0:
  if B%K != 0 and A%K != 0:
    print('NG')
  else:
    print('OK')
else:
  print('OK')
n = int(input())
a, b = map(int, input().split())
k = 1
while True:
    if a <= n*k <= b:
        print("OK")
        exit()
    elif n*k > b:
        print("NG")
        exit()
    else:
        k += 1
k = (int)(input())
a, b = map(int, input().split())
ret = "NG"

sum = 0
while sum <= b:
    sum = sum + k
    if a <= sum and sum <= b:
        ret = "OK"
        break

print("{}".format(ret))
k = int(input())
a, b = list(map(int, input().split()))
if a <= (b//k * k):
    print('OK')
else:
    print('NG')
num = int(input())

hani = input().split()
flag = 0
for i in range(int(hani[0]),int(hani[1])+1):
    if (int(i) % num) == 0:
        flag = 1
        break
if flag == 1:
    print("OK")
else:
    print("NG")
k = int(input())
a,b = map(int,input().split())
if a == b and a%k == 0:
    print("OK")
elif b-a >= k:
    print("OK")
else:
    if a%k == 0 or b%k == 0:
        print("OK")
    elif a//k != b//k:
        print("OK")
    else:
        print("NG")
# coding: utf-8


def main():
    k = int(input())
    a, b = map(int, input().split())

    for i in range(a, b+1):
        if i % k == 0:
            return "OK"
    
    return "NG"


print(main())
k = int(input())
a, b = map(int, input().split())
print('OK' if b // k * k >= a else 'NG')
k = int(input())
a,b = map(int, input().split())

result = []
for x in range(a,b+1):
    if x%k == 0:
        result.append(True)
    else:
        result.append(False)
if True in result:
    print('OK')
else:
    print('NG')
k = int(input())
a,b = map(int,input().split())
flg = 0

for i in range(a,b + 1):
    if i % k == 0:
        flg = 1
        break

if flg == 1:
    print('OK')
else:
    print('NG')
k = int(input())
a,b = map(int,input().split())
if a%k==0 or b%k==0:
    print('OK')
elif b-a < k and a%k <= b%k:
    print('NG')
else:
    print('OK')
K=int(input())
A,B=[int(i) for i in input().split()]

f=False
for i in range(A,B+1):
    if i%K==0:
        print("OK")
        f=True
        break
if f is False:
    print("NG")
# ABC165_A.py
k=int(input())
a,b=map(int,input().split())
for i in range(a,b+1):
  if i%k==0:
    print("OK")
    exit()
print("NG")
k = int(input())
a, b = map(int, input().split())

if a <= (b // k) * k:
  print("OK")
else:
  print("NG")
k = int(input())
a, b = map(int, input().split())

flag = 0
for i in range(a, b+1):
    if i % k == 0:
        print('OK')
        flag = 1
        break
if flag == 0:
    print('NG')
k = int(input())
a, b = [int(i) for i in input().split()]
 
for i in range(a, b+1):
  if i % k == 0:
    print("OK")
    break
else:
  print("NG")
K = int(input())
A, B = map(int, input().split())
for i in range(A, B + 1):
    if i % K == 0:
        print("OK")
        break
else:
    print("NG")
k = int(input())
a, b = map(int, input().split())

if b - a >= k - 1: print("OK")
else:
    c = b % k
    d = a % k
    if d > c or d == 0: print("OK")
    else: print("NG")
k = int(input())
a, b = map(int, input().split())
cnt = 0

for i in range(1, 1001):
    if a <= i * k <= b:
        cnt += 1

print("OK" if cnt > 0 else "NG")
k = int(input())
a,b = map(int, input().split())
flag = False
for i in range(a, b+1):
    if i % k == 0:
        flag = True
print("OK" if flag else "NG")
K=int(input())
A,B=map(int,input().split())
for x in range(A,B+1):
    if x%K==0:
        print("OK")
        break
else:
    print("NG")
# 2020-05-02
a = int(input())
b, c = map(int, input().split())
ans = 0
for i in range(b, c + 1):
    if i % a == 0:
        ans += 1
if ans >= 1:
    print('OK')
else:
    print('NG')
#!/usr/bin/env python3
k = int(input())
a, b = map(int, input().split())
if a // k == b // k and a % k != 0:
    print("NG")
else:
    print("OK")
a = int(input())
b,c = map(int,input().split())

rb = b % a
if ((a - rb) % a) <= c - b:
    print("OK")
else:
    print("NG")
k = int(input())
a, b = map(int, input().split())
for i in range(a, b+1):
    if i % k == 0:
        print('OK')
        break
else:
    print('NG')