CodeEff/ECCO huggingface dataset:
# Original solution
N = int(eval(input()))

number = [[0]*10 for i in range(10)]

for i in range(1, N+1):
    s = str(i)
    id1 = int(s[0])
    id2 = int(s[-1])
    number[id1][id2] += 1

ans = 0
for i in range(10):
    for j in range(10):
        ans += number[i][j]*number[j][i]

print(ans)


# Optimized solution
n = int(eval(input()))
Number = [[0]*10 for l in range(10)]

for i in range(1,n+1):
    s = str(i)
    j = int(s[0])
    k = int(s[-1])
    Number[j][k] += 1
count = 0
for i in range(10):
    for j in range(10):
        count += Number[i][j] *Number[j][i]
print(count)
# Original solution
N=int(eval(input()))
from collections import defaultdict
dic=defaultdict(int)

for i in range(1,N+1):
  n=str(i)
  dic[(int(n[0]),int(n[-1]))]+=1
  
ans=0
for i in range(1,10):
  for j in range(1,10):
    ans+=dic[(i,j)]*dic[(j,i)]
    
print(ans)

# Optimized solution
from collections import defaultdict as d
dic=d(int)
for i in range(1,int(eval(input()))+1):
  dic[(int(str(i)[0]),i%10)]+=1
ans=0
for i in range(10):
  for j in range(10):
    ans+=dic[(i,j)]*dic[(j,i)]
print(ans)
# Original solution
n = int(eval(input()))

dp = [[0] * 10 for _ in range(10)]
for i in range(1, n + 1):
    s = str(i)
    x = int(s[0])
    y = int(s[-1])
    dp[x][y] += 1

ans = 0
for i in range(1, 10):
    for j in range(1, 10):
        ans += dp[i][j] * dp[j][i]

print(ans)

# Optimized solution
n = int(eval(input()))

dp = [[0] * 10 for _ in range(10)]
for i in range(1, n + 1):
    s = str(i)
    dp[int(s[0])][int(s[-1])] += 1

ans = 0
for i in range(10):
    for j in range(10):
        ans += dp[i][j] * dp[j][i]
print(ans)
# Original solution
#!/usr/bin/env python3
import sys
import math
INF = float("inf")


def solve(N: int):

    debug = False
    SN = str(N)
    keta = int(math.log10(N)+1)
    count = 0
    for i in range(1, N+1):
        first = str(i)[0]
        last = str(i)[-1]
        if last == "0":         # 考えない
            continue
        # ひとけた
        if first == last:
            count += 1
        # ふたけた
        if int(last+first) <= N:
            count += 1
        if keta < 3:
            continue
        # 3桁以上keta桁未満
        for j in range(3, keta):
            count += 10**(j-2)
        # keta桁
        # Nを超えない数
        if last < SN[0]:
            count += 10**(keta-2)
        elif last == SN[0]:
            # 間の桁について、i桁までまで考える。
            DP = [[0]*2 for _ in range(keta-1)]
            DP[0][False] = 1
            for j in range(1, keta-1):
                DP[j][False] = DP[j-1][False]*1
                DP[j][True] = DP[j-1][True]*10 + DP[j-1][False]*int(SN[j])
            count += DP[-1][True]
            if SN[-1] >= first:
                count += 1
    print(count)
    return


def main():

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    solve(N)


if __name__ == '__main__':
    main()


# Optimized solution
#!/usr/bin/env python3
import sys
import math
INF = float("inf")


def solve(N: int):
    table = [[0]*10 for _ in range(10)]

    for i in range(1, N+1):
        first = int(str(i)[0])
        last = int(str(i)[-1])
        table[first][last] += 1

    count = 0
    for i in range(10):
        for j in range(10):
            count += table[i][j]*table[j][i]
    print(count)
    return


def main():

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    solve(N)


if __name__ == '__main__':
    main()
# Original solution
from collections import defaultdict

d = defaultdict(int)

n = int(eval(input()))

for i in range(1, n+1):
    start = str(i)[0]
    end = str(i)[-1]
    d[(start, end)] += 1

L = list(d.items())

ans = 0

for (start, end), i in L:
    ans += i * d[(end, start)]

print(ans)    

