Harryxun/stf_run huggingface dataset:
n,k = list(map(int,input().split()))
A = list(map(int,input().split()))
tour=[0]
visited=[0]*n
visited[0]=1
next_town = 0
flag=False
for i in range(n):
    next_town=A[next_town]-1
    if i==k:
        flag = True
        ans = next_town
    if next_town==0:
        first_roop_idx = 0
        break
    if visited[next_town]>0:
        first_roop_idx = visited[next_town]
        break
    tour.append(next_town)
    visited[next_town]=i+1
#print(tour)
#print(visited)
#print(first_roop_idx)
if not flag:
    if k<=len(tour):
        ans = tour[k]
    else:
        k-=first_roop_idx
        #print("k=",k)
        if len(tour)-first_roop_idx==0:
            k=0
        else:k=k%(len(tour)-first_roop_idx)
        #print("k=",k)
        ans = tour[first_roop_idx+k]
print(ans+1)


### FIXED CODE ###

n,k = list(map(int,input().split()))
A = list(map(int,input().split()))
tour=[0]
visited=[0]*n
visited[0]=1
next_town = 0
flag=False
for i in range(n):
    next_town=A[next_town]-1
    if i+1==k:
        flag = True
        ans = next_town
        break
    if next_town==0:
        first_roop_idx = 0
        break
    if visited[next_town]>0:
        first_roop_idx = visited[next_town]
        break
    tour.append(next_town)
    visited[next_town]=i+1
#print(tour)
#print(visited)
#print(first_roop_idx)
if not flag:
    if k<=len(tour):
        ans = tour[k]
    else:
        k-=first_roop_idx
        #print("k=",k)
        if len(tour)-first_roop_idx==0:
            k=0
        else:k=k%(len(tour)-first_roop_idx)
        #print("k=",k)
        ans = tour[first_roop_idx+k]
print(ans+1)
#print(flag)
W, H, x, y = map(int, input().split())

is_center = if x * 2 == W and y * 2 == H
min_square = W * H / 2

print(min_square, is_center)

### FIXED CODE ###

W, H, x, y = map(int, input().split())

is_center = int(x * 2 == W and y * 2 == H)
min_sq = W * H / 2

print("{} {}".format(min_sq, is_center))
print("Yes" if input() in tuple(s1[i:] + s1[:i] for i in range(len(s1))) else "No")


### FIXED CODE ###

s1 = input()
print("Yes" if input() in tuple(s1[i:] + s1[:i] for i in range(len(s1))) else "No")
import numpy as np

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

def lcm(x, y):
    return (x * y) // np.gcd(x, y)

print(lcm(a,b))

### FIXED CODE ###

a,b = map(int,input().split())
 
def gcd(a,b):
    while b!=0:
        a,b=b,a%b
    return a


def lcm(a,b):
    return a*b//gcd(a,b)

print(lcm(a,b))
import numpy as np
n,x = map(int,input().split())
arr = list(map(int,input().split()))
arr = np.array(arr)
arr -= x
arr = np.abs(arr)
# print(arr)

print(np.gcd.reduce(arr))

### FIXED CODE ###

import numpy as np

def gcd_core(a, b):
    if b == 0:
        return a
    else:
        return gcd_core(b, a % b)

def gcd(arr):
    g = gcd_core(arr[0], arr[1])
    for i in range(2, len(arr)):
        g = gcd_core(g, arr[i])
    return g
n,x = map(int,input().split())
arr = list(map(int,input().split()))
arr = np.array(arr)
arr -= x
arr = np.abs(arr)
# print(arr)

if len(arr) == 1:
    print(arr[0])
else:
    print(gcd(arr))
a, b, c = map(int, input().split())
     
    if b > a:
        temp = a
        a = b
        b = temp
     
    res = c - a
    res = res - b
    temp = 4*a*b
     
    if res**2 > temp:
        print ("Yes")
    else:
        print ("No")

### FIXED CODE ###

import numpy as np

a, b, c = map(int, raw_input().split())

if b > a:
    temp = a
    a = b
    b = temp

res = c - a
res = res - b
temp = 4*a*b


if res <0:
    print "No"
elif res**2 > temp:
    print "Yes"
else:
    print "No"
N , L= map(int,input().split())
lst = list()
Str = ''
for i in range(n):
    lst.append(input())
lst.sort()
for j in lst:
    Str += j
print(Str)


### FIXED CODE ###

N,L=map(int, input().split())
S=[]
for i in range(N):
    S.append(input())
