Harryxun/stf_run huggingface dataset:
import numpy as np
A, B = map(int,input().split())
minA = math.floor(A/0.08)
maxA = math.ceil((A+1)/0.08) -1
minB = math.floor(B/0.08)
maxB = math.ceil((B+1)/0.08) -1
if (minA>maxB) or (minB>maxA):
    print(-1)
else:
    print(min(minA,minB))


### FIXED CODE ###

import math
A, B = map(int,input().split())
minA = math.ceil(A/0.08)
maxA = math.ceil((A+1)/0.08) -1
minB = math.ceil(B/0.1)
maxB = math.ceil((B+1)/0.1) -1

if (minA>maxB) or (minB>maxA):
    print(-1)
else:
    print(max(minA,minB))
n,a=open(0);print(eval(a.replace(" ","+")+"-"+n[:-1]))

### FIXED CODE ###

print(-int(input())+sum(map(int,input().split())))
import numpy as np
N, A, B = map(int,input().split())
h = []
for _ in range(N):
    h.append(int(input()))
 
def solve(n):
    H = np.array(h)
    H -= B * n
    cnt = 0
    for i in H:
        cnt += (i - 1) // (A - B) + 1
    return cnt <= n
 
left = 0
right = 10 ** 9
 
while left + 1 < right:
    mid = (left + right) // 2
    if solve(mid):
        right = mid
    else:
        left = mid
 
print(right)

### FIXED CODE ###

N, A, B = map(int,input().split())
h = []
for _ in range(N):
    h.append(int(input()))
 