# Optimized solution
from collections import defaultdict

#索引数
d = defaultdict(int)
 
n = int(eval(input()))

#数え上げ
for i in range(1, n+1):
    start = str(i)[0]
    end = str(i)[-1]
    d[(start, end)] += 1

#リスト化 
L = list(d.items())
 
ans = 0
 
for (start, end), i in L:
    ans += i * d[(end, start)]
 
print(ans)
# Original solution
def main():
    N = int(eval(input()))
    freq = {}
    for i in range(1, N+1):
        pair = str(i)[0] + str(i)[-1]
        if pair in list(freq.keys()):
            freq[pair] += 1
        else:
            freq[pair] = 1
    
    ans = 0
    for i in range(1, N+1):
        pair_rev = str(i)[-1] + str(i)[0]
        if pair_rev in list(freq.keys()):
            ans += freq[pair_rev]
    
    print(ans)

if __name__ == "__main__":
    main()

# Optimized solution
def main():
    N = int(eval(input()))
    freq = {}
    for i in range(1, N+1):
        pair = str(i)[0] + str(i)[-1]
        freq.setdefault(pair, 0)
        freq[pair] += 1
    
    ans = 0
    for i in range(1, N+1):
        pair_rev = str(i)[-1] + str(i)[0]
        if pair_rev in list(freq.keys()):
            ans += freq[pair_rev]
    
    print(ans)
     
      
if __name__ == "__main__":
    main()
# Original solution
def main():
    N = int(eval(input()))
    freq = {}
    for i in range(1, N+1):
        pair = str(i)[0] + str(i)[-1]
        freq.setdefault(pair, 0)
        freq[pair] += 1
    
    ans = 0
    for i in range(1, N+1):
        pair_rev = str(i)[-1] + str(i)[0]
        if pair_rev in list(freq.keys()):
            ans += freq[pair_rev]
    
    print(ans)
     
      
if __name__ == "__main__":
    main()

# Optimized solution
def main():
    N = int(eval(input()))

    freq = {}
    for i in range(1, N+1):
        pair = str(i)[0] + str(i)[-1]
        freq.setdefault(pair, 0)
        freq[pair] += 1
    
    ans = 0
    freq_keys = list(freq.keys())
    for i in range(1, N+1):
        pair_rev = str(i)[-1] + str(i)[0]
        if pair_rev in freq_keys:
            ans += freq[pair_rev]
    
    print(ans)    


if __name__ == "__main__":
    main()
# Original solution
# ABC 152 D
si = lambda: eval(input())
ni = lambda: int(eval(input()))
nm = lambda: list(map(int, input().split()))
snm = lambda: list(map(str, input().split()))
nl = lambda: list(map(int, input().split()))
n=ni()
c=[[0]*10 for _ in range(10)]

for i in range(1,n+1):
    sl=str(i)
    sl_s=int(sl[0])
    sl_e=int(sl[-1])
    c[sl_s][sl_e]+=1

ans=0
for i in range(1,10):
    for j in range(1,10):
        ans+=c[i][j]*c[j][i]
print(ans)

# Optimized solution
n=int(eval(input()))
c=[[0]*10 for i in range(10)]
for a in range(1,n+1):
  a=str(a)
  c[int(a[-1])][int(a[0])]+=1
ans=0
for i in range(1,10):
  for j in range(1,10):
    ans+=c[i][j]*c[j][i]
print(ans)
# Original solution
n=int(eval(input()))
v=[0]*100
ans=0
for i in range(1,n+1):
    x=int(str(i)[0])
    y=int(str(i)[-1])
    v[x*10+y]+=1

for i in range(len(v)):
    x=int(str(i)[0])
    y=int(str(i)[-1])
    ans+=v[i]*v[10*y+x]
print(ans)

# Optimized solution
n=int(eval(input()))
x=[0]*101
ans=0
for i in range(1,n+1):
    v=str(i)
    w=int(v[0]+v[-1])
    x[w]+=1

for i in range(101):
    if x[i]!=0:
        v=str(i)
        w=int(v[-1]+v[0])
        ans+=x[i]*x[w]
