Harryxun/stf_run huggingface dataset:
n,m=map(int, input().split())
ab=[list(map(int, input().split())) for _ in range(m)] 

ab.sort(key=lambda ab:ab[1])
ans=[ab[0]]
for i in range(1:m):
    if ans[-1][1]<=ab[i][0]:
        ans.append(ab[i])
print(len(ans))

### FIXED CODE ###

n,m=map(int, input().split())
ab=[list(map(int, input().split())) for _ in range(m)] 

ab.sort(key=lambda ab:ab[1])
ans=[ab[0]]
for i in range(1,m):
    if ans[-1][1]<=ab[i][0]:
        ans.append(ab[i])
print(len(ans))
g=[]
a, b, c, d, e = map(int,input().split())
for i in a, b, c, d, e, f:
    g.append(i)
h=g.index(0)
print(h+1)

### FIXED CODE ###

g=[]
a, b, c, d, e = map(int,input().split())
for i in a, b, c, d, e:
    g.append(i)
print(g.index(0)+1)
def gcd(t):
    b,a=sorted(t)
    while True:
        m=a%b
        if m==0:
            return b
        a=b;b=m

a,b,k=(int(x) for x in input().split())
g=gcd((a,b))
cd=[]
i=g
while True:
    try:
        if g%i==0:
            cd.append(i)
            i=i//2
            if i==0:
                break
        else:
            i-=1
    except:
        break
print(cd[k-1])

### FIXED CODE ###

def gcd(t):
    b,a=sorted(t)
    while True:
        m=a%b
        if m==0:
            return b
        a=b;b=m
a,b,k=(int(x) for x in input().split())
g=gcd((a,b))
cd=[]
for i in range(g+1)[::-1]:
    if i==0:
        break
    if g%i==0:
        cd.append(i)
print(cd[k-1])
N,X=map(int,input().split())
xn = map(int, input().split())
dxn = [abs(x-X) for x in xn]
import fractions
a, b = dxn[0], dxn[1]
for i in range(N-1):
    c = fractions.gcd(a, b)
    a = b
    b = c
print(c)


### FIXED CODE ###

N,X=map(int,input().split())
xn = map(int, input().split())
dxn = [abs(x-X) for x in xn]
import fractions
from functools import reduce
print(reduce(fractions.gcd, dxn))
import sys 
from collections import deque
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
N = int(readline())
A = list(map(int,readline().split()))
A = list(sorted(A))
q = deque(A)
ans = 0
while q:
  t = q.popleft()
  cnt = q.count(t)
  if t == 1:
    if cnt == 0:
      print(1)
      sys.exit()
    else:
      print(0)
      sys.exit()
  if cnt == 0:
    ans += 1
  count = 0
  for j in range(len(q)):
    if q[j] % t == 0:
      count +=1
      q.remove(q[j])
      q.appendleft(1)
    for i in range(count):
      q.remove(1)
print(ans)

### FIXED CODE ###

import sys 
import numpy as np
from numba import jit
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines


@jit(cache=True)
def solve(A):
  count = np.zeros(10**6+10)
  for x in A:
    if count[x] > 1:
      continue
    count[::x] += 1
  ans = 0
  for x in A:
    ans += count[x] == 1
  return ans

N = int(readline())
A = list(map(int,readline().split()))
A = np.array(A)
print(solve(A))
x1,y1,x2,y2=list(map(int,input().split()))

if x2>x1 and y2>y1:
  x3=x2-abs(y2-y1);y3=y2+abs(x2-x1);x4=x3-abs(y3-y2);y4=y3-abs(x3-x2)

elif x2<x1 and y2>y1:
  x3=x2-abs(y2-y1);y3=y2-abs(x2-x1);x4=x3+abs(y3-y2);y4=y3-abs(x3-x2)

elif x2<x1 and y2<y1:
  x3=x2+abs(y2-y1);y3=y2-abs(x2-x1);x4=x3+abs(y3-y2);y4=y3+abs(x3-x2)

elif x2>x1 and y2<y1:
  x3=x2+abs(y2-y1);y3=y2+abs(x2-x1);x4=x3-abs(y3-y2);y4=y3+abs(x3-x2)

  
print(x3,y3,x4,y4)


### FIXED CODE ###

x1,y1,x2,y2=list(map(int,input().split()))