S.sort()
result=''
for j in range(N):
    result+=S[j]     
print(result)
n,k = map(int,input().split())
line = list(map(int,input().split()))

inf = float('inf')
line.extend([inf for i in range(k)])
box = [inf for i in range(n + k)]
  
def frog(x):
  box[0] = 0
  if x == n-1:
    return box[n-1]
  else:    
    for i in range(1,k+1):
      cost = abs(line[x] - line[x+i])
      if box[x+i] == inf:
        box[x+i] = box[x] + cost
      else:
        box[x+i] = min(box[x] + cost,box[x+1])
    return frog(x+1)
print(frog(0))

### FIXED CODE ###

n,k = map(int,input().split())
line = list(map(int,input().split()))
 
inf = float('inf')
line.extend([inf for i in range(k)])
box = [inf for i in range(n + k)]
#out of rangeを避けるため

box[0] = 0
for x in range(n):   
  for i in range(1,k+1):
    cost = abs(line[x] - line[x+i])
    if box[x+i] >= box[x] + cost:
      box[x+i] = box[x] + cost
print(box[n-1])
#!/usr/bin/env python3
import sys


def f(H, W):
    mh = H // 2
    mw = W // 2
    return (mh*W, (H-mh)*W), (H*mw, H*(W-mw))

def solve_iter(H: int, W: int):
    for h in range(1, H):
        for s in ((h*W,*s) for s in f(H-h, W)):
            yield max(s) - min(s)
    for w in range(1, W):
        for s in ((H*w,*s) for s in f(H, W-w)):
            yield max(s) - min(s)

def solve(H: int, W: int):
    return min(solve_iter(H, W))


# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    H = int(next(tokens))  # type: int
    W = int(next(tokens))  # type: int
    print(solve(H, W))

def test():
    import doctest
    doctest.testmod()

if __name__ == '__main__':
    #test()
    main()


### FIXED CODE ###

#!/usr/bin/env python3
import sys


def f(H, W):
    mh = H // 2
    if mh != 0:
        yield mh*W, (H-mh)*W
    mw = W // 2
    if mw != 0:
        yield H*mw, H*(W-mw)

def solve_iter(H: int, W: int):
    for h in range(1, H):
        for s in (tuple([h*W])+s for s in f(H-h, W)):
            yield max(s) - min(s)
    for w in range(1, W):
        for s in (tuple([H*w])+s for s in f(H, W-w)):
            yield max(s) - min(s)

def solve(H: int, W: int):
    return min(solve_iter(H, W))


# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    H = int(next(tokens))  # type: int
    W = int(next(tokens))  # type: int
    print(solve(H, W))

def test():
    import doctest
    doctest.testmod()

if __name__ == '__main__':
    #test()
    main()
a,b,k=map(int,input().split())
for i in range(k):
  if i%2:
    b//=2
    a+=b
  else:
    a//=2
    b+=a