print(ans)
# Original solution
N = int(eval(input()))
D = {i: [0] for i in range(100)}
for i in range(1, N+1):
  if i % 10 != 0:
    s = str(i)
    D[int(s[0])*10+int(s[-1])][0] += 1
    D[int(s[0])*10+int(s[-1])].append(i)
S = 0
for i in range(10):
  for j in range(10):
    S += D[i*10+j][0] * D[j*10+i][0]
print(S)

# Optimized solution
N = int(eval(input()))
D = {i: 0 for i in range(100)}
for i in range(1, N+1):
  if i % 10 != 0:
    s = str(i)
    D[int(s[0])*10+int(s[-1])] += 1
S = 0
for i in range(10):
  for j in range(10):
    S += D[i*10+j] * D[j*10+i]
print(S)
# Original solution
from sys import stdin

n = int(stdin.readline().rstrip())

li = [[0 for i in range(10)]for j in range(10)]

for k in range(1,n+1):
    atama = int(str(k)[0])
    ushiro = int(str(k)[-1])
    li[atama][ushiro] += 1

point = 0

for l in range(1,10):
    for m in range(1,10):
        point += li[l][m]*li[m][l]
print(point)

# Optimized solution
from collections import defaultdict

n = int(eval(input()))
dic = defaultdict(int)

for i in range(1,n+1):
    s = str(i)
    dic[int(s[0]),int(s[-1])] += 1

point = 0

for i in range(1,10):
    for j in range(1,10):
        point += dic[i,j]*dic[j,i]

print(point)
# Original solution
n=int(eval(input()))
check1=[[i,i,0] for i in range(1,10)]
check2=[[i,j,0] for i in range(1,10) for j in range(i+1,10)]
l=len(check2)
check3=[[check2[i][1],check2[i][0],0] for i in range(l)]

for i in range(1,n+1):
    s=str(i)
    s1=int(s[0])
    s2=int(s[-1])
    if s2!=0:
        if s1==s2:
            check1[s1-1][2]+=1
        elif s1<s2:
            x=[0,8,15,21,26,30,33,35]
            check2[x[s1-1]+(s2-s1-1)][2]+=1
        else:
            x=[0,8,15,21,26,30,33,35]
            check3[x[s2-1]+(s1-s2-1)][2]+=1
cnt=0
for i in range(9):
    cnt+=(check1[i][2])*(check1[i][2])
for i in range(l):
    cnt+=2*(check2[i][2]*check3[i][2])
print(cnt)


# Optimized solution
n=int(eval(input()))
check=[[0]*9 for i in range(9)]
for i in range(1,n+1):
    s=str(i)
    s1=int(s[0])-1
    s2=int(s[-1])-1
    if s2==-1:continue
    check[s1][s2]+=1
cnt=0
for i in range(9):
    for j in range(9):
        cnt+=check[i][j]*check[j][i]
print(cnt)
# Original solution
N, C = list(map(int, input().split()))
events = []
for i in range(N):
    events.append(list(map(int, input().split())))

dp = [[0]*2001 for i in range(C+1)]
for j in range(C+1):
    for k in range(-1000, 1001):
        if k != 0:
            dp[j][k] = -10**18
for a, b, c in events:
    for j in range(C-c, -1, -1):
        for k in range(-1000, 1001):
            if k + (b-a) >= -100:
                dp[j+c][k+b-a] = max(dp[j+c][k+b-a], dp[j][k] + a)
            if k + (a-b) <= 100:
                dp[j+c][k+a-b] = max(dp[j+c][k+a-b], dp[j][k] + b)
ans = 0
for j in range(C+1):
    for k in range(-1000, 1001):
        ans = max(ans, min(dp[j][k] + k, dp[j][k]))
print(ans)

# Optimized solution
N, C = list(map(int, input().split()))
events = []
for i in range(N):
    events.append(list(map(int, input().split())))

def solve():
    L = 250
    dp = [[-10**18]*(L+1) for i in range(C+1)]
    for j in range(C+1):
        dp[j][0] = 0
    for a, b, c in events:
        for j in range(C-c, -1, -1):
            for k in range(L+1):
                if k + (b-a) <= 0:
                    dp[j+c][a-k-b] = max(dp[j+c][a-k-b], dp[j][k]+k+b)
                else:
                    dp[j+c][k+b-a] = max(dp[j+c][k+b-a], dp[j][k]+a)
                if k + (a-b) <= L:
                    dp[j+c][k+a-b] = max(dp[j+c][k+a-b], dp[j][k]+b)
    ans = 0
    for j in range(C+1):
        ans = max(ans, max(dp[j]))
    return ans