if x2>=x1 and y2>=y1:
  x3=x2-abs(y2-y1);y3=y2+abs(x2-x1);x4=x3-abs(y3-y2);y4=y3-abs(x3-x2)

elif x2<=x1 and y2>=y1:
  x3=x2-abs(y2-y1);y3=y2-abs(x2-x1);x4=x3+abs(y3-y2);y4=y3-abs(x3-x2)

elif x2<=x1 and y2<=y1:
  x3=x2+abs(y2-y1);y3=y2-abs(x2-x1);x4=x3+abs(y3-y2);y4=y3+abs(x3-x2)

elif x2>=x1 and y2<=y1:
  x3=x2+abs(y2-y1);y3=y2+abs(x2-x1);x4=x3-abs(y3-y2);y4=y3+abs(x3-x2)

  
print(x3,y3,x4,y4)
n = int(input())
a = [1,2,3,5,6,9,10,13,17]
if n in a:
  print(No)
else:
  print(Yes)

### FIXED CODE ###

n = int(input())
a = [1,2,3,5,6,9,10,13,17]
if n in a:
  print("No")
else:
  print("Yes")
# C - Pyramid

N = int(input())
XYH = [tuple(int(i) for i in input().split()) for _ in range(N)]

for cx in range(101):
    for cy in range(101):
        pre_tmp_H = 0
        for (x, y, h) in XYH:
            tmp_H = h + abs(x - cx) + abs(y - cy)
            if pre_tmp_H != 0 and tmp_H != pre_tmp_H:
                break
            pre_tmp_H = tmp_H
        else:
            ans = (cx, cy, tmp_H)

print(' '.join(map(str, ans)))

### FIXED CODE ###

# C - Pyramid

N = int(input())
XYH = [tuple(int(i) for i in input().split()) for _ in range(N)]

XYH.sort(key = lambda x: x[2], reverse=True)

for cx in range(101):
    for cy in range(101):
        (x, y, h) = XYH[0]
        tmp_H = h + abs(x - cx) + abs(y - cy)
        for (x, y, h) in XYH:
            if h != max(tmp_H - abs(x - cx) - abs(y - cy), 0):
                break
        else:
            ans = (cx, cy, tmp_H)
            break

print(' '.join(map(str, ans)))
import numpy as np
    a, b, x = map(int,input().split())
    if x >= a**2*b/2:
        ans = np.arctan(2*(b-x/a**2)/a)
    else:
        ans = np.arctan(a*b/2/x*b)
    print(ans*180/np.pi)

### FIXED CODE ###

import numpy as np
a, b, x = map(int,input().split())
if x >= a**2*b/2:
    ans = np.arctan(2*(b-x/a**2)/a)
else:
    ans = np.arctan(a*b/2/x*b)
print(ans*180/np.pi)
import numpy as np
N,W = map(int,input().split())
dp = np.zeros(W+1,dtype = np.int64)
for _ in range(N):
    w,v = map(int,input().split())
    if w > W:
        continue
    else:
        np.maximum(dp[w:],dp[:-w]+v,out = dp[w:])
print(dp[W])

### FIXED CODE ###

import numpy as np
N,W = map(int,input().split())
dp = np.full(N*1000+1,W+1)
dp[0] = 0
for _ in range(N):
    w,v = map(int,input().split())
    np.minimum(dp[v:],dp[:-v]+w,out = dp[v:])
print(np.where(dp<=W)[0][-1])
from copy import deepcopy

def main():
    n, k = map(int, input().split())
    a = [int(x)-1 for x in input().split()]
    cnt = 0
    next_posi = 0
    # 何回できたことのあるところにいくか
    visited = set()
    visited.add(0)
    for _ in range(n):
        next_posi = a[next_posi]
        cnt += 1
        if next_posi not in visited:
            visited.add(next_posi)
        else:
            break
    # print('cnt', cnt)
    cnt2 = 0
    visited_posi = deepcopy(next_posi)
    for _ in range(k-cnt):
        next_posi = a[next_posi]
        cnt2 += 1
        if next_posi == visited_posi:
            break
    # print('cnt2', cnt2)
    mod = (k-cnt) % cnt2
    # print('mod', mod)
    for _ in range(mod):
        next_posi = a[next_posi]
    print(next_posi+1)

if __name__ == '__main__':
    main()

### FIXED CODE ###

