Harryxun/stf_run huggingface dataset:
import math
D, G = map(int, input().split())
P = []
C = []
for i in range(D):
    p, c = map(int, input().split())
    P.append(p)
    C.append(c)

used = [False for i in range(D)]


def check_goal(P, C, rest):
    result = []
    for i in range(len(P)):
        if used:
            continue
        if rest < 100 * (i + 1) * P[i]:
            result.append(math.ceil(rest // 100 * (i + 1)))
        elif rest <= 100 * (i + 1) * P[i] + C[i]:
            result.append(P[i])
        else:
            result.append(float("inf"))
    return result


def get_scores_best(P, C, rest):
    scores = [(100 * (i + 1), i) if 100 * (i + 1) * P[i] > rest else (100 *
                                                                      (i + 1) + C[i] / P[i], i) for i in range(len(P))]
    scores.sort(key=lambda x: x[0])
    scores.reverse()
    while True:
        j = 0
        if used[scores[j][1]]:
            j += 1
            continue
        else:
            return scores[j]


def judge(P, C, G):
    rest = G
    count = 0
    while True:
        count_list = check_goal(P, C, rest)
        if min(count_list) != float("inf"):
            count += min(count_list)
            return count
        else:
            score, i = get_scores_best(P, C, rest)
            count += P[i]
            rest -= 100 * (i + 1) * P[i] + C[i]
            print(rest)
            used[i] = True


print(judge(P, C, G))


### FIXED CODE ###

D, G = map(int, input().split())
P = []
C = []
for i in range(D):
    p, c = map(int, input().split())
    P.append(p)
    C.append(c)


def bit_search(A):
    result = []
    for i in range(1 << len(A)):
        output = []
        for j in range(len(A)):
            if ((i >> j) & 1) == 1:
                output.append(A[j])
        result.append(output)

    return result


search_list = bit_search(list(range(D)))
ans = 10 ** 9
for complete_list in search_list:
    score = sum([100 * (i + 1) * P[i] + C[i] for i in complete_list])
    count = sum([P[i] for i in complete_list])
    if score >= G:
        ans = min(ans, count)
    else:
        j_max = max([i for i in range(D) if i not in complete_list])
        required = -(-(G - score) // (100 * (j_max + 1)))
        if required < P[j_max]:
            count += required
            ans = min(ans, count)
print(ans)
n = input()
a = input().split("")
b = list(set([x for x in a if a.count(x) > 1]))

for i in b:
    print(i)


### FIXED CODE ###

from collections import defaultdict
from collections import OrderedDict
N = int(input())
ans = dict()
for _ in range(N):
    k = str(input())
    if k in ans:
        ans[k]+=1
    else:
        ans.update({k:1})
groupedByValue = defaultdict(list)
for key, value in sorted(ans.items()):
    groupedByValue[value].append(key)
l = groupedByValue[max(groupedByValue)]
for i in l:
    print(i)
q=[]
vis=set() 
q=[i for i in range(1,10)]
nums=[]
while q:
   # nums.append(t)
    t=q.pop(0)
    nums.append(t)
    if not t*10+9 in vis  and t*10+9<=10**15:
        q.append(t*10+9)
        vis.add(t*10+9)
nums.sort()
k=int(input())
for i in range(k):
    print(nums[i])

### FIXED CODE ###

def s(n):
    ret = 0
    while n > 0:
        ret += n % 10
        n //= 10
    return ret
numbers = [999999999999999999]
while numbers[-1] > 1:
    for d in range(0, 100):
        n = numbers[-1]
        m = n - 10 ** d
        if n * s(m) >= m * s(n):
            numbers.append(m)
            break
numbers = list(reversed(numbers))

n = int(input())
for i in range(n):
    print(numbers[i])
# -*- coding: utf-8 -*-
"""
Created on Sun Mar 22 20:56:06 2020

@author: naoki
"""
import math
f = open("C:/Users/naoki/Desktop/Atcoder/input.txt")
H, W, K = map(int, input().split())
S = [list(map(int,str(input()).replace('\n',''))) for _ in range(H)]
t_S = [[S[j][i] for j in range(len(S))]for i in range(len(S[0]))]

sum_gyo = [sum(gyo) for gyo in S]
sum_retu = [sum(retu) for retu in t_S]

katamari = [sum(sum_retu)]

if katamari[0] > K:
    print(math.ceil(katamari[0]/K))
else:
    print(0)

### FIXED CODE ###

H, W, K = map(int, input().split())
Ss = [list(map(int, input().replace("\n", ""))) for _ in range(H)]

cut_yoko_patterns = ["0","1"]
options = ["0","1"]

import copy

for i in range(H-2):
    cut_yoko_patterns = [cut_yoko_patterns[i] + options[j] for i in range(len(cut_yoko_patterns)) for j in range(len(options))]

answer = int(1e+5)
for cut_yoko_pattern in cut_yoko_patterns:
    yoko_cut_num = cut_yoko_pattern.count("1")
    boxs = [0 for _ in range(yoko_cut_num+1)]
    box_num = [0 for _ in range(H)]
    for i in range(H-1):
        if cut_yoko_pattern[i] == "1":
            box_num[i+1] = box_num[i] + 1
        else:
            box_num[i+1] = box_num[i]
    
    tate_cut_num = 0
    for j in range(W):
        temp_boxs = [0 for _ in range(yoko_cut_num+1)]
        for i in range(H):
            if Ss[i][j] == 1:
                temp_boxs[box_num[i]] += 1
        Impossible = False
        Should_cut = False
        for i in range(yoko_cut_num+1):
            if temp_boxs[i] > K:
                Impossible = True
            
            elif boxs[i] + temp_boxs[i] > K:
                Should_cut = True
        
        if Impossible == True:
            break
        elif Should_cut ==True:
            boxs = copy.deepcopy(temp_boxs)
            tate_cut_num += 1
        else:
            for i in range(yoko_cut_num+1):
                boxs[i] += temp_boxs[i]
    else:
        
        if tate_cut_num+yoko_cut_num < answer:
            answer = tate_cut_num + yoko_cut_num
print(answer)
s = int(input())
l = list(map(int,input().split()))
l.sort()

ans = 0
for i in N:
  for j in range(i+1,N):
    for k in range(j+1,N):
      if l[k]<l[i]+l[j]:
        if l[i]!=l[j] and l[j]!=l[k]:
        ans +=1

### FIXED CODE ###

n = int(input())
l = list(map(int, input().split()))
l.sort()

ans = 0
for i in range(n):
    for j in range(i + 1, n):
        for k in range(j + 1, n):
            if l[i] != l[j] != l[k]:
                if l[i] + l[j] > l[k]:
                    ans += 1
print(ans)
H,W=(int(i) for i in input().split(' '))
grid=[]
for h in range(H):
  tmp = input()
  if tmp.count('#')!=0:
 	grid[h]=tmp
  else:
    H -= 1
pop_count=0
for w in range(W):
  check = 0
  for h in range(h):
    if grid[h][w-pop_count]='#':
      check = 1
  if check == 0:
    for h in range(H):
		grid[h].pop(w-pop_count)
    pop_count+=1
for h in range(H):
  print(grid[h])

### FIXED CODE ###

H,W=(int(i) for i in input().split(' '))
grid=[]
delete_count= 0
pop_count=0
for h in range(H):
  tmp = [char for char in input()]
  if tmp.count('#')!=0:
    grid.append(tmp)
  else:
    delete_count += 1
for w in range(W):
  check = 0
  for h in range(H-delete_count):
    if grid[h][w-pop_count]=='#':
      check = 1
  if check == 0:
    for h in range(H-delete_count):
      del grid[h][w-pop_count]
    pop_count+=1
for h in range(H-delete_count):
  grid[h]=''.join(grid[h])
  print(grid[h])
sx, sy, tx, ty = map(int,input().split())

route = ''

updown_num = ty - sy # 0>なら goalは上方向
rightleft_num = tx - sx #0>ならgoalは右方向

#route1
for i in range(updown_num):
    route += 'U'
for i in range(rightleft_num):
    route += 'R'
route2
for i in range(updown_num):
    route += 'D'
for i in range(rightleft_num):
    route += 'L'
#route3
route += 'L'
for i in range(updown_num + 1):
    route += 'U'
for i in range(rightleft_num + 1):
    route += 'R'
route += 'D'
#route4
route += 'R'
for i in range(updown_num + 1):
    route += 'D'
for i in range(rightleft_num + 1):
    route += 'L'
route += 'U'

print(route)

### FIXED CODE ###

#C - Back and Forth
sx, sy, tx, ty = map(int,input().split())

route = ''

updown_num = ty - sy # 0>なら goalは上方向
rightleft_num = tx - sx #0>ならgoalは右方向

#route1
for i in range(updown_num):
    route += 'U'
for i in range(rightleft_num):
    route += 'R'
#route2
for i in range(updown_num):
    route += 'D'
for i in range(rightleft_num):
    route += 'L'
#route3
route += 'L'
for i in range(updown_num + 1):
    route += 'U'
for i in range(rightleft_num + 1):
    route += 'R'
route += 'D'
#route4
route += 'R'
for i in range(updown_num + 1):
    route += 'D'
for i in range(rightleft_num + 1):
    route += 'L'
route += 'U'

print(route)
from collections import defaultdict
from collections import Counter

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

fn = defaultdict(lambda: 1)
CD = [0]*K

par = list(range(N))

def root(x):
    if par[x] == x:
        return x
    y = root(par[x])
    par[x] = y
    return y

def unite(x,y):
    rx = root(x)
    ry = root(y)
    par[rx] = ry

def same(x,y):
    return root(x) == root(y)

for _ in range(M):
    A,B = map(int,input().split())
    A -= 1
    B -= 1
    fn[A] += 1
    fn[B] += 1
    unite(A,B)
    
for _ in range(K):
    C,D = map(int,input().split())
    C -= 1
    D -= 1
    CD[_] = (C,D)

par = [root(x) for x in range(N)]
c = Counter(par)

RESULT = [(c[par[x]] - fn[x]) for x in range(N)]

for C,D in CD:
    if par[C] == par[D]:
        RESULT[C] -= 1
        RESULT[D] -= 1

print(*RESULT,sep=" ")

### FIXED CODE ###

from collections import defaultdict
from collections import Counter

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

fn = defaultdict(lambda: 1)
CD = [0]*K

par = list(range(N))

def root(x):
    S = set()
    S.add(x)
    y = x
    while True:
        if par[y] == y:
            for s in S:
                par[s] = y
            return y
        S.add(y)
        y = par[y]

def unite(x,y):
    rx = root(x)
    ry = root(y)
    par[rx] = ry

for _ in range(M):
    A,B = map(int,input().split())
    A -= 1
    B -= 1
    fn[A] += 1
    fn[B] += 1
    unite(A,B)
    
for _ in range(K):
    C,D = map(int,input().split())
    C -= 1
    D -= 1
    CD[_] = (C,D)

par = [root(x) for x in range(N)]
c = Counter(par)

RESULT = [(c[par[x]] - fn[x]) for x in range(N)]

for C,D in CD:
    if par[C] == par[D]:
        RESULT[C] -= 1
        RESULT[D] -= 1

print(*RESULT,sep=" ")
import sys
input = sys.stdin.readline
n = int(input())
h = list(map(int,input().split()))
flag = 0
for i in range(n-2):
  if h[i] - h[i+2] >= 2:
    flag += 1
if h[-2]-h[-1] >= 2:
  flag += 1
if flag == 0:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

import sys
input = sys.stdin.readline
n = int(input())
h = list(map(int,input().split()))
flag = 0
for i in range(n-1,1,-1):
  if h[i] - h[i-1] == -1:
    h[i-1] -= 1
  elif h[i] - h[i-1] >= 0:
    continue
  else:
    flag += 1
if flag == 0:
  print("Yes")
else:
  print("No")
s=input()
ss=s.replace.("A","")
print("YES" if ss="KIHBR" and "AA" not in s and "KIH" in s else "NO")
  

### FIXED CODE ###

s=input()
ss=s.replace("A","")
print("YES" if ss=="KIHBR" and "AA" not in s and "KIH" in s else "NO")
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, b == e and c == f, 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)
S=input()

if S == "ABC":
  print(ARC)
else:
  print(ABC)

### FIXED CODE ###

S = input()

if S == "ABC":
  print("ARC")
else:
  print("ABC")
import sys

S = sys.stdin.readline().rstrip()
N = len(S)
not_x = []
x_cnt_idx = [0] * N
not_x_cnt_idx = [0] * N

for i, s in enumerate(S):
    if s != "x":
        not_x.append(s)
        not_x_cnt_idx[i] = not_x_cnt_idx[i - 1] + 1 if i > 0 else 1
    else:
        x_cnt_idx[i] = x_cnt_idx[i - 1] + 1 if i > 0 else 1

not_x_cnt = len(not_x)
x_cnt = N - not_x_cnt

if not_x_cnt == 0:
    ans = 0
    print(ans)
    exit()
elif not_x_cnt == 1:
    if N == 1:
        ans = 0
    else:
        x_left_cnt = x_cnt_idx[not_x_cnt_idx.index(1)]
        ans = abs(x_left_cnt - (x_cnt - x_left_cnt))
    print(ans)
    exit()

if not_x_cnt % 2 == 1:
    left = not_x[:not_x_cnt // 2]
    right = not_x[not_x_cnt // 2 + 1:][::-1]
else:
    left = not_x[:not_x_cnt // 2]
    right = not_x[not_x_cnt // 2:][::-1]

if left == right:
    if x_cnt == 0:
        ans = 0
    else:
        x_left_cnt = x_cnt_idx[not_x_cnt_idx.index(not_x_cnt // 2)]
        ans = abs(x_left_cnt - (x_cnt - x_left_cnt))
    print(ans)
else:
    print(-1)

### FIXED CODE ###

import sys

S = sys.stdin.readline().rstrip()
not_x = []

for i, s in enumerate(S):
    if s != "x":
        not_x.append(s)

not_x_nums = len(not_x)
mid = not_x_nums // 2

if not_x_nums % 2 == 1:
    left = not_x[:mid]
    right = not_x[mid + 1:][::-1]
else:
    left = not_x[:mid]
    right = not_x[mid:][::-1]

if left == right:
    ans = 0
    left = []
    right = []
    tmp = 0
    cnt = 0
    if not_x_nums % 2 == 1:
        mid += 1
    for s in S:
        if s != "x":
            left.append(tmp)
            tmp = 0
            cnt += 1
        else:
            tmp += 1
        if cnt == mid:
            break
    tmp = 0
    cnt = 0
    for s in S[::-1]:
        if s != "x":
            right.append(tmp)
            tmp = 0
            cnt += 1
        else:
            tmp += 1
        if cnt == mid:
            break
    for l, r in zip(left, right):
        ans += abs(l - r)
    print(ans)
else:
    print(-1)
a, b = int(input())

if (a < 10 and b < 10):
  ans = a * b
else:
  ans = -1

print(ans)


### FIXED CODE ###

a, b = (int(x) for x in input().split())

if (a < 10 and b < 10):
  ans = a * b
else:
  ans = -1

print(ans)
N,M = map(int,input().split())
a = [int(input()) for _ in range(M)]

dp = [0]*(N+1)
dp[0]=1
if 1 not in a:dp[1] = 1

for i in range(2,N+1):
  if i in a: continue
  dp[i] =dp[i-1]+dp[i-2]
  print(dp)
print(dp[-1])


### FIXED CODE ###

N,M = map(int,input().split())
a = set([int(input()) for _ in range(M)])
mod = 10**9+7
dp=[0]*(N+1)
dp[0]=1


for i in range(N):
  if i+1 not in a:
    dp[i+1]+=dp[i]
    dp[i+1] %= mod
  if i+2 <= N and i+2 not in a:
    dp[i+2]+=dp[i]
    dp[i+2]%=mod
  
print(dp[-1])
N = int(input())
a = list(map(int,input().split()))
one = 0
four = 0
two = 0
     
for j in range(N):
     
  if a[j]%2 == 1:
	one += 1
  elif a[j]%4 == 0:
	four += 1
  else :
	two +=1
     
      
if one <= four:
	print('Yes')
else :
	if two == 0:
if four >= (one+1):
	print('Yes')
else:
	print('No')

### FIXED CODE ###

N = int(input())
a = list(map(int,input().split()))
one = 0
four = 0
two = 0

for j in range(N):

  if a[j]%2 == 1:
    one += 1
  elif a[j]%4 == 0:
    four += 1
  else :
    two +=1

print("Yes" if four >= one or (four == one - 1 and two == 0) else "No")
import math
print(math.ceil(sum([int(i) for i in input.split()])/2))

### FIXED CODE ###

import math
print(math.ceil(sum([int(i) for i in input().split()])/2))
import sys
sys.setrecursionlimit(100000)

def visit_tree(now, num):
    visited[now] = num
    for i in range(len(tree[now])):
        if not visited[tree[now][i]]:
            visit_tree(tree[now][i], num)

n, m = map(int, input().split())
tree = [[] for _ in range(n)]
for i in range(m):
    x, y, z = map(int, input().split())
    tree[x - 1].append(y - 1)
    tree[y - 1].append(x - 1)

visited = [0 for _ in range(n)]
num = 0
for i in range(n):
    if not visited[i]:
        num += 1
        visit_tree(i, num)

print(num)

### FIXED CODE ###

import sys
sys.setrecursionlimit(10000000)

def visit_tree(now, num):
    visited[now] = num
    for i in range(len(tree[now])):
        if not visited[tree[now][i]]:
            visit_tree(tree[now][i], num)

n, m = map(int, input().split())
tree = [[] for _ in range(n)]
for i in range(m):
    x, y, z = map(int, input().split())
    tree[x - 1].append(y - 1)
    tree[y - 1].append(x - 1)

visited = [0 for _ in range(n)]
num = 0
for i in range(n):
    if not visited[i]:
        num += 1
        visit_tree(i, num)

print(num)
#-*-coding:utf-8-*-

def main():
    arry = list(map(int, input().split()))
    i = int(''.join(arry))
    if i % 4 == 0:
        print('YES')
    else:
        print('NO')

if __name__ == '__main__':
    main()

### FIXED CODE ###

#-*-coding:utf-8-*-

def main():
    arry = list(input().split())
    i = int(''.join(arry))
    if i % 4 == 0:
        print('YES')
    else:
        print('NO')

if __name__ == '__main__':
    main()
joukyuukokuminn=input().split(' ')[0]
simojimo=input().split(' ')[1]

while True:
  if(int(joukyuukokuminn)%int(simojimo)=0):
    break
  def(int(joukyuukokuminn)%int(simojimo))

def(a,b):
  if a>b:
    a=a-b
  elif a<b:
    b=b-a

### FIXED CODE ###

joukyuukokuminndomo=input().split(' ')
joukyuukokuminn2=int(joukyuukokuminndomo[0])
simojimo2=int(joukyuukokuminndomo[1])
joukyuukokuminn=joukyuukokuminn2
simojimo=simojimo2

while joukyuukokuminn%simojimo!=0:
  if joukyuukokuminn>simojimo:
    joukyuukokuminn=joukyuukokuminn-simojimo
  elif joukyuukokuminn<simojimo:
    simojimo=simojimo-joukyuukokuminn

if joukyuukokuminn>=simojimo:
  print(int(joukyuukokuminn2*simojimo2/simojimo))
elif joukyuukokuminn<simojimo:
  print(int(joukyuukokuminn2*simojimo2/joukyuukokuminn))
import sys

sys.setrecursionlimit(100000 + 2)

max_comb = None
max_value = 0


def memorize(c, value, memo):
    global max_comb
    global max_value

    memo[c] = value
    if max_value < memo[c]:
        max_value = memo[c]
        max_comb = c


def comb(a_i, a_j, memo):
    c = (a_i, a_j)
    # print(a_i, a_j)

    if c in memo:
        return memo[c]

    if a_j == 1:
        memorize(c, a_i, memo)
        return a_i

    if a_i == a_j or a_j == 0:
        memorize(c, 1, memo)
        return 1

    value = comb(a_i - 1, a_j, memo) + comb(a_i - 1, a_j - 1, memo)
    memorize(c, value, memo)
    return memo[c]


if __name__ == '__main__':
    n = int(input())
    a = list(map(int, input().split()))

    # n = 5
    # a = [6, 9, 4, 2, 11]
    a_sorted = sorted(a, reverse=True)

    memo = dict()
    for i in range(n - 1):
        for j in range(i + 1, n):
            comb(a_sorted[i], a_sorted[j], memo)

            # print("comb:", a_sorted[i], a_sorted[j])

    print(max_comb[0], max_comb[1])


### FIXED CODE ###

if __name__ == '__main__':
    n = int(input())
    a = list(map(int, input().split()))

    # n = 5
    # a = [6, 9, 4, 2, 11]

    max_a = max(a)
    max_half = max_a / 2

    best_a_j = a[0] if a[0] != max_a else a[1]
    min_d = max_half
    for a_j in a:
        if a_j == max_a:
            continue

        d = abs(a_j - max_half)
        if d < min_d:
            best_a_j = a_j
            min_d = d

    print(max_a, best_a_j)
import math

def make_plist(n):
	sqrt = int(math.sqrt(n))
	plist = [1]*(n/2+1)
	for i in range(2,int(math.sqrt(sqrt))+3):
		if plist[i]:
			plist[2*i::i] = [0 for x in range(2*i,sqrt+3,i)]
	return plist

def get_pfact(plist,n):
	pfact = []
	sqrt = int(math.sqrt(n))
	for i in range(2,sqrt+3):
		if plist[i] and n%i == 0:
			pfact.append(i)
			if plist[n/i]:
				pfact.append(i)
	else:
		if len(pfact) == 0: pfact.append(n)
	return pfact

def get_phai(n,pfacts):
	phai = n
	for pfact in pfacts:
		phai *= (1-1/float(pfact))
	return int(phai)

# main	
n = int(raw_input())
plist = make_plist(n)
pfacts = get_pfact(plist,n)
print get_phai(n,pfacts)

### FIXED CODE ###

def phi(n):
	r = n
	i = 2
	while i*i <= n:
		if n%i==0:
			r -= r/i
			while n%i==0:
				n /= i
		i += 1
	if n>1: r-= r/n
	return r

n = int(raw_input())
print phi(n)
import random

def calc(t, D, s):
  last = [0 for _ in range(26)]
  value = 0
  for i in range(D):
    day = i + 1
    value += s[i][t[i]-1]
    last[t[i]-1] = day
    for j in range(26):
      value -= c[j] * (day - last[j])
  return value

D = int(input())
c = list(map(int, input().split()))
s = [list(map(int, input().split())) for _ in range(D)]

t = random.sample(range(1, 27), k=D)

val = calc(t, D, s)
for _ in range(1000):
  d_rand = random.randrange(1, D+1)
  q_rand = random.randrange(1, 27)
  #old = t[d_rand-1]
  #t[d_rand-1] = q_rand
  if val > calc(t, D, s):
    continue
    #t[d_rand-1] = old
  else:
    val = calc(t, D, s)

for i in range(D):
  print(1)
  #print(t[i])

### FIXED CODE ###

D = int(input())
c = list(map(int, input().split()))
s = [list(map(int, input().split())) for _ in range(D)]

for i in range(D):
  print(s[i].index(max(s[i]))+1)
n = input()
n_max = -10**9
 
for i in range(0, n-1):
 R[i] = input()

n_min = R[0]

for i in range(0, n-1):
 if R[i] <= n_min:
  n_min = R[i]
 if max <= R[i] - n_min:
  n_max = R[i] - n_min
 
print n_max

### FIXED CODE ###

n = input()
n_max = -(10**9)
n_min = input() 

for i in range(0, n-1):
 R = input()
 if n_max < R - n_min:
  n_max = R - n_min
 if R < n_min:
  n_min = R
 
print n_max
n = int(input())

for x in range(1, 10**6+1):
    if x**2 >= n:
        y = x
        break

i, j = y, y
for x in range(10**5):
    if i*j == n:
        ans = i + j - 2
        break
    elif i*j > n:
        i -= 1
    elif i*j < n:
        j += 1

print(ans)

### FIXED CODE ###

import math

n = int(input())

ans  = 10 ** 12 
for i in range(1, math.floor(math.sqrt(n)) + 1):
    if n%i != 0:
        continue
    j = int(n/i)
    ans = min(ans, i+j-2)

print(ans)
s = input()
k = int(input())

for i in range(len(s)):
  if s[i] != '1':
    index = i
    break
if k-1 < index:
  print('1')
else:
  print(s[index])

### FIXED CODE ###

s = input()
k = int(input())

index = 0
for i in range(len(s)):
  if s[i] != '1':
    index = i
    break
if k-1 < index:
  print('1')
else:
  print(s[index])
A, B, K = map(int, input().split())
l = list(range(A, B+1))
print(*sorted(set(l[:K] + l[-K:])), sep='\n')


### FIXED CODE ###

A, B, K = map(int, input().split())
K = min(K, B - A + 1)
print(*sorted(set([i for i in range(A, A+K)] + [i for i in range(B-K+1, B+1)])), sep='\n')
x = int(input())

for i in range(x,0,-1):
  j = int(i**0.5)
  if i==j**2:
    print(i)
    exit()

### FIXED CODE ###

import math
from collections import deque
from collections import defaultdict

import time

#自作関数群
def readInt():
	return int(input())
def readInts():
	return list(map(int, input().split()))
def readChar():
	return input()
def readChars():
	return input().split()
def factorization(n):
	res = []
	if n%2==0:
		res.append(2)
	for i in range(3,math.floor(n//2)+1,2):
		if n%i==0:
			c = 0
			for j in res:
				if i%j==0:
					c=1
			if c==0:
				res.append(i)
	return res
def fact2(n):
	p = factorization(n)
	res = []
	for i in p:
		c=0
		z=n
		while 1:
			if z%i==0:
				c+=1
				z/=i
			else:
				break
		res.append([i,c])
	return res
def fact(n):#階乗
	ans = 1
	m=n
	for _i in range(n-1):
		ans*=m
		m-=1
	return ans
def comb(n,r):#コンビネーション
	if n<r:
		return 0
	l = min(r,n-r)
	m=n
	u=1
	for _i in range(l):
		u*=m
		m-=1
	return u//fact(l)
def combmod(n,r,mod):
	return (fact(n)/fact(n-r)*pow(fact(r),mod-2,mod))%mod
def printQueue(q):
	r=copyQueue(q)
	ans=[0]*r.qsize()
	for i in range(r.qsize()-1,-1,-1):
		ans[i] = r.get()
	print(ans)
class UnionFind():
	def __init__(self, n):
		self.n = n
		self.parents = [-1]*n

	def find(self, x): # root
		if self.parents[x]<0:
			return x
		else:
			self.parents[x] = self.find(self.parents[x])
			return self.parents[x]

	def union(self,x,y):
		x = self.find(x)
		y = self.find(y)

		if x==y:
			return

		if self.parents[x]>self.parents[y]:
			x,y = y,x

		self.parents[x]+=self.parents[y]
		self.parents[y]=x

	def size(self,x):
		return -1*self.parents[self.find(x)]

	def same(self,x,y):
		return self.find(x)==self.find(y)

	def members(self,x): # much time
		root = self.find(x)
		return [i for i in range(self.n) if self.find(i)==root]

	def roots(self):
		return [i for i,x in enumerate(self.parents) if x<0]

	def group_count(self):
		return len(self.roots())

	def all_group_members(self):
		return {r: self.members(r) for r in self.roots()} # 1~n
def bitArr(n):#ビット全探索
	x = 1
	zero = "0"*n
	ans = []
	ans.append([0]*n)
	for i in range(2**n-1):
		ans.append(list(map(lambda x:int(x),list((zero+bin(x)[2:])[-1*n:]))))
		x+=1
	return ans;
def arrsSum(a1,a2):
	for i in range(len(a1)):
		a1[i]+=a2[i]
	return a1
def maxValue(a,b,v):
	v2 = v
	for i in range(v2,-1,-1):
		for j in range(v2//a+1): #j:aの個数
			k = i-a*j
			if k%b==0:
				return i
	return -1
def copyQueue(q):
	nq = queue.Queue()
	n = q.qsize()
	for i in range(n):
		x = q.get()
		q.put(x)
		nq.put(x)
	return nq

a,b = readInts()

print(a*b)