print((solve()))
# Original solution
S = input().strip()
print(("x"*len(S)))

# Optimized solution
S = input().strip()
a = "x"*len(S)
print(a)
# Original solution
import sys


def solve():
    input = sys.stdin.readline
    mod = 10 ** 9 + 7
    s = str(input().rstrip('\n'))
    s = "x" * len(s)
    print(s)


if __name__ == '__main__':
    solve()


# Optimized solution
import sys


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    s = str(readline().rstrip().decode('utf-8'))
    print(("x" * len(s)))


if __name__ == '__main__':
    solve()
# Original solution
k = int(eval(input()))
a, b = list(map(int, input().split()))

flag = False
for i in range(a, b+1):
    if i % k == 0:
        flag = True
        break
    else:
        continue
if flag is True:
    print("OK")
else:
    print("NG")

# Optimized solution
k = int(eval(input()))
a, b = list(map(int, input().split()))
if b//k * k >= a:
    print("OK")
else:
    print("NG")
# Original solution
K = int(eval(input()))
A, B = list(map(int, input().split()))

while True:
    if A % K == 0:
        print('OK')
        break
    A += 1
    if A == B + 1:
        print('NG')
        break


# Optimized solution
K = int(eval(input()))
A, B = list(map(int, input().split()))

while True:
    if A == B + 1:
        print('NG')
        break
    if A % K == 0:
        print('OK')
        break
    A += 1
# Original solution
k = int(eval(input()))
a, b = list(map(int, input().split()))

if (a%k == 0 or b%k == 0):
  print('OK')