from copy import deepcopy

def main():
    n, k = map(int, input().split())
    a = [int(x)-1 for x in input().split()]
    visited = set()
    i = 0
    cnt = 0
    # 途中で前に行ったところに行ったら終わり
    # kが小さくてcnt == kになってもおわり
    while True:
        if i in visited:
            break
        visited.add(i)
        cnt += 1
        i = a[i]
        if cnt == k:
            print(i+1)
            exit()
    k -= cnt
    period = list()
    period.append(i)
    i = a[i]
    # 何回で同じ場所に戻るか
    while True:
        if i == period[0]:
            break
        period.append(i)
        i = a[i]
    # 余り
    mod = k % len(period)
    ans = period[mod]
    print(ans+1)

if __name__ == '__main__':
    main()
n = int(input())

remainder = n[-1]
if remainder in (2, 4, 5, 7, 9): print("hon")
elif remainder in (0,1,6,8): print("pon")
elif remainder in (3): print("bon")

### FIXED CODE ###

n = input()

remainder = int(n[-1])
if remainder in (2, 4, 5, 7, 9): print("hon")
elif remainder in (0,1,6,8): print("pon")
elif remainder is 3: print("bon")
from collections import defaultdict


def find_path(adj, to_node, node, parent=None):
    if node == to_node:
        return [to_node]
    path = None
    for child in adj[node]:
        if child == parent:
            continue
        p = find_path(adj, to_node, child, node)
        if p is None:
            continue
        p = [node] + p
        if path is None or len(path) > len(p):
            path = p
    return path


def depth(adj, node, parent=None):
    ret = 0
    for child in adj[node]:
        if child == parent:
            continue
        d = depth(adj, child, node) + 1
        ret = max(ret, d)
    return ret