print(a,b

### FIXED CODE ###

a,b,k=map(int,input().split())
for i in range(k):
  if i%2:b//=2;a+=b
  else:a//=2;b+=a
print(a,b)
n , d =map(int,input().split())
import sys
import math
 
a = [[int(c) for c in l.strip()] for l in sys.stdin]
count = 0
 
for i in range(n):
  for j in range(n):
    if i == j:
      count += 0
    else:
      d = math.sqrt((a[i][0] - a[j][0]) ** 2 + (a[i][1] - a[j][1]) ** 2 +(a[i][2] - a[j][2]) ** 2  +(a[i][3] - a[j][3]) ** 2  + (a[i][4] - a[j][4]) ** 2)
      d = float(d)
      if d.is_integer():
        count += 1
print(count)

### FIXED CODE ###

n , D =map(int,input().split())
import math
 
a = [input().split() for l in range(n)]
count = 0
 
for i in range(n):
  for j in range(n):
    if i == j:
      count += 0
    else:
      x = []
      for c in range(D):
        x.append((int(a[i][c]) - int(a[j][c])) ** 2)
      d = math.sqrt(sum(x))
      d = float(d)
      if d.is_integer():
        count += 1
print(int(count/2))
a,b,c=map(int,input().split())
val=a+b+c
if val > 21:
    print("bust")
  else:
    print("win")
    
    



### FIXED CODE ###

a,b,c=map(int,input().split())
val=a+b+c
if val > 21:
    print("bust")
else:
    print("win")
#!/usr/bin/python

import sys

def main(argv):
    line = sys.stdin.readline()
    while line:
        N, M = map(lambda x: int(x), line.split(" ", 2))

        services_1 = set()
        services_n = []
        for i in xrange(M):
            a, b = map(lambda x: int(x), sys.stdin.readline().split(" ", 2))
            if a == 1:
                services_1.add(b)
            if b == N:
                services_n.append(a)

        if 1 in services_n:
            print("POSSIBLE")

        result = "IMPOSSIBLE"
        for service in services_n:
            if service == 1 or service in services_1:
                result = "POSSIBLE"
                break
        print result                

        line = sys.stdin.readline()

if __name__ == "__main__":
    main(sys.argv)

### FIXED CODE ###

#!/usr/bin/python

import sys

def main(argv):
    for line in sys.stdin:
        print("ABC{0}".format(int(line)))

if __name__ == "__main__":
    main(sys.argv)
a,b,n=map(int,input().split())
c=[]
i=0
while(1):
  i=i+1
  if a%i==0 and b%i==0:
    c,append(i)
  if a<=i or b<=i:
    break
d=(len(c)-k+1)
print(c[d])

### FIXED CODE ###

a,b,n=map(int,input().split())
c=[]
i=0
while(1):
  i=i+1
  if a%i==0 and b%i==0:
    c.append(i)
  if a<=i or b<=i:
    break
d=len(c)-n
print(c[d])
n, m, x = map(int, input().split())

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

counta=0;
countb=0;

for i in a:
    if (n<a and a<x) or (x<a and a<n):
        counta+=1

for i in a:
    if (0<a and a<x):
        countb+=1

if (counta<countb):
    ans = counta
else:
    ans = countb

print(ans)


### FIXED CODE ###

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

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

counta=0;
countb=0;

for i in a:
    if (n<i and i<x) or (x<i and i<n):
        counta+=1

for i in a:
    if (0<i and i<x):
        countb+=1


if (counta<countb):
    ans = counta
else:
    ans = countb

print(ans)
from math import factorial


def cmb(n, r):
    return factorial(n) // factorial(r) // factorial(n - r)


def p_d():
    N, K = map(int, input().split())
    n = N - K + 1
    mod = 10 ** 9 + 7

    for i in range(1, K + 1):
        c = cmb(n, min(i, abs(n - i)))
        k = cmb(K - 1, i - 1)
        print(c * k % mod)


if __name__ == '__main__':
    p_d()


### FIXED CODE ###

from math import factorial


def cmb(n, r):
    return factorial(n) // factorial(r) // factorial(abs(n - r))


def p_d():
    N, K = map(int, input().split())
    n = N - K + 1
    mod = 10 ** 9 + 7

    for i in range(1, K + 1):
        c = cmb(n, i)
        k = cmb(K - 1, i - 1)
        print(c * k % mod)


if __name__ == '__main__':
    p_d()
from functools import reduce

N = int(input())
AL = list(map(int, input().split()))

R = reduce(lambda x, y: x and y, [n % 3 == 0 or n % 5 == 0 for n in AL if n % 2 == 0])

if R:
    print('APPROVED')
else:
    print('DENIED')



### FIXED CODE ###

# from functools import reduce

N = int(input())
AL = list(map(int, input().split()))

R = True
for b in [n % 3 == 0 or n % 5 == 0 for n in AL if n % 2 == 0]:
    R = R and b

if R:
    print('APPROVED')
else:
    print('DENIED')
N=int(input())
ps=[]
tp=[]
ap=[]
for i in range(N):
  p=input().split()
  ps.append([int(p[0])+int(p[1]),i])
  tp.append(int(p[0]))
  ap.append(int(p[1]))
    
def is_even(num):
  if num % 2 == 0:
    return True
  else:
    return False

T=0
A=0
calc=sorted(ps,reverse=True)
for i in range(N):
  p,j = calc.pop()
  if is_even(i):
    T+=tp[j]
  else:
    A+=ap[j]
print(T-A)


### FIXED CODE ###

s=input().split()
N=int(s[0])
A=int(s[1])
B=int(s[2])
X=min([A,B])
Y=N-max([A,B])
if X-Y>0:
    print(X,X-Y)
else:
    print(X,0)
r,D,x_2000=map(int,input().split())
x=[x_2000]
for i in range(10):
  y=List[i]*r-D
  List.append(y)
  print(List[i+1])



### FIXED CODE ###

r,D,x_2000=map(int,input().split())
x=[x_2000]
for i in range(10):
  y=x[i]*r-D
  x.append(y)
  print(x[i+1])
import itertools
n, k = map(int, input().split())

def c(n):
    if n <= 2:
        return 1
    return n * (n - 1) // 2


if k <= c(n - 1):
    print(n - 1 + c(n - 1) - k)
    nodes = list(range(2, n + 1))
    for i in nodes:
        print(1, i)

    combi = itertools.combinations(nodes, 2)
    for i in range(c(n - 1) - k):
        print(*next(combi))
else:
    print(-1)


### FIXED CODE ###

import itertools
n, k = map(int, input().split())

def c(n):
    if n <= 2:
        return 1
    return n * (n - 1) // 2


if n > 2 and k <= c(n - 1):
    print(n - 1 + c(n - 1) - k)
    nodes = list(range(2, n + 1))
    for i in nodes:
        print(1, i)

    combi = itertools.combinations(nodes, 2)
    for i in range(c(n - 1) - k):
        print(*next(combi))
else:
    print("1\n1 2" if k == 0 else -1)
for i in range(1,13):
    t[i] = 0

s = t
h = t
c = t
d = t

num = int(input())
for i in range(num)
    m, n = input().split()
    n = int(n)
    if m == "s":
        s[n] == 1
    if m == "h":
        h[n] == 1
    if m == "c":
        h[n] == 1
    if m == "d":
        h[n] == 1

for i in range(1,13):
    if s[i] == 0:
        print("S %d" i)

for i in range(1,13):
    if h[i] == 0:
        print("H %d" i)

for i in range(1,13):
    if c[i] == 0:
        print("C %d" i)

for i in range(1,13):
    if d[i] == 0:
        print("S %d" i)






### FIXED CODE ###

#
# 6b
#

def main():
    n = int(input())
    c = []
    for i in range(n):
        m, r = input().split()
        r = int(r)
        c.append([m, r])
    for M in ["S", "H", "C", "D"]:
        for R in range(1, 14):
            for i in range(n):
                if c[i] == [M, R]:
                    break
            else:
                print(*[M, R])


if __name__ == '__main__':
    main()
W,H,x,y,r = map(int,input().split())

w,h = W-r,H=r

if 0<x<w and 0<y<h: print('Yes')

else: print('No')


### FIXED CODE ###

W,H,x,y,r = map(int,input().split())



if x-r<0 or W<x+r or y-r<0 or H<y+r: print('No')

else: print('Yes')
import math as mt
N = int(input())

if N % 2 == 1:
    print(0)
    exit()

r = 0
L = int(mt.log(N,5))
for i in range(1,L+1):
    p = N//(5**i)//2
    r += p
    #print(N,5**i,p)
print(r)

### FIXED CODE ###

import math as mt
N = int(input())

if N % 2 == 1 or N < 2:
    print(0)
    exit()

r = 0
L = int(mt.log(N,5))
for i in range(1,L+1):
    p = N//(5**i)//2
    r += p
    #print(N,5**i,p)
print(r)
n = int(input())
str = input()
if n%2 == 1:
    print('No')
else:
    if str[:n//2] == str[n//2:]
	    print('Yes')
    else
	    print('No')

### FIXED CODE ###

n = int(input())
str = input()
if n%2 == 1:
    print('No')
else:
    if str[:n//2] == str[n//2:]:
	    print('Yes')
    else:
	    print('No')
[n, m] = [int(x) for x in raw_input().split()]
A = []
B = [0] * m

counter = 0
while counter < n:
    A.append([int(x) for x in raw_input().split()])
    counter += 1

B[counter] = [int(raw_input()) for j in range(m)]

counter = 0
while counter < n:
    result = 0
    for j in range(m):
        result += A[counter][j] * B[j]
    print(result)
    counter += 1

### FIXED CODE ###

[n, m] = [int(x) for x in raw_input().split()]
A = []

counter = 0
while counter < n:
    A.append([int(x) for x in raw_input().split()])
    counter += 1

B = [int(raw_input()) for j in range(m)]

counter = 0
while counter < n:
    result = 0
    for j in range(m):
        result += A[counter][j] * B[j]
    print(result)
    counter += 1
def combination_list(n, mod=10**9+7):
    lst = [1]
    for i in range(1, n+1):
        lst.append(lst[-1] * (n+1-i) % mod * pow(i, mod-2, mod) % mod)
    return lst

n, k = map(int, input().split())
mod = 10**9+7

fst = combination_list(n-k+1, mod)
scd = combination_list(k-1, mod)

for i in range(1, k+1):
    print(fst[i] * scd[i-1] % mod)

### FIXED CODE ###

n, k = map(int, input().split())
mod = 10**9+7

def cmb_table(n, mod):
    fac = [1] * (n+1)   # numerator
    finv = [1] * (n+1)   # denominator
    inv = [1] * (n+1)   # inverse of natural number
    inv[0] = 0
    for i in range(2, n+1):
        fac[i] = fac[i-1] * i % mod
        inv[i] = mod - inv[int(mod%i)] * (mod//i) % mod
        finv[i] = finv[i-1] * inv[i] % mod
    return fac, finv

def cmb(n, r, mod, fac, finv):
    if n < r:
        return 0
    if n < 0 or r < 0:
        return 0
    return int(fac[n] * finv[r] * finv[n-r] % mod)

a, b = cmb_table(n, mod)

for i in range(1, k+1):
    t1 = cmb(n-k+1, i, mod, a, b)
    t2 = cmb(k-1, i-1, mod, a, b)
    print(t1 * t2 % mod)
a = input() // 数の個数
b = list(map(int, input().split())) // それぞれの値
count = 0
while(1):
  for i in range(a):
    if b[i] % 2 == 1:
      break;
    else :
      b[i] /= 2
  count += 1
print(count)

### FIXED CODE ###

a = int(input())
b = list(map(int, input().split()))
count = 0
while(1):
  flag = 0
  for i in range(0, a, 1):
    if (b[i] % 2 == 1) :
      flag = 1
  if (flag == 1) :
    break
  for i in range(0, a, 1):
    b[i] /= 2
  count += 1
print(count)
import math
import collections

from operator import mul
from functools import reduce

def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

mod = 10**9+7 #出力の制限
N = 10**4
g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル

for i in range( 2, N + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )

N,M = list(map(int,input().split()))

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

c = collections.Counter(prime_factorize(M))
#print(c)
ans = 1
for i,j in c.items():
    ans *= cmb(N+j-1,j,mod) % mod
print(int(ans%mod))


### FIXED CODE ###

import math
import collections

from operator import mul
from functools import reduce

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

def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

mod = 10**9+7 #出力の制限
N = 100 + n
g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル

for i in range( 2, N + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )



def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

c = collections.Counter(prime_factorize(m))
#print(c)
ans = 1
for i,j in c.items():
    ans *= cmb(n+j-1,j,mod) % mod
print(int(ans%mod))
ef knapsack(nums, KLeap):
    n = len(nums)
    if n == 0 or n == 1:
        return 0
 
    if n < KLeap:
        return abs(nums[0] - nums[-1])
    # dp[i] is min cost when reaching stone i
    dp = [0] * n
    for i in range(1, KLeap):
        dp[i] = abs(nums[0] - nums[i])
 
    for i in range(K+1, n):
        dp[i] = min([dp[i - k] + abs(nums[i - k] - nums[i]) for k in range(1, KLeap)])
 
    return dp[-1]
 
 
if __name__ == "__main__":
    _, K = [int(x) for x in input().split()]
    nums = [int(x) for x in input().split()]
    print(knapsack(nums, K))

### FIXED CODE ###

def knapsack(nums, k):
    n = len(nums)

    # dp[i] is min cost when reaching stone i
    dp = [float('Inf')] * n
    dp[0] = 0
    for i in range(1, n):
        dp[i] = min([
            dp[i-j] + abs(nums[i] - nums[i-j])
            for j in range(1, k+1) if i - j >= 0]
        )
    return dp[-1]


if __name__ == "__main__":
    _, k = [int(x) for x in input().split()]
    nums = [int(x) for x in input().split()]
    print(knapsack(nums, k))
n=int(input())
list=list(map(int,input().split()))

ave=int(sum(list)/len()list)

ans=0
[ans+= pow((i-ave),2) for i in list]

print(ans)

### FIXED CODE ###

n=int(input())
list=list(map(int,input().split()))
min_tairyoku=10000000000000000000
tairyoku=[]
for i in range(min(list),max(list)+1):
    t=0
    for j in list:
        t += (j-i) ** 2
    tairyoku.append(t)
print(min(tairyoku))
n=int(input())
xyh = [list(map(int,input().split())) for i in range(n)]

ansh=-1
ans=[]
for cx in range(0,101):
  if len(ans)>0:
    break
  for cy in range(0,101):
    if len(ans)>0:
      break
    ansh = -1
    for pira in xyh:
      
      if pira[2] == 0 and ansh=-1 and pira[2]+abs(cx-pira[0])+abs(cy-pira[1])<=0:
        ansh = pira[2]+abs(cx-pira[0])+abs(cy-pira[1])
        ans.append([cx,cy,ansh])
      
      elif pira[2] > 0 and ansh == -1:
        ansh = pira[2]+abs(cx-pira[0])+abs(cy-pira[1])
        ans.append([cx,cy,ansh])
        
      elif len(ans)>0 and pira[2] > 0 and ansh !=pira[2]+abs(cx-pira[0])+abs(cy-pira[1]):
        ans=[]
        break
        
      elif len(ans)>0 and pira[2]==0 and ansh-abs(cx-pira[0])-abs(cy-pira[1])>0:
        ans=[]
        break
print(*ans[0])


### FIXED CODE ###

n=int(input())
xyh = [list(map(int,input().split())) for i in range(n)]
xyh.sort(key=lambda x:x[2], reverse=True)

ansh=-1
ans=[[]]
flag=True
for cx in range(0,101):
  if flag==False:
    break
    
  for cy in range(0,101):
    ansh = 0
    for pira in xyh:
      if ansh==0:
        ansh=pira[2]+(abs(cx-pira[0])+abs(cy-pira[1]))
        ans[0]=[cx,cy,ansh]
        
      elif len(ans[0])>0 and max(ansh -(abs(cx-pira[0])+abs(cy-pira[1])), 0) != pira[2]:
        ans[0]=[]
    if len(ans[0])>0:
      flag=False
      break
print(*ans[0])
N = int(input())
S = [input().split() for _ in range(N)]
res = len(set(S))
print("Three" if res == 3 else "Four")

### FIXED CODE ###

N = int(input())
S = input().split()
res = len(set(S))
print("Three" if res == 3 else "Four")
N, T = list(map(int, input().split()))
paris = []
for i in range(N):
  c, t = list(map(int, input().split()))
  if t<=T:
    pairs.append((c, t))
if len(pairs)==0:
  print('TLE')
else:
  print(sorted(pairs, key=lambda p:p[0])[0][0])

### FIXED CODE ###

N, T = list(map(int, input().split()))
pairs = []
for i in range(N):
  c, t = list(map(int, input().split()))
  if t<=T:
    pairs.append((c, t))
if len(pairs)==0:
  print('TLE')
else:
  print(sorted(pairs, key=lambda p:p[0])[0][0])
import math
H, A = input().split()
print(math.ceil(H/A))

### FIXED CODE ###

import math

H,A = map(int, input().split())
print(math.ceil(H/A))
n,m = map(int,input().split())

a = [0]*n
a = [int(s) for s in input().split()]

a_half = [s//2 for s in a]
#print(a)

def check(x):
    while (all(c%2 == 1 for c in x)):
        if any(c%2 == 1 for c in x):
            return 0
        x /= 2
    
    return 1

def gcd(x,y):
    #print(x,y)
    if(x%y == 0):
        #print(y)
        return y
    else:
        return gcd(y,x%y)


def lcm(x,y):
    return x/gcd(x,y)*y

if(check(a)== 1):
    x = a_half[0]
    for i in range(1,n):
        y = a_half[i]
        x = lcm(x,y)
    
    if((m//x)%2==0):
        print(int(m/x)//2)
    else:
        print((int(m/x)+1)//2)
else:
    print(0)
    
    
    


### FIXED CODE ###

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

a = [1]*n
#print(a)
a = [int(s) for s in input().split()]

a_half = [s//2 for s in a]
#print(a)

def check(x):
    while (all(c%2 == 0 for c in x)):
        x = [s//2 for s in x]
        if any(c%2 == 1 for c in x) and any(c%2 == 0 for c in x):
            return 0
        
    
    return 1

def gcd(x,y):
    #print(x,y)
    if(x%y == 0):
        #print(y)
        return y
    else:
        return gcd(y,x%y)


def lcm(x,y):
    return x//gcd(x,y)*y

if(check(a)== 1):
    x = a_half[0]
    for i in range(1,n):
        y = a_half[i]
        x = lcm(x,y)
    if(x > m):
        print(0)
    else:
        res = int((m//x+1)//2)
        print(res)
else:
    print(0)
a=int(input())
ans+=0
for i in range(1,a+1):
  if len(str(i))%2==1:
    ans+=1
print(ans)

### FIXED CODE ###

a=int(input())
ans=0
for i in range(1,a+1):
  if len(str(i))%2==1:
    ans+=1
print(ans)