elif (a//k != b//k):
  print('OK')
else:
  print('NG')

# Optimized solution
k = int(eval(input()))
a, b = list(map(int, input().split()))

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

if (Flag):
  print('OK')
else:
  print('NG')
# Original solution
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')

# Optimized solution
K = int(eval(input()))
A, B = list(map(int, input().split()))

if (A-1)//K!=B//K:
    print('OK')
else:
    print('NG')
# Original solution
k = int(eval(input()))
a,b = list(map(int, input().split()))
m = int(b/k)

for i in range(m):
  if a<=k*(i+1) and b>=k*(i+1):
    print('OK')
    exit()
  else:
    i += 1

print('NG')

# Optimized solution
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')
# Original solution
k = int(eval(input()))
a, b = list(map(int,input().split()))
for i in range(a//k,b//k+1):
    if (k*i) <= b and k*i >= a:
        print('OK');        break
else:
    print('NG')

# Optimized solution
k = int(eval(input()))
a, b = list(map(int,input().split()))
print(('OK' if a <= ( b // k * k) else 'NG'))
# Original solution
k,a,b=list(map(int,open(0).read().split()))
print(("OK"if a<=b//k*k else"NG"))

# Optimized solution
k,a,b=list(map(int,open(0).read().split()))
print(("ONKG"[a>b//k*k::2]))
# Original solution
K = int(eval(input()))
score = input().split()
s1 = int(score[0])
s2 = int(score[1])
if ( s1 % K ) == 0:
		print('OK')
elif ( s2 % K ) == 0:
		print('OK')
elif ( s1 // K ) < ( s2 // K ):
		print('OK')
else:
		print('NG')

# Optimized solution
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')
# Original solution
from sys import exit

def main():
    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")

if __name__ == '__main__':
    main()

# Optimized solution
from sys import exit

def main():
    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")

    if A % K == 0:
        print("OK")
        exit()
    
    if B // K > A // K:
        print("OK")
    else:
        print("NG")

if __name__ == '__main__':
    main()
# Original solution
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")
    


# Optimized solution
k = int(eval(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")
# Original solution
k = int(eval(input()))
a,b = [int(i) for i in input().split(' ')]

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

# Optimized solution
k = int(input())
a,b = [int(i) for i in input().split(' ')]
print('OK') if (a <= b//k*k) else print('NG')
# Original solution
k =int(eval(input()))
a , b=list(map(int,input().split()))
flag = False
if b-a >= k:
  flag=True
else:
  for i in range(a,b+1):
    if i%k==0:
      flag=True
      
if flag :
  print("OK")
else:
  print("NG")
  
  

# Optimized solution
k =int(eval(input()))
a , b=list(map(int,input().split()))
flag = False


for i in range(a,b+1):#range(a,b+1)=[a,a+1,a+2,.....,b]
  if i % k == 0:
    flag=True
      
if flag :
  print("OK")
else:
  print("NG")
# Original solution
import sys
input = sys.stdin.readline

def main():
    n = int(eval(input()))
    a, b = list(map(int, input().split()))
    flag = False
    for i in range(a,b+1):
        if i % n == 0:
            flag = True
            break

    if flag:
        print('OK')
    else:
        print('NG')

if __name__ == '__main__':
    main()


# Optimized solution
import sys
input = sys.stdin.readline

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

    largest = (b // k) * k

    if a <= largest:
        print('OK')
    else:
        print('NG')

if __name__ == '__main__':
    main()
# Original solution
n = int(eval(input()))
a, b = list(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

# Optimized solution
import math

k = int(eval(input()))
a, b = list(map(int, input().split()))

if k == 1:
    print("OK")
    exit()
elif a <= k <= b :
    print("OK")
    exit()

cnt = 1
while True:
    tmp = cnt * k
    if a <=  tmp <= b:
        print("OK")
        exit()
    elif b <= tmp:
        print("NG")
        exit()
    cnt += 1
# Original solution
K = int(eval(input()))
a,b=list(map(int,input().split()))
ans = 'NG'
for i in range(a, b+1):
  if i%K == 0:
    ans = 'OK'
if K == 1:
  ans = 'OK'
print(ans)

# Optimized solution
K = int(eval(input()))
a,b=list(map(int,input().split()))
if b//K-a//K>0:
  ans ='OK'
elif K==1:
  ans = 'OK'
elif a%K==0:
  ans = 'OK'
else:
  ans = 'NG'
print(ans)
# Original solution
k = int(eval(input()))
a,b = list(map(int,input().split()))
if k <= b - a:
  print('OK')
else:
  if b // k > a // k or a % k == 0:
    print('OK')
  else:

    print('NG')

# Optimized solution
k = int(eval(input()))
a,b = list(map(int,input().split()))
if b // k > a // k or a % k == 0:
  print('OK')
else:
  print('NG')
# Original solution
k=int(eval(input()))
a,b=list(map(int,input().split()))
f=0
for i in range(1,1001):
    if a<=i*k<=b:
        f=1
        print("OK")
        break
if f==0:
    print("NG")


# Optimized solution
k=int(eval(input()))
a,b=list(map(int,input().split()))
f=0
for i in range(1,1001):
  if a<=i*k<=b:
    print("OK")
    f=1
    break
if f==0:
  print("NG")
# Original solution
k = int(eval(input()))
a, b = list(map(int, input().split()))

flag = False

if a <= int(b / k) * k:
  print("OK")
else:
  print("NG")

# Optimized solution
k = int(eval(input()))
a, b = list(map(int, input().split()))

if a <= (b // k) * k:
  print("OK")
else:
  print("NG")
# Original solution
# -*- coding: utf-8 -*-

K = int(eval(input()))
A, B = (int(x) for x in input().split())

a = A // K
b = B // K

if b-a >= 1 or K == 1:
    print("OK")
elif B%K==0 or A%K==0:
    print("OK")
else:
    print("NG")

# Optimized solution

K = int(eval(input()))
A, B = (int(x) for x in input().split())

#倍数が何個含まれるかで考える場合
# a = A // K
# b = B // K
# 
# if b-a >= 1 or K == 1:
#     print("OK")
# elif B%K==0 or A%K==0:
#     print("OK")
# else:
#     print("NG")

#B以下の最大のKの倍数がAを超えるかどうかで考える場合
#B以下の最大のkの倍数
maxbk = (B//K)*K

if maxbk >= A:
    print("OK")
else:
    print("NG")
# Original solution
import sys
input = sys.stdin.buffer.readline

K = int(eval(input()))

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


def main(K, A, B):
    for i in range(A, B + 1):
        if i % K == 0:
            print('OK')
            sys.exit()
    print('NG')


if __name__ == '__main__':
    main(K, A, B)


# Optimized solution
import sys
input = sys.stdin.buffer.readline
 
 
def main():
    K = int(eval(input()))
    A, B = list(map(int, input().split()))
    for i in range(A, B + 1):
        if i % K == 0:
            print('OK')
            sys.exit()
    print('NG')
 
 
if __name__ == '__main__':
    main()
# Original solution
# -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub

# sys.setrecursionlimit(100000)
input = sys.stdin.buffer.readline
INF = 2**62-1

def read_int():
    return int(input())


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


def read_float():
    return float(input())


def read_float_n():
    return list(map(float, input().split()))


def read_str():
    return input().strip()


def read_str_n():
    return list(map(str, input().split()))


def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(K, A, B):
    ans = 0
    for i in range(100000):
        if A <= i*K <= B:
            return 'OK'
        if i * K > B:
            break
    return 'NG'


def main():
    K = read_int()
    A, B = read_int_n()
    print(slv(K, A, B))


if __name__ == '__main__':
    main()


# Optimized solution
# -*- coding: utf-8 -*-
INF = 2**62-1


def read_int():
    return int(eval(input()))


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


def slv(K, A, B):
    for i in range(INF):
        if A <= i*K <= B:
            return 'OK'
        if i * K > B:
            break
    return 'NG'


def main():
    K = read_int()
    A, B = read_int_n()
    print((slv(K, A, B)))


if __name__ == '__main__':
    main()
# Original solution
k = int(eval(input()))
a, b = list(map(int, input().split()))
print(('OK' if sum(i % k == 0 for i in range(a, b + 1)) else 'NG'))

# Optimized solution
k = int(eval(input()))
a, b = list(map(int, input().split()))
print(('OK' if b // k * k >= a else 'NG'))
# Original solution
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')


# Optimized solution
K = int(eval(input()))
A, B = list(map(int, input().split()))

if (B // K) * K >= A:
    print('OK')
else:
    print('NG')
# Original solution
K = int(eval(input()))
S = input().split()
A = int(S[0])
B = int(S[1])

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


# Optimized solution
K = int(eval(input()))
A, B = list(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")
# Original solution
s_K = eval(input())
s_AB = input().split()
str = "NG"

K = int(s_K)
A = int(s_AB[0])
B = int(s_AB[1])

for w in range(A, B+1):
  if(w%K==0):
    str = "OK"

print(str)

# Optimized solution
s_K = eval(input())
s_AB = input().split()
str = "NG"

K = int(s_K)
A = int(s_AB[0])
B = int(s_AB[1])

for w in range(A, B+1):
  if(w%K==0):
    str = "OK"
    break

print(str)
# Original solution
k = int(eval(input()))
a, b = list(map(int,input().split()))
bb = b//k
aa , i = divmod(a, k)
if (aa != bb) or ( i ==0):
    print("OK")
else:
    print("NG")

# Optimized solution
K = int(eval(input()))
A, B =list(map(int,input().split()))
ad,am=divmod(A,K)
bd,bm=divmod(B,K)
if bd>ad:
    print("OK")
elif am ==0:
    print("OK")
else:
    print("NG")
# Original solution
# -*- coding: utf-8 -*-
# 標準入力の取得
K = int(eval(input()))
A,B = list(map(int, input().split()))

# 求解処理
min_value = K * (A // K)
if min_value < A:
    min_value += K
result = ""
if min_value <= B:
    result = "OK"
else:
    result = "NG"

# 結果出力
print(result)

# Optimized solution
# -*- coding: utf-8 -*-
# 標準入力の取得
K = int(eval(input()))
A, B = list(map(int, input().split()))


def main() -> None:
    """Entry point
    """
    # 求解処理
    # A以上の最小のKの倍数とBを比較
    min_multiple = K * ((A // K) + (A % K != 0))
    result = ""
    if min_multiple <= B:
        result = "OK"
    else:
        result = "NG"

    # 結果出力
    print(result)


if __name__ == "__main__":
    main()