def main():
    N, U, V = list(map(int, input().split(' ')))
    U -= 1
    V -= 1
    adj = defaultdict(list)
    for _ in range(N - 1):
        A, B = list(map(lambda x: int(x) - 1, input().split(' ')))
        adj[A].append(B)
        adj[B].append(A)
    path = find_path(adj, U, V)  # to U from V
    dist = len(path) - 1
    partial_depth = depth(adj, path[(dist // 2) + 1], path[dist // 2])
    print(partial_depth + (dist // 2))


if __name__ == '__main__':
    main()


### FIXED CODE ###

from collections import defaultdict
import sys


sys.setrecursionlimit(10 ** 6)


def depth(adj, node, parent=None):
    ret = 0
    for child in adj[node]:
        if child == parent:
            continue
        d = depth(adj, child, node) + 1
        ret = max(ret, d)
    return ret


def main():
    N, U, V = list(map(int, input().split(' ')))
    U -= 1
    V -= 1
    adj = defaultdict(list)
    for _ in range(N - 1):
        A, B = list(map(lambda x: int(x) - 1, input().split(' ')))
        adj[A].append(B)
        adj[B].append(A)

    path = [-1] * N

    def find_path_on_tree(to_node, node, parent=None, d=0):
        if node == to_node:
            path[d] = node
            return True
        for child in adj[node]:
            if child == parent:
                continue
            if not find_path_on_tree(to_node, child, node, d + 1):
                continue
            path[d] = node
            return True
        return False

    find_path_on_tree(U, V)  # to U from V
    path = [node for node in path if node != -1]
    dist = len(path) - 1
    partial_depth = depth(adj, path[(dist // 2) + 1], path[dist // 2])
    print(partial_depth + (dist // 2))


if __name__ == '__main__':
    main()
import sys
sys.setrecursionlimit(10**6)
n=int(input())
G=[[]for i in range(n+1)]
for i in range(n-1):
    a, b, c = map(int,input().split())
    G[a] += (b,c)
    G[b] += (a,c)
q, k = map(int,input().split())
d = [0]*(n+1) #kから各点への距離
def f(v,p,u): #v:今見ているとこ p:一つ前に見たとこ u:kからの距離
    d[v] = u
    for t, c in G[v]:
        if p != t:
            f(t,v,u+c)
f(k,0,0)
for i in range(q):
    x, y = map(int,input().split())
    print(d[x]+d[y])

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**6)
n=int(input())
G=[[]for i in range(n+1)]
for i in range(n-1):
    a, b, c = map(int,input().split())
    G[a] += (b,c),
    G[b] += (a,c),
q, k = map(int,input().split())
d = [0]*(n+1) #kから各点への距離
def f(v,p,u): #v:今見ているとこ p:一つ前に見たとこ u:kからの距離
    d[v] = u
    for t, c in G[v]:
        if p != t:
            f(t,v,u+c)
f(k,0,0)
for i in range(q):
    x, y = map(int,input().split())
    print(d[x]+d[y])
while True:
  (H, W) = [int(i) for i in input().split()]
  if H == W == 0;
    break

  for hc in range(H):
    for wc in range(W):
      if (hc + wc) % 2 == 0:
        print('#', end='')
      else:
        print('.', end='')
    print()
  print()

### FIXED CODE ###

while True:
  (H, W) = [int(i) for i in input().split()]
  if H == W == 0:
    break

  for hc in range(H):
    for wc in range(W):
      if (hc + wc) % 2 == 0:
        print('#', end='')
      else:
        print('.', end='')
    print()
  print()
chr = input().split(" 0 ")
a = (int(chr[1])-int(chr[0]))*60 - int(chr[-1])
print(a)

### FIXED CODE ###

chr = input().split()
a = (int(chr[2]) - int(chr[0]))*60 + (int(chr[3]) - int(chr[1])) - int(chr[-1])
print(a)
test_list=[1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
index=int(input())
print(test_list[index]+1)

### FIXED CODE ###

n=int(input())
li = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
print(li[n-1])
import math
a,b,x = map(int,input().split())
if a**2*b>x>= (a**2)*b/2:
  tan=2*((a**2)*b-x)/(a**3)
elif x<a*a*b/2:
  tan=a*b*b/(2*x)
  

print(math.degrees(math.atan(tan)))

### FIXED CODE ###

import math
a,b,x = map(int,input().split())
if a**2*b>x> (a**2)*b/2:
  tan=2*((a**2)*b-x)/(a**3)
elif x<=a*a*b/2:
  tan=a*b*b/(2*x)
elif x==a*a*b:
  tan=0
  

print(math.degrees(math.atan(tan)))
n = int(input())
S = list(input())
sl = itertools.combinations(S, 3)
sl_s = set(sl)
print(len(sl_s))

### FIXED CODE ###

n = int(input())
s = input()
ans = 0
for i in range(1000):
    tg = str(i + 1000)[1:]
    if tg[0] not in s:
        continue
    else:
        x2 = s[s.index(tg[0]) + 1:]
        if tg[1] not in x2:
            continue
        else:
            x3 = x2[x2.index(tg[1]) + 1:]
            if tg[2] not in x3:
                continue
            else:
                ans += 1
print(ans)
import sys
input = sys.stdin.reakline

n, W = [int(i) for i in input().split()]
dp = [W + 1] * (1010 * (n + 1))

dp[0] = 0
v_max = 0
for i in range(n):
    w, v = map(int, input().split())
    v_max += v
    for j in range(v_max, v - 1, -1):
        dp[j] = min(dp[j - v] + w, dp[j])

ans = 0
for i in range(v_max, -1, -1):
    if dp[i] <= W:
        ans = max(ans, i)
print(ans)

### FIXED CODE ###

n, W = map(int, input().split())
dp = [W + 1] * (1010 * (n + 1))

dp[0] = 0
v_max = 0
for i in range(n):
    w, v = map(int, input().split())
    v_max += v
    for j in range(v_max, v - 1, -1):
        dp[j] = min(dp[j - v] + w, dp[j])

ans = 0
for i in range(v_max, -1, -1):
    if dp[i] <= W:
        ans = max(ans, i)
print(ans)
import math
while 1:
    a, b = map(int,raw_input().split())
    print int(math.log10(a+b)+1)

### FIXED CODE ###

while True:
	try:
		a,b = map(int,raw_input().split())
		print len(str(a+b))
	except EOFError:
		break
N=int(input())
A=int(input())
B=int(input())
if N==1:
  print("Hello World")
else:
  print(A+B)

### FIXED CODE ###

N=int(input())
if N == 1:
  print("Hello World")
else:
  A=int(input())
  B=int(input())
  print(A+B)
N = int(input())
clis = [];slis =[];flis = []
for i in range(N-1):
    c,s,f = map(int,input().split())
    clis.append(c);slis.append(s);flis.append(f)
for i in range(N):
    count=0
    for i2 in range(N-i-1):
        c=clis[i+i2];s=slis[i+i2];f=flis[i+i2]
        if count <= s:
            count=s+c
        elif (count-s)%f ==0:
            count = count+c
        else:
            count = count + c f-count%f
    print(count)


### FIXED CODE ###

N = int(input())
clis = [];slis =[];flis = []
for i in range(N-1):
    c,s,f = map(int,input().split())
    clis.append(c);slis.append(s);flis.append(f)
for i in range(N):
    count=0
    for i2 in range(N-i-1):
        c=clis[i+i2];s=slis[i+i2];f=flis[i+i2]
        if count <= s:
            count=s+c
        elif (count-s)%f ==0:
            count = count+c
        else:
            count = count + c+f-count%f
    print(count)
import numpy as np
n = int(input())
b = np.array(list(map(int, input().strip().split())))
b *= 2
A = np.zeros((n,n))
for i in range(n):
    if i == n - 1:
        A[i,0] = 1
        A[i,n-1] = 1
    else:
        A[i,i] = 1
        A[i,i+1] = 1

Ainv = np.linalg.inv(A)         # A の逆行列を計算
x = np.dot(Ainv, b)             # A の逆行列と b の内積
s = str(x.astype(int))
s = s.replace(',','')
s = s.replace('[','')
s = s.replace(']','')
print(s)


### FIXED CODE ###

import numpy as np
n = int(input())
b = list(map(int, input().strip().split()))
s = sum(b)
x = np.zeros((n))

x[0] = s
k = 1
for i in range(int((n-1)/2)):
    x[0] -= 2*b[k%n]
    k += 2

for i in range(1,n):
    x[i] = 2 * b[i-1] - x[i-1]

x = (x.astype(int)).tolist()

s = str(x)
s = s.replace(',','')
s = s.replace('[','')
s = s.replace(']','')
s = s.replace('  ',' ')

print(s)
MOD = 10 ** 9 + 7
FACT_MAX = 2000
fact = [1] * FACT_MAX
for i in range(1, FACT_MAX):
    fact[i] = fact[i - 1] * i % MOD
def comb(n, r):
    return fact[n] * pow(fact[n - r], MOD - 2, MOD) * pow(fact[r], MOD - 2, MOD) % MOD

N, K = map(int, input().split())
for i in range(1, K + 1):
    print(comb(N - K + 1, i) * comb(K - 1, i - 1) % MOD)

### FIXED CODE ###

MOD = 10 ** 9 + 7
FACT_MAX = 2001
fact = [1] * FACT_MAX
for i in range(1, FACT_MAX):
    fact[i] = fact[i - 1] * i % MOD
def comb(n, r):
    return 0 if n < r else fact[n] * pow(fact[n - r], MOD - 2, MOD) * pow(fact[r], MOD - 2, MOD) % MOD

N, K = map(int, input().split())
for i in range(1, K + 1):
    print(comb(N - K + 1, i) * comb(K - 1, i - 1) % MOD)
MOD = 10 ** 5
n, m = map(int, input().split())
kyori = [int(input()) for _ in range(n - 1)]
a = [int(input()) for _ in range(m)]
rui = [0] * n
for i in range(n - 1):
    rui[i + 1] = rui[i] + kyori[i]

ans = 0
tmp = 0
for i in range(m):
    ans += abs(rui[tmp] - rui[tmp + a[i]]) % MOD
    tmp += a[i]

print(ans % MOD)

### FIXED CODE ###

inData = input().split(' ')

ans = 0
count = 0
maxCount = int(inData[2])
many = int(inData[1])
nedan = int(inData[0])

for i in range(0, maxCount):
    if nedan <= many:
        if count < maxCount:
            ans += 1
            many -= nedan
        else:
            break
    else:
        break

print(ans)
# coding: utf-8
a = list(map(int, input().split()))
if sum(a) > 21:
    print("bust")
else:
    print(win)

### FIXED CODE ###

# coding: utf-8
a = list(map(int, input().split()))
if sum(a) > 21:
    print("bust")
else:
    print("win")
a, b, c = input()
d, e, f = input()
if a == d and b == e and c == f:
  print(3)
elif a == b and b == e:
  print(2)
elif b == e and c == f:
  print(2)
elif c == f and a == b:
  print(2)
elif a == d or b == e or c == f:
  print(1)
else:
  peint(0)

### FIXED CODE ###

s = input()
t = input()
 
count = 0
 
for i in range(3):
		if s[i] == t[i]:
			count += 1  
    
print(count)
#prepare
f = True
List = []
#input
List.append(map(int,raw_input().split()))

#evaluate
List.sort()
if not List[0]+List[1] == List[2]:
    f = False

#output
if f:
    print 'YES'
else:
    print 'NO'


### FIXED CODE ###

#prepare
f = True
List = []
#input
List = map(int,raw_input().split())

#evaluate
List.sort()

if not List[0]+List[1] == List[2]:
    f = False

#output
if f:
    print 'Yes'
else:
    print 'No'
lines = []
line = input()
s = line.split(' ')
entries = int(s[2]) + 2
for i in range(entries+1):
    lines.append(line.split(' '))
    if i < entries:
        line = input()

discounts = []
for idx, line in enumerate(lines):
    if idx == 0:
        A = line[0]
        B = line[1]
        M = line[2]
    elif idx == 1:
        refrigerators = line
    elif idx == 2:
        microwaves = line
    else:
        discounts.append(line)

ref_reg = int(10 ** 5)
for r in refrigerators:
    reg = int(r)
    if ref_reg > reg:
        ref_reg = reg

ref_mic = int(10 ** 5)
for m in microwaves:
    mic = int(m)
    if ref_mic > mic:
        ref_mic = mic

ref_min = ref_reg + ref_mic
for discount in discounts:
     d = int(refrigerators[int(discount[0])-1]) + int(microwaves[int(discount[1])-1]) - int(discount[2])
     if d < ref_min:
         ref_min = d       
         
print(ref_min)

### FIXED CODE ###

s = input()

num = len(s)
if num % 2 != 0:
    print('No')
else:
    hitachi = 'hi' * int(num / 2)
    if hitachi == s:
        print('Yes')
    else:
        print('No')
[H,W]=[int(x) for x in raw_input().split()]
N=int(raw_input())
A=[int(x) for x in raw_input().split()]
B=[[0 for x in range(W)] for y in range(H)]
p=0
q=0
d=1
k=0
for i in range(1,N+1):
    for j in  range(A[i-1]):
        B[p][(q+k)*d]=i
        q+=1
        if q==N:
            p+=1
            q=0
            d*=-1
            k= not k
for i in range(H):
    print "".join([str(x) for x in B[i]])
        
        

### FIXED CODE ###

[H,W]=[int(x) for x in raw_input().split()]
N=int(raw_input())
A=[int(x) for x in raw_input().split()]
B=[[0 for x in range(W)] for y in range(H)]
p=0
q=0
d=1
k=0
D=6
for i in range(1,N+1):
    for j in  range(A[i-1]):
        B[p][(q+k)*d]=i
        q+=1
        if q==W:
            p+=1
            q=0
            d*=-1
            k= not k
for i in range(H):
    print "".join([str(x).ljust(D) for x in B[i]])
a = int(input())
b = int(input())
c = int(input())
d = a + b + c

if (d >= 22):
    print('bust')
else:
    print('win')

### FIXED CODE ###

a,b,c = map(int, input().split())
d = a + b + c
if d >= 22:
    print('bust')
else:
    print('win')
k=int(input())
n=min(k,50)
a=list(range(n))
for i in range(n):
  a[i]+=(k+n-1)//n
for i in range(k%n):
  a[i]+=n
  for j in range(n):
    if i==j:continue
    a[i]-=1
print(n)
print(*a)

### FIXED CODE ###

k=int(input())
n=min(k+2,50)
a=list(range(n))
for i in range(n):
  a[i]+=k//n
for i in range(k%n):
  a[i]+=n
  for j in range(n):
    if i==j:continue
    a[j]-=1
print(n)
print(*a)
a, b = map(int, input().split())

def factor(n):
    table = [0] * (n + 1)
    ans = []
    for i in range(2, n + 1):
        if table[i] == 0:
            if n % i == 0:
                ans.append(i)
            for j in range(i + i, n + 1, i):
                table[j] = 1
    return ans

ans = len(set(factor(a)) & set(factor(b))) + 1
print(ans)


### FIXED CODE ###

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

def factor(n):
    ans = []
    i = 2
    while i * i <= n:
        while n % i == 0:
            n /= i
            ans.append(i)
        i += 1
    if n > 1:
        ans.append(int(n))
    return ans

ans = len(set(factor(a)) & set(factor(b))) + 1
print(ans)
import sys, bisect, math, itertools, heapq, collections
from operator import itemgetter
# a.sort(key=itemgetter(i)) # i番目要素でsort
from functools import lru_cache
# @lru_cache(maxsize=None)
sys.setrecursionlimit(10**8)
input = sys.stdin.readline
INF = float('inf')
mod = 10**9 + 7
eps = 10**-7


def inp():
    '''
    一つの整数
    '''
    return int(input())


def inpl():
    '''
    一行に複数の整数
    '''
    return list(map(int, input().split()))


def str_inp():
    '''
    文字列をリストとして読み込む
    '''
    return list(input()[:-1])


h, w, m = inpl()
dic1 = [0] * h
dic2 = [0] * w
mine = [[0] * w for _ in range(h)]
for _ in range(m):
    y, x = inpl()
    dic1[y - 1] += 1
    dic2[x - 1] += 1
    mine[y - 1][x - 1] = 1

sub1 = []
tmp = 0
for i in range(h):
    if tmp < dic1[i]:
        sub1 = [i]
        tmp = dic1[i]
    elif tmp == dic1[i]:
        sub1.append(i)
temp = 0
sub2 = []
for i in range(w):
    if temp < dic2[i]:
        sub2 = [i]
        temp = dic2[i]
    elif temp == dic2[i]:
        sub2.append(i)
ans = -1
for i in sub1:
    for j in sub2:
        if mine[i][j] == 0:
            ans = 0
            break
print(ans + tmp + temp)


### FIXED CODE ###

import sys, bisect, math, itertools, heapq, collections
from operator import itemgetter
# a.sort(key=itemgetter(i)) # i番目要素でsort
from functools import lru_cache
# @lru_cache(maxsize=None)
sys.setrecursionlimit(10**8)
input = sys.stdin.readline
INF = float('inf')
mod = 10**9 + 7
eps = 10**-7


def inp():
    '''
    一つの整数
    '''
    return int(input())


def inpl():
    '''
    一行に複数の整数
    '''
    return list(map(int, input().split()))


def str_inp():
    '''
    文字列をリストとして読み込む
    '''
    return list(input()[:-1])


h, w, m = inpl()
dic1 = [0] * h
dic2 = [0] * w
mine = [set() for i in range(h)]
for _ in range(m):
    y, x = inpl()
    dic1[y - 1] += 1
    dic2[x - 1] += 1
    mine[y - 1].add(x - 1)

sub1 = []
tmp = -1
for i in range(h):
    if tmp < dic1[i]:
        sub1 = [i]
        tmp = dic1[i]
    elif tmp == dic1[i]:
        sub1.append(i)
temp = -1
sub2 = []
for i in range(w):
    if temp < dic2[i]:
        sub2 = [i]
        temp = dic2[i]
    elif temp == dic2[i]:
        sub2.append(i)
ans = -1
FLAG = False
for i in sub1:
    for j in sub2:
        if j not in mine[i]:
            ans = 0
            FLAG = True
            break
    if FLAG:
        break
print(ans + tmp + temp)
K=int(input())
A,B=map(int,input().split())
C=B-A
if C>=K:
    print("OK")
elif A%K==0:
    print("OK")
elif B%K==0:
    print("OK")
else:
    print("NG")  

### FIXED CODE ###

X=int(input())
yokin=100
year=0

while yokin<X:
    yokin=int(yokin*1.01)
    year=year+1

print(year)
x,k,d=map(int,input().split())
p=k*d-x
q=p//(2*d)
r=p/(2*d)
if r<=0:
  print(-p)
elif 0<r<k:
  s=min(p-2*d*q,-p+2*d*(q+1))
  print(s)


### FIXED CODE ###

S = input()
if S=="SSS":
    print(0)
elif S =="SSR"or S == "SRS" or S == "RSS" or S == "RSR":
    print(1)
elif S =="RRS" or S == "SRR":
    print(2)
else:
    print(3)
if b >= a:
    print(a)
else:
    print(a-1)

### FIXED CODE ###

a,b = map(int,input().split())
if b >= a:
    print(a)
else:
    print(a-1)