def solve(n):
    cnt = 0
    for i in h:
        i -= B * n
        cnt += max((i - 1) // (A - B) + 1, 0)
    return cnt <= n
 
left = 0
right = 10 ** 9

while left + 1 < right:
    mid = (left + right) // 2
    if solve(mid):
        right = mid
    else:
        left = mid
 
print(right)
import numpy

s = input().split()
a, b, c = int(s[0]), int(s[1]), int(s[2])

k = max(float(a), float(b))
if float(a) + float(b) - float(c) + 2.0 * numpy.sqrt(a*k * b*k) / k < 0.0:
    print("Yes")
    # print("{} {} {}".format(numpy.sqrt(a), numpy.sqrt(b), numpy.sqrt(c)))
else:
    print("No")
    # print("{} {} {}".format(numpy.sqrt(a), numpy.sqrt(b), numpy.sqrt(c)))


### FIXED CODE ###

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

if 4*a*b - (c - a - b) ** 2 < 0 and c-a-b > 0:
    print("Yes")
    # print("{}, {}".format(4*a*b, (c - a - b) ** 2))
else:
    print("No")
    # print("{}, {}".format(4*a*b, (c - a - b) ** 2))
    # 249999999 250000000 999999998
S=input()
if S="Sunny":
 a="Cloudy"
elif S="Cloudy":
 a="Rainy"
else:
 a="Sunny"
print(a)

### FIXED CODE ###

S=input()
if S=="Sunny":
 a="Cloudy"
elif S=="Cloudy":
 a="Rainy"
else:
 a="Sunny"
print(a)
n = int(input())
a = [int(input()) for i in range(n)]

max_mergin = -20000000000
min_value = a[0]
for abc in range(1,a):
    max_mergin = max(max_mergin, a[abc] - min_value)
    min_value = min(min_value,  a[abc])
    
print(max_mergin)


### FIXED CODE ###

n = int(input())
R = [int(input()) for i in range(n)]

minv = R[0]
maxv = R[1] - R[0]
for j in range(1, n):
	if (maxv < R[j] - minv):
		maxv = R[j] - minv
	if (R[j] < minv):
		minv = R[j]
    
print(maxv)
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")
  else:
    print('No')

### FIXED CODE ###

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

print((n-1)*(m-1))
a, b = input().strip().Split()
print(int(a)/int(b))

### FIXED CODE ###

a, b = input().strip().split()
print(int(a)/int(b))
L,R=map(int,input().split())
R=min(R, L+673)
li=[]
for i in range(L,R):
  for j in range(i+1,R+1):
      mod=(i*j)%2019
      li.append(mod)
      if mod==0:
        break
print(min(li))


### FIXED CODE ###

n,a,b=map(int,input().split())
print(min(n*a,b))
n,t = map(int,input().split())
ab = [list(map(int,input().split())) for _ in range(n)]
sorted(ab)
dp = [[-1 for i in range(t)] for j in range(n+1)]

def dfs(i,j):
    if dp[i][j] >= 0:
        return dp[i][j]
      
    if i == n:
        res = 0
    elif j == 0:
        res = 0
    elif ab[i][0] >= j:
        res = max(ab[i][1],dfs(i+1,j))
    elif ab[i][0] < j:
        res = max(dfs(i+1,j),dfs(i+1,j-ab[i][0])+ab[i][1])
    dp[i][j] = res
    return res

print(dfs(0,t-1))

### FIXED CODE ###

n, t = map(int, input().split())
 
ab = [list(map(int, input().split())) for _ in range(n)]
ab.sort()
 
a = []
b = []
for ai, bi in ab:
    a.append(ai)
    b.append(bi)
 
dp = [[0 for j in range(t+1)] for i in range(n+1)]
 
for i in range(n):
    for j in range(t):
        if j + a[i] <= t-1:
            if dp[i+1][j + a[i]] < dp[i][j] + b[i]:
                dp[i+1][j + a[i]] = dp[i][j] + b[i]
        if dp[i+1][j] < dp[i][j]:
            dp[i+1][j] = dp[i][j]
 
ans = 0
 
for i in range(n):
    ans = max(ans, dp[i][t-1] + b[i])
 
print(ans)
N, K = map(int,input().split())
S = list(input())

mxl = []
if S == ['1']:
  mxl.append(1)
Sl = []
c = 0
if S[0] == "0":
  Sl.append(0)
for i in range(N-1):
  c += 1
  if S[i] != S[i+1]:
    Sl.append(c)
    c = 0
if S[N-1] == "0":
  c += 1
  Sl.append(c)
  Sl.append(0)
else:
  c += 1
  Sl.append(c)

Kl = K*2+1

for i in range(0,len(Sl)+1-Kl,2):
  mxl.append(sum(Sl[i:Kl+i]))

print(max(mxl))

### FIXED CODE ###

N, K = map(int,input().split())
S = list(input())

mxl = []
Sl = []
c = 0
if S[0] == "0":
  Sl.append(0)
for i in range(N-1):
  c += 1
  if S[i] != S[i+1]:
    Sl.append(c)
    c = 0
if S[N-1] == "0":
  c += 1
  Sl.append(c)
  Sl.append(0)
else:
  c += 1
  Sl.append(c)

Kl = K*2+1

Ru = [0 for i in range(len(Sl)+1)]

if len(Sl) ==1:
  mxl.append(Sl[0])
else:
  for i in range(1,len(Sl)+1):
    Ru[i] = Ru[i-1]+Sl[i-1] 
  mxl.append(Ru[min(Kl,len(Ru)-1)])
  
for i in range(2,min(len(Sl)+1-Kl,len(Ru)-1),2):
  mxl.append(Ru[Kl+i]-Ru[i])

print(max(mxl))
ans = "Christmas"
for i in range(25-D):
    ans += " Eve"
print(ans)

### FIXED CODE ###

D = int(input())
ans = "Christmas"
for i in range(25-D):
    ans += " Eve"
print(ans)
import numpy as np

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

counter = np.bincount(A)

diff = (counter * (counter-1)//2 - (counter-1) * (counter-2)//2)
ans = total - diff[A]

print(*ans, sep="\n")

### FIXED CODE ###

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
 
import numpy as np
 
N = int(readline())
A = np.array(read().split(), np.int64)
counter = np.bincount(A)
 
total = (counter * (counter - 1)).sum() // 2
answer = (total - (counter - 1))[A]
 
print('\n'.join(answer.astype(str)))
N, L = map(int, input().split())

apple = []
zerochk = False
tastes = 0
for i in range(N):
    taste = L + i
    apple.append(taste)
    tastes += taste
    if taste == 0: zerochk = True

ans = 0
minval = 100

if zerochk:

    print('{}'.format(tastes))

else if L > 0:

    for i in range(1, len(tastes)):
        ans += tastes(i)
    
    print('{}'.format(ans))

else: # L < 0

    for i in range(1, len(tastes)):
        minval = min(minval, abs(tastes[i]))
        ans += tastes(i)

    print('{}'.format(ans) - minval)






### FIXED CODE ###

N, L = map(int, input().split())

apples = []
zerochk = False
taste_sum = 0
for i in range(N):
    taste = L + i
    apples.append(taste)
    taste_sum += taste
    if taste == 0: zerochk = True


minval = 100

if zerochk:

    print('{}'.format(taste_sum))

elif L > 0:

    print('{}'.format(taste_sum - apples[0]))

else: # zerochk == True and L < 0

    for i in range(1, len(apples)):
        minval = min(minval, abs(apples[i]))

    ans = 0
    if taste_sum < 0:
        ans = abs(taste_sum) - abs(minval)
        ans *= -1
    else: # taste_sum >= 0
        ans = taste_sum - abs(minval)
    print('{}'.format(ans))
N, M = map(int, input().split())
a = [int(input()) for _ in range(M)]
a = set(a)
mod = 1000000007
dp = [0]*(N+1)
dp[0] = 1
if a[0] != 1:
    dp[1] = 1
for i in range(2, N+1):
    if i not in a:
        dp[i] = (dp[i-1]+dp[i-2])%mod
print (dp[N])

### FIXED CODE ###

N, M = map(int, input().split())
a = [int(input()) for _ in range(M)]
a = set(a)
mod = 1000000007
dp = [0]*(N+1)
dp[0] = 1
for i in range(1, N+1):
    if i not in a:
        if i == 1:
            dp[i] = dp[i-1]
        else:
            dp[i] = (dp[i-1]+dp[i-2])%mod
print (dp[N])
import heapq
n,m=map(int,input().split())
ab=[]
for i in range(m+1):
    ab.append([])
for i in range(n):
    a,b=map(int,input().split())
    ab[a].append(-b)
h = []
s=0
for i in range(1,m+1):
    for v in ab[i]:
        heapq.heappush(h,v)
    if h:
        s+=-1*heapq.heappop(h)
print(s)

### FIXED CODE ###

import heapq
n,m=map(int,input().split())
ab=[]
for i in range(m+1):
    ab.append([])
for i in range(n):
    a,b=map(int,input().split())
    if a<=m:
        ab[a].append(b)
h = []
s=0
for i in range(1,m+1):
    for v in ab[i]:
        heapq.heappush(h,-1*v)
    if len(h)>0:
        s+=-1*heapq.heappop(h)
print(s)
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

from fractions import gcd

def readln():
    _res = list(map(int,str(input()).split(' ')))
    return _res

def calc(x,line):
    if line == 0:
        for l in v[x]:
            if e[l][0] == x: son = e[l][1]
            else: son = e[l][0]
            if a[son-1] < a[x-1] and calc(son,l) == -1:
                return 1
        return -1
    else:
        if e[line][0] == x: y = 0
        else: y = 1
        if f[x][y] != 0: return f[x][y]
        if len(v[x]) == 1:
            f[x][y] = -1
            return -1
        for l in v[x]:
            if l != line:
                if e[l][0] == x: son = e[l][1]
                else: son = e[l][0]
                if a[son-1] < a[x-1] and calc(son,l) == -1:
                    f[x][y] = 1
                    return 1
        f[x][y] = -1
        return -1

n = int(input())
v = [set([]) for i in range(0,n+1)]
e = [0 for i in range(0,n)]
a = readln()
for i in range(1,n):
    s = readln()
    v[s[0]].add(i)
    v[s[1]].add(i)
    e[i] = s

f = [[0,0] for i in range(0,n)]
ans = []
for i in range(1,n+1):
    if calc(i,0) == 1:
        ans.append(i)
ans = list(map(str,ans))
print(' '.join(ans))


### FIXED CODE ###

#!/usr/bin/env python3
# -*- coding: utf-8 -*-

from fractions import gcd

def readln():
    _res = list(map(int,str(input()).split(' ')))
    return _res

def calc(x,line):
    if line == 0:
        for l in v[x]:
            if e[l][0] == x: son = e[l][1]
            else: son = e[l][0]
            if a[son-1] < a[x-1] and calc(son,l) == -1:
                return 1
        return -1
    else:
        if e[line][0] == x: y = 0
        else: y = 1
        if f[line][y] != 0: return f[line][y]
        for l in v[x]:
            if l != line:
                if e[l][0] == x: son = e[l][1]
                else: son = e[l][0]
                if a[son-1] < a[x-1] and calc(son,l) == -1:
                    f[line][y] = 1
                    return 1
        f[line][y] = -1
        return -1

n = int(input())
v = [set([]) for i in range(0,n+1)]
e = [0 for i in range(0,n)]
a = readln()
for i in range(1,n):
    s = readln()
    v[s[0]].add(i)
    v[s[1]].add(i)
    e[i] = s

f = [[0,0] for i in range(0,n)]
ans = []
for i in range(1,n+1):
    if calc(i,0) == 1:
        ans.append(i)
ans = list(map(str,ans))
print(' '.join(ans))
N = int(input())
A = list(map(int, input().split()))
A.sort()
B = [0] * (2 * 10 ** 5 + 1)
M = max(A)

for a in A:
	B[a] += 1

if max(B) == N:
	print(0)
else:
	for a in A:
		if B[a] > 0:
			i = 2
			b = a * i
			while b <= M:
				B[b] = 0
				i += 1
				b = a * i
	for b in B:
		if B[b] > 1:
			B[b] = 0
	print(sum(B))

### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
A.sort()
M = max(A)
B = [0] * (M + 1)

for a in A:
    B[a] += 1

for a in A:
    if B[a] > 0:
        i = 2
        b = a * i
        while b <= M:
            B[b] = 0
            i += 1
            b = a * i
for i in range(M + 1):
    if B[i] > 1:
        B[i] = 0
print(sum(B))
n = int(input())
A = list(map(int, input().strip().split()))
count = 0
for i in range(1,N):
  if A[i]!=max(A[i-1],A[i],A[i+1]) and A[i]!=min(A[i-1],A[i],A[i+1]):
    count += 1
  else:
    count += 0
print(count)
  

### FIXED CODE ###

n = int(input())
A = list(map(int, input().strip().split()))
count = 0
for i in range(1,n-1):
  if A[i]!=max(A[i-1],A[i],A[i+1]) and A[i]!=min(A[i-1],A[i],A[i+1]):
    count += 1
  else:
    count += 0
print(count)
n = int(input())
s = [i for i in range(1,n+1)]
counter = 0
while(True):
    if len([i for i in s if i % 2 == 0])==1:
        s = [i for i in s if i % 2 == 0]
        print(int(s[-1] * (2 ** counter)))
        break
    else:
        s = [i/2 for i in s]
        counter += 1


### FIXED CODE ###

n = int(input())
s = [i for i in range(1,n+1)]
counter = 0
while(True):
    if len(s)==1:
        print(1)
        break
    if len([i for i in s if i % 2 == 0])==1:
        s = [i for i in s if i % 2 == 0]
        print(int(s[0]) * (2 ** counter))
        break
    else:
        s = [i/2 for i in s]
        counter += 1
N=int(input())
S = input()
flag=0
for i in range(N-2):
  a = ""
  a = S[i] + S[i+1] + S[i+2]
  if a == "ABC":
    flag += 1
print(flag)
   

### FIXED CODE ###

a = list(map(int,input().split()))
A = a[0]
B = a[1]
K = a[2]
taka = A
aoki = B
if K < A:
    aoki = B
    taka = A - K
elif K>=(A+B):
    taka = 0
    aoki = 0
else:
    #A<=K<(A+B)
    taka = 0
    b = K - A
    aoki = B - b
print(str(taka)+" "+str(aoki))
import sys
import itertools

num = int(input())
S = []
for _ in range(num):
    S.append(input())

result = False
for i in itertools.permutations(S):
    checkedArray = list(''.join(i))
    if checkedArray[0] == ")": continue

    cost = 0
    for index, item in enumerate(checkedArray):
        if item == "(": cost += 1
        else: cost -= 1

        if cost < 0: break
        if cost == 0 and index == len(checkedArray) - 1:
            result = True
            break

    if result == True: break

print("Yes" if result == True else "No")

### FIXED CODE ###

oldID = input()
newID = input()

print("Yes" if oldID + newID[-1] == newID else "No")
h, n = map(int, input().split())
ab = [list(map(int, input().split())) for i in range(n)]

# 最強の魔法の特定
a_max = max(a for a, b in ab)
# 動的計画法用の配列の定義及び初期化
dp = [0]*(h + a_max)

for i in range(h + a_max):
  if i > 0:
	dp[i] = min(dp[i - a] + b for a, b in ab)

print(min(dp[h:]))

### FIXED CODE ###

n,m=map(int, input().split())
s=[list(map(int, input().split())) for i in range(m)]
x=max(a for a,b in s)
dp=[0]*(n+x)
for i in range(0,n+x):
  if i>0:
    dp[i]=min(dp[i-a]+b for a,b in s)
print(min(dp[n:]))
def d_snuke_numbers(K):
    candidate = []
    for k in range(15):
        for l in range(1, 10):
            candidate.append(str(l)+str(9)*k)
    ans = []
    for k in range(K):
        ans.append(candidate[k])
    ans = '\n'.join(ans)
    return ans

K = int(input())
print(d_snuke_numbers(K))

### FIXED CODE ###

def d_snuke_numbers(K):
    import math

    def ns(n):  # n/S(n)の計算
        return n / sum(map(int, list(str(n))))

    def f(n):  # n<=xの中で ns(x) を最小にするような最小の値xを求める
        digit = len(str(n))
        # n自身も候補の1つである
        min_ns = ns(n)
        ret = n
        for d in range(digit + 1):
            x = (10**(d+1)) * math.floor(n / (10**(d+1)) + 1) - 1
            s = ns(x)
            if min_ns > s:
                min_ns = s
                ret = x
        return ret

    n = 0
    candidate = []
    for _ in range(K):
        n = f(n + 1)
        candidate.append(n)
    ans = '\n'.join(map(str, candidate))
    return ans

K = int(input())
print(d_snuke_numbers(K))
n = int(input())
l = list(map(int, input().split()))
l = list(set(l))
n = len(l)

from itertools import combinations
a = list(combinations(l, n-1))
#print(a)

from fractions import gcd
from functools import reduce

def gcd_list(numbers):
    return reduce(gcd, numbers)

g = []
for i in range(len(a)):
    g.append(gcd_list(a[i]))

print(max(g))

### FIXED CODE ###

n = int(input())
l = list(map(int, input().split()))
#print(l)
l2 = list(reversed(l))
#print(l2)
#from itertools import combinations
#a = list(combinations(l, n-1))
#print(a)
from fractions import gcd
L, R = [0], [0]
for i in range(n):
    L.append(gcd(L[i],l[i]))
    R.append(gcd(R[i],l2[i]))
#print(L)
R = list(reversed(R))
#print(R)
g = []
for j in range(n):
    g.append(gcd(L[j],R[j+1]))
print(max(g))


#from functools import reduce

#def gcd_list(numbers):
#    return reduce(gcd, numbers)
N,Q = [int(i) for i in input().split()]
S = str(input())
lrlist = []
for i in range(Q):
    lrlist.append([int(i)-1 for i in input().split()])

#print(S)
#print(lrlist)

Asite = []
for i in range(len(S)):
    if S[i]=="A" and S[i+1]=="C":
        Asite.append(i)


for l,r in lrlist:
    ans = 0
    for i in Asite:
        if l <= i and i+1 <= r:
            ans+=1
    print(ans)

### FIXED CODE ###

N,Q = [int(i) for i in input().split()]
S = str(input())
lrlist = []
for i in range(Q):
    lrlist.append([int(i)-1 for i in input().split()])

#print(S)
#print(lrlist)

Asite = [0]
for i in range(1,len(S)):
    if S[i-1]=="A" and S[i]=="C":
        Asite.append(Asite[-1]+1)
    else:
        Asite.append(Asite[-1])


for l,r in lrlist:
    print(Asite[r]-Asite[l])
print(48-int(input().split())

### FIXED CODE ###

a=int(input())
print(48-a)
N = int(input())
A = list(map(int,input().split()))
Q = int(input())
BC = [list(map(int,input().split())) for i in range(Q)]
B, C = [list(i) for i in zip(*BC)]
#print(B,C,BC)

dic = {}
for a in A:
  dic[a] = dic.get(a,0) + 1
#print(dic)

ans = sum(A)
for q in range(Q):
  ans = ans + (C[q]-B[q]) * dic.get(B[q],0)
  dic[C[q]] = dic.get(B[q],0) + dic.get(C[q],0)
  del dic[B[q]]
  print(ans)



### FIXED CODE ###

N = int(input())
A = list(map(int,input().split()))
Q = int(input())
BC = [list(map(int,input().split())) for i in range(Q)]
B, C = [list(i) for i in zip(*BC)]
#print(B,C,BC)

dic = {}
for a in A:
  dic[a] = dic.get(a,0) + 1
#print(dic)

ans = sum(A)
for q in range(Q):
  ans = ans + (C[q]-B[q]) * dic.get(B[q],0)
  dic[C[q]] = dic.get(B[q],0) + dic.get(C[q],0)
  dic[B[q]] = 0
  print(ans)
s,w = map(int,input().split())
if s <= w:
    print(unsafe)
else:
    print(safe)


### FIXED CODE ###

s,w = map(int,input().split())
if s <= w:
    print("unsafe")
else:
    print("safe")
l=input().split()
print(min(l), max(l), sum(l))



### FIXED CODE ###


input()
l=list([int(i) for i in input().split()])
print(min(l), max(l), sum(l))
h, w = map(int, input().split())
mapping = [0]*h
for i in range(h):
  mapping[i] = [int(x)%2 for x in input().split()]

ans = []
side = [0]*h
key = 0
for i in range(h):
  k = 0
  for j in range(w-1):
    if mapping[i][j]:
      if k == 0:
        k = 1
        ans.append([i+1, j+1, i+1, j+2])
      else:
        k = 0
    else:
      if k == 1:
        ans.append([i+1, j+1, i+1, j+2])
      else:
        continue
  if (k == 1 and not mapping[i][w-1]) or (k == 0 and mapping[i][w-1]):
    side[i] = 1
    key += 1
      
k = 0
key //= 2
for i in range(h-1):
  if mapping[i][j]:
    if k == 0:
      k = 1
      ans.append([i+1, w, i+2, w])
    else:
      k = 0
  else:
    if k == 1:
      ans.append([i+1, w, i+2, w])
      key -= 1
    else:
      continue 
  if not key:
    break

print(len(ans))
for i in range(len(ans)):
  print(*ans[i])

### FIXED CODE ###

h, w = map(int, input().split())
a = [0]*h
for i in range(h):
  a[i] = [int(x)%2 for x in input().split()]

ans = 0
ans_list = []
key = 0
for i in range(h):
  if i%2 == 0:
    for j in range(w):
      p = a[i][j]
      if key == 0:
        if p == 0:
          pass
        else:
          key = 1
      else:
        if p == 0:
          key = 1
          ans += 1
          if j == 0:
            ans_list.append([i, j+1, i+1, j+1])
          else:
            ans_list.append([i+1, j, i+1, j+1])
        else:
          key = 0
          ans += 1
          if j == 0:
            ans_list.append([i, j+1, i+1, j+1])
          else:
            ans_list.append([i+1, j, i+1, j+1])
        
      
  else:
    for j in range(w-1, -1, -1):
      p = a[i][j]
      if key == 0:
        if p == 0:
          pass
        else:
          key = 1
      else:
        if p == 0:
          key = 1
          ans += 1
          if j == w-1:
            ans_list.append([i, j+1, i+1, j+1])
          else:
            ans_list.append([i+1, j+2, i+1, j+1])
        else:
          key = 0
          ans += 1
          if j == w-1:
            ans_list.append([i, j+1, i+1, j+1])
          else:
            ans_list.append([i+1, j+2, i+1, j+1])

print(ans)
for i in range(ans):
  print(*ans_list[i])
ans = 0
if int(str(S)[0]) == 1 and K == 1:
    ans = 1
elif int(str(S)[0]) != 1:
    ans = int(str(S)[0])
else:
    ans = int(str(S)[1])
print(ans)

### FIXED CODE ###

S = int(input())
K = int(input())

for i in range(len(str(S))):
    if int(str(S)[i]) == 1:
        if (K-1) == i:
            print(int(str(S)[i]))
            break
        continue
    else:
        print(int(str(S)[i]))
        break
a = raw_input()
b = raw_input()

print(''.join([x+y for x,y in zip(a,b)]) + (
  a[-1] if len(a) > len(b) else b[-1] if len(b) > len(a) else ''
))


### FIXED CODE ###

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

if a - b == b - c:
  print 'YES'
else:
  print 'NO'
import math
while True:
	nums = raw_input()
	if nums != '':
		x = map(int,nums.split(' '))
		a =int(math.log10(x[0] + x[1]) + 1)
		print a
		continue
	else:
		break

### FIXED CODE ###

while True:
	try:
		a,b = map(int,raw_input().split(' '))
		print len(str(a+b))
	except: break
NumberOfSheet = int(input())
OwnedCards = [[str(i) for i in input().split()] for loop in range(NumberOfSheet)]
S = [int(0) for i in range(13)]
H = [int(0) for i in range(13)]
C = [int(0) for i in range(13)]
D = [int(0) for i in range(13)]
for i in OwnedCards:
  if i[0] == 'S' or i[0] == 'H' or i[0] == 'C' or i[0] == 'D':
    if i[0] == 'S': S[int(i[1]) - 1] = 1
    if i[0] == 'H': H[int(i[1]) - 1] = 1
    if i[0] == 'C': C[int(i[1]) - 1] = 1
    if i[0] == 'D': D[int(i[1]) - 1] = 1

for i in range(13): if S[i] == 0: print('S',i + 1)
for i in range(13): if H[i] == 0: print('H',i + 1)
for i in range(13): if C[i] == 0: print('C',i + 1)
for i in range(13): if D[i] == 0: print('D',i + 1)

### FIXED CODE ###

NumberOfSheet = int(input())
OwnedCards = [[str(i) for i in input().split()] for loop in range(NumberOfSheet)]
S = [int(0) for i in range(13)]
H = [int(0) for i in range(13)]
C = [int(0) for i in range(13)]
D = [int(0) for i in range(13)]
for i in OwnedCards:
  if i[0] == 'S' or i[0] == 'H' or i[0] == 'C' or i[0] == 'D':
    if i[0] == 'S': S[int(i[1]) - 1] = 1
    if i[0] == 'H': H[int(i[1]) - 1] = 1
    if i[0] == 'C': C[int(i[1]) - 1] = 1
    if i[0] == 'D': D[int(i[1]) - 1] = 1

for i in range(13):
  if S[i] == 0: print('S',i + 1)
for i in range(13):
  if H[i] == 0: print('H',i + 1)
for i in range(13):
  if C[i] == 0: print('C',i + 1)
for i in range(13):
  if D[i] == 0: print('D',i + 1)
s = input()
ans = []
dp = [""]*(len(s))
if s[0] != "B":
    dp[0] = s[0]
else:
    dp[0] = [""]

for i in range(len(s)-1):
    if s[i+1] != "B":
        dp[i+1] = dp[i] + s[i+1]
    else:
        dp[i+1] = dp[i][:len(dp[i])-1]
print(dp[len(s)-1])

### FIXED CODE ###

s = input()
ans = []
dp = [""]*(len(s))
if s[0] != "B":
    dp[0] = s[0]
else:
    dp[0] = ""

for i in range(len(s)-1):
    if s[i+1] != "B":
        dp[i+1] = dp[i] + s[i+1]
    else:
        dp[i+1] = dp[i][:len(dp[i])-1]
print(dp[len(s)-1])