peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Wrong Answer
# import statistics # Pythonのみ
# import string
import sys
sys.setrecursionlimit(10 ** 5 + 10)
def input(): return sys.stdin.readline().strip()

def resolve():
    
    n=int(input())
    alp=list(chr(ord('a')+i) for i in range(26))
    ans=[]
    
    while n>0:
        a,b=divmod(n,26)
        n//=26
        ans.append(alp[b])
    ans2=''
    for i in ans[::-1]:
        ans2+=chr(ord(i)-1)
    
    print(ans2.replace('a`','z'))
        

    
resolve()
# Judge status: Wrong Answer
# D - Powerful Discount Tickets

import heapq

N, M = map(int, input().split())
A = [int(a) * -1 for a in input().split()]
heapq.heapify(A)

for i in range(M):
    price = heapq.heappop(A) // 2
    heapq.heappush(A, price)

print(sum(A) * -1)
# Judge status: Accepted
#!/usr/bin/env python3
a, b = map(int, input().split())
c = 0
for i in range(a, b + 1):
    if str(i) == str(i)[::-1]:
        c += 1
print(c)
# Judge status: Wrong Answer
n, m = map(int, input().split())

if n <= 2 and m <= 2:
    print(0)
else:
    n -= 2
    m -= 2
    if n <= 0:
        n = 1
    if m <= 0:
        m = 1
    print(n*m)
# Judge status: Accepted
A,B = map(int,input().split())

if A <= 9 and B <= 9:
    print(A * B)
else:
    print(-1)
# Judge status: Wrong Answer
n = int(input())
if n % 2 == 1:
  print("0")
else:
    m = int(n/2)
    count = 0
    i = 1
    while m >= 5 ** i:
      count += (m // (5 ** i))
      i += 1
    print(int(count))
# Judge status: Accepted
N=int(input())
txy=[list(map(int,input().split()))for _ in range(N)]

ans='Yes'
now=[0,0,0]
for t,x,y in txy:
    distance=abs(x-now[1])+abs(y-now[2])
    if distance>t-now[0] or (distance+(t-now[0]))%2>0:
        ans='No'
        break
    else:
        now=[t,x,y]

print(ans)
# Judge status: Accepted
import heapq
N, M = map(int, input().split())
value = [[] for _ in range(10 ** 5 + 1)]

for _ in range(N):
    a, b = map(int, input().split())
    value[a].append(-1 * b)

koho = value[1]
heapq.heapify(koho)

ans = 0
for i in range(1, M + 1):
    if len(koho) > 0:
        ans += -1 * heapq.heappop(koho)
    if i < M:
        for v in value[i + 1]:
            heapq.heappush(koho, v)

print(ans)
# Judge status: Wrong Answer
n, m = map(int, input().split())
l = [list(map(int, input().split())) for i in range(n)]
ll = sorted(l)
count, total, i = 0, 0, 0
while count < m:
    count += ll[i][1]
    total += ll[i][0]*ll[i][1]
    i += 1
if i == n:
    total += ll[i-1][0]*(m-count)
    print(total)
    exit()
total += ll[i][0]*(m-count)
print(total)
# Judge status: Accepted
import math
from decimal import *
X, Y = [int(x) for x in input().split()]
X = Decimal(str(X))
Y = Decimal(str(Y))
i = 1
cnt = 0
while True:
    if i > Decimal(Y/X):
        break
    i *= 2
    cnt += 1
print(cnt)
# Judge status: Wrong Answer
n=int(input())
a=list(map(int,input().split()))
mod=10**9+7
ans=0
for i in range(60):
  x=1<<(i+1)
  z=o=0
  for j in range(n):
    if a[j]&x:o+=1
    else:z+=1
  ans=(ans+((x%mod)*o*z)%mod)%mod
print(ans)
# Judge status: Accepted
N=int(input())
W=list(map(int,input().split()))
min=-1
for T in range(N):
	S1=0
	for i in range(T):
		S1=S1+W[i]
	S2=sum(W)-S1
	temp=abs(S2-S1)
	if(min==-1):
		min=temp
	elif(temp<min):
		min=temp
print(min)
# Judge status: Wrong Answer
S = input()
arr =['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT']
print(arr[arr.index(S)])
# Judge status: Accepted
x = int(input())
n = x//500
x -= 500*n
m = x//5
print(1000*n+5*m)
# Judge status: Accepted
from collections import Counter
def solve():
  N = int(input())
  A = list(map(int, input().split()))
  c = Counter(A)
  B = [k for k,v in c.items() if v>=2]
  C = [k for k,v in c.items() if v>=4]
  B.extend(C)
  B.sort(reverse=True)
  if len(B)<2:
    return 0
  ans = B[0]*B[1]
  return ans
print(solve())
# Judge status: Wrong Answer
n, m = map(int, input().split())
l=list(map(int, input().split()))
ans= n-sum(l)
if ans>0:
  print(ans)
else:
  print(-1)
# Judge status: Accepted
a, b, c = map(int, input().split())
ma = max(a, b, c)
rem = a + b + c - ma
if ma == rem:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
ans = 0

if n<3:
    print(0)
    exit()

for i in range(n):
    for j in range(i+1, n):
        for k in range(j+1, n):
            if a[i]==a[j] or a[j]==a[k] or a[k]==a[i]:
                continue
            if a[i]+a[j]<=a[k] or a[j]+a[k]<=a[i] or a[k]+a[i]<=a[j]:
                continue
            ans += 1

print(ans)
# Judge status: Accepted
import heapq

N,M = (int(x) for x in input().split())
A = []

A = list((-1)*(int(x)) for x in input().split())
heapq.heapify(A)

sum = 0

while M != 0:
    heapq.heappush(A,int(heapq.heappop(A)/2))
    M -= 1

for i in range(len(A)):
    sum += -A[i]

print(sum)
# Judge status: Accepted
x = input()
y = 0
for i in x:
    y += int(i)
print(y)
# Judge status: Accepted
n = int(input())

a = [int(input())for i in range(n)]
s = sum(a)

if s%10 != 0:
  print(s)
else :
  f = [i for i in a if i%10 != 0]
  if len(f) == 0:
    print(0)   
  else:
    f.sort()
    print(s -f[0])
# Judge status: Accepted
N=int(input())
A=[int(input()) for _ in range(N)]
B=sorted(A,reverse=True)

for i in range(N):
  if A[i]==B[0]:
    print(B[1])
  else:
    print(B[0])
# Judge status: Accepted
import math

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

taka = math.ceil(a/d)
ao = math.ceil(c/b)

if taka >= ao:
	print('Yes')
else:
	print('No')
# Judge status: Accepted
a, b, c = map(str, input().split())
print(a[0] + b[0] + c[0])
# Judge status: Accepted
s = input()
for i in s:
    if s.count(i) != 2:
        print('No')
        exit()
print('Yes')
# Judge status: Accepted
import sys
input = sys.stdin.readline
def main():
    N = list(input().rstrip())
    l = len(N)-1
    n = int(N[l])
    if n == 3:
        print('bon')
    elif n == 0 or n == 1 or n == 6 or n == 8:
        print('pon')
    else:
        print('hon')

if __name__ == '__main__':
    main()
# Judge status: Accepted
n = int(input())

l = [input() for _ in range(n)]
print(len(set(l)))
# Judge status: Accepted
s = input()
t = input()

ans = []
for i in range(len(s)-(len(t)-1)):
    f = True
    for j in range(len(t)):
        if s[j+i] != t[j] and s[j+i] != '?':
            f = False
    if f == True:
        s2 = s[:i] + t + s[i+len(t):]
        s2 = s2.replace('?','a')
        ans.append(s2)



if len(ans) > 0:
    print(min(ans))
else:
    print('UNRESTORABLE')
# Judge status: Accepted
n = int(input())
a = []
b = []
for i in range(n):
  x, y = map(int, input().split())
  a.append(x)
  b.append(y)
ans = 0
a = a[::-1]
b = b[::-1]
for i in range(n):
  if (a[i] + ans) % b[i] == 0:
    next
  else:
    ans += b[i] - ((a[i]+ ans) % b[i])
print(ans)
# Judge status: Accepted
N = int(input())
A = list(map(int,input().split()))
bunretsu = sum(A) - 1
zanretsu = 1
souwa = 0
for i in range(N+1):
    souwa += zanretsu
    if A[i] <= zanretsu:
        zanretsu -= A[i]
    else:
        souwa = -1
        break
    if bunretsu >= 1 and bunretsu <= zanretsu:
        zanretsu += bunretsu
        bunretsu = 0
    elif bunretsu >= 1 and bunretsu > zanretsu:
        bunretsu -= zanretsu
        zanretsu *= 2
print(souwa)
# Judge status: Accepted
a = int(input())

print(a+a*a+a*a*a)
# Judge status: Wrong Answer
n = list(input())
m=0
for i in range(1, len(n)):
    m+=i
if m%9==0:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
x,y = map(int,input().split())
mod = 10**9+7
s = 0
mx = 10**6
fact = [1]*(mx+1)
for i in range(mx):
  fact[i+1] = fact[i]*(i+1)%mod
def inv(n):
  return pow(n,mod-2,mod)
if (x%3==0 and y%3==0) or (x%3==1 and y%3==2) or (x%3==2 and y%3==1):
  n = int(2*x/3-y/3)
  m = int(-x/3 + 2*y/3)
  s += fact[n+m]*inv(fact[n])*inv(fact[m])%mod
  print(s)
else:
  print(0)
# Judge status: Accepted
a,b=input().split()
c = str(a)*int(b)
d = str(b)*int(a)
if a<b:
  print(c)
else:
  print(d)
# Judge status: Accepted
x=int(input())
c=0
for i in range(-130,130):
    if c==1:
        break
    for j in range(-130,130):
        if i**5-j**5==x:
            print(i,j)
            c=1
            break
# Judge status: Wrong Answer
a,b=map(int,input().split())
if a==b:
  print("Draw")
elif a==1 or a>=b:
  print("Alice")
else:
  print("Bob")
# Judge status: Accepted
import math
a, b, h, m = map(int, input().split())
alpha = 30.0 * h + (30 * m / 60)
beta = m * 6.0
if alpha < beta:
    theta = beta - alpha
else:
    theta = alpha - beta
print(math.sqrt(a**2 + b**2 - 2 * a * b * math.cos(math.radians(theta))))
# Judge status: Accepted
import heapq
import math
from heapq import heappop
n,m = map(int,input().split())
A = list(map(lambda x:-int(x),input().split()))
heapq.heapify(A)

for i in range(m):
    x = heapq.heappop(A)
    heapq.heappush(A,-(-x//2))

print(-sum(A))
# Judge status: Wrong Answer
a, b, c = map(int, input().split())
 
if a + b == c:
  print('yes')
elif b + c == a:
  print('yes')
elif c + a == b:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
n, k = map(int, input().split())
a_set = set()
for _ in range(k):
    input()
    a = set(map(int, input().split()))
    a_set = a_set | a

n_set = set()
for i in range(1,n+1):
    n_set.add(i)

ans = n_set - a_set

print(len(ans))
# Judge status: Accepted
N = int(input())

A = []
for i in range(100):
  if sum(A) >= 10e12:
    break
  A.append(pow(2,i))
if N == 1:
  print(1)
else:
  for i in range(50):
    N = N//2
    if N <= 0:
      print(sum(A[:i+1]))
      break
# Judge status: Accepted
a, b, c = map(int, input().split())
print(0 if a * b * c % 2 == 0 else a * b * c // max(a, b, c) )
# Judge status: Wrong Answer
H,A = map(int,input().split())
count = H%A + 1
print(count)
# Judge status: Wrong Answer
s = input()
output = "ABC"
if s == output:
  output = "ARC"
print(s)
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))
a.sort(reverse=True)
b=-1
ans=[0,0]
for ai in a:
  if len(ans)==4:
    break
  if b==ai:
    ans.append(ai)
    b=-1
  else:
    b=ai
print(ans[-1]*ans[-2])
# Judge status: Accepted
l = int(input())
print(l**3/27)
# Judge status: Accepted
import itertools
import math
import fractions
import functools
import copy

w, h, x, y = map(int, input().split())
ans = 0
if x == w / 2 and y == h / 2:
    ans = 1

print(w*h/2,ans)
# Judge status: Accepted
n, k = map(int,input().split())
r,s,p = map(int, input().split())
t = list(input())
a = [1]*n
for i in range(k,n):
    if t[i] == t[i-k] and a[i-k] == 1:
        a[i] = 0
ans = 0
for j in range(n):
    if t[j] == 'r' and a[j] == 1:
        ans += p
    elif t[j] == 's' and a[j] == 1:
        ans += r
    elif t[j] == 'p' and a[j] == 1:
        ans += s
print(ans)
# Judge status: Wrong Answer
x = int(input())
if x == 3 or x == 5 or x == 7:
  print('Yes')
else:
  print('No')
# Judge status: Wrong Answer
n=int(input())
a=list(input().split())
ans=[]
for i in range(n):
    ans.append([a[i],i+1])
sort1=lambda val: val[0]
ans.sort(key=sort1)
num=[]
for i in range(n):
    num.append(ans[i][1])
print(*num)
# Judge status: Wrong Answer
# O(n^M) -> TLE
from itertools import product
N, M, Q = map(int, input().split())
ls = []
for i in range(Q):
    ls.append([int(j) for j in input().split()])
arr = list(range(1, M+1))
ans = 0
for x in product(arr, repeat=N):
    cur = 0
    for y in ls:
        if x[y[1]-1] - x[y[0]-1] == y[2]:
            cur += y[3]
    ans = max(ans, cur)
print(ans)
# Judge status: Accepted
from math import floor
from math import sqrt
N = int(input())
def f(x):
  return (floor((-1+sqrt(1+8*x))/2.0))
ans = 0
i = 2
while N > 1:
  x = 0
  while N % i == 0:
    N = N // i
    x = x + 1
  if x != 0:
    ans = ans + f(x)
  i = i + 1
  if i > 10 ** 6:
    ans = ans + 1
    break
print(ans)
# Judge status: Accepted
n = [int(_) for _ in input().split()]
print(max(n)*9 + sum(n))
# Judge status: Accepted
import sys
input = sys.stdin.readline


def read():
    N = int(input().strip())
    A = list(map(int, input().strip().split()))
    return N, A


def solve(N, A):
    B = [0 for a in A]
    mid = N // 2
    for i in range(0, N, 2):
        B[mid+i//2] = A[i]
    for i in range(1, N, 2):
        B[mid-(i+1)//2] = A[i]
    if N % 2 == 1:
        print(*B[::-1])
    else:
        print(*B)


if __name__ == '__main__':
    inputs = read()
    solve(*inputs)
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))

from fractions import gcd
left = [A[0]]
right = [A[-1]]

for i in range(1, N-1):
    left.append(gcd(left[-1], A[i]))
    right.append(gcd(right[-1], A[-1-i]))

ans = 1
for i in range(N):
    if i == 0:
        tmp = right[-1]
    elif i == N-1:
        tmp = left[-1]
    else:
        tmp = gcd(left[i-1], right[N-2-i])
    ans = max(ans, tmp)

print(ans)
# Judge status: Accepted
n=int(input())
x=n-999 if n>999 else n
if n>999:
    print("ABD")
else:
    print("ABC")
# Judge status: Accepted

import sys
N,Y = map(int,input().split())

for i in range(N+1):

    for j in range(N-i+1):

        k = N - i - j

        if i * 10000 + j * 5000 + k * 1000 == Y:
            print (i,j,k)
            sys.exit()

print (-1,-1,-1)
# Judge status: Accepted
s=input()
def kaibun(aa) :
  for i in range(len(aa)):
    if aa[i]!=aa[-i-1] :
      return False
    
  return True


b=int((len(s)-1)/2)
c=int((len(s)+3)/2)
mae=s[:b]
ato=s[c-1:]
if kaibun(s) and kaibun(mae) and kaibun(ato) :
  print ('Yes')
else :
  print('No')
# Judge status: Accepted
s = int(input())
L = []
for c in range(2 , 10 ** 6 + 1):
  L.append(s)
  if s % 2 == 0:
    s = s // 2
  elif s % 2 == 1:
    s = s * 3 + 1
  if s in L:
    break
print(c)
# Judge status: Accepted
from collections import deque
import sys
input = sys.stdin.readline
from heapq import heapify

N = int(input())

table = []

for i in range(N):
    X,L = map(int, input().split())
    table.append((X-L,X+L))

table.sort(key=lambda x:x[0])
cur = table[0]
for i in range(1,N):
    if table[i][0] < cur[1]:
        N -= 1
        if cur[1] >= table[i][1]:
            cur = table[i]
    else:
        cur = table[i]

print(N)
# Judge status: Wrong Answer
n, m = map(int, input().split())
# 和が一定になるように出力
# even => n + 1
# odd  => n
x = n // 2
s = n + 1 if n % 2 == 0 else n
cnt = 0
while True:
    print(x, s - x)
    x -= 1
    cnt += 1
    if cnt == m:
        exit()
# Judge status: Accepted
N,M = map(int,input().split())
A = list(map(int,input().split()))

if sum(A) > N:
    print(-1)
else:
    print(N-sum(A))
# Judge status: Accepted
N, M = map(int, input().split())
A = list(map(int, input().split()))
BC = [list(map(int, input().split())) for _ in range(M)]
from operator import itemgetter
BC.sort(key=itemgetter(1), reverse=True)

for b, c in BC:
  A += [c]*b
  if len(A) > 2*N:
    break

A.sort(reverse=True)
print(sum(A[:N]))
# Judge status: Accepted
s = input().split("/")
if int(s[0]) <= 2019 and int(s[1]) <= 4 and int(s[2]) <= 30:
    print("Heisei")
else:
    print("TBD")
# Judge status: Accepted
D, N = map(int, input().split())

if N != 100:
    print(100**D * N)
else:
    print(100**D * (N+1))
# Judge status: Accepted
a = int(input())

if a%2 == 1:
    print((a//2+1)*(a//2))
else:
    print((a//2)*(a//2))
# Judge status: Wrong Answer
import sys
from collections import defaultdict

n=int(input())
s=[input() for _ in range(n)]
m=int(input())
t=[input() for _ in range(m)]

d=defaultdict(int)
for x in s:
  d[x]+=1
for y in t:
  d[y]-=1

print(max(d.values()))
# Judge status: Accepted
N = int(input())
X = list(map(int, input().split()))
ans_list = []
tmp = 0
for i in range(1, max(X) + 1):
  tmp = 0
  for j in X:
    tmp += (j - i)**2
  ans_list.append(tmp)
print(min(ans_list))
# Judge status: Wrong Answer
n,p=map(int,input().split())
a=list(map(int,input().split()))

gu=0
ki=0

for aa in a:
    if aa%2==0:
        gu+=1
    else:
        ki+=1

gusu=2**gu
if ki>0:
    kisu=2**(ki-1)
else:
    kisu=1

print(gusu*kisu)


#pが0だったら選ぶ袋の合計が偶数
#kisu の個数が偶数

#nが1だったら選ぶ袋の合計が奇数
#gusu の個数が奇数

#nは50、全探索はできんね
# Judge status: Accepted
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    S = readline().strip()

    if len(S) == len(set(S)):
        print('yes')
    else:
        print('no')

    return


if __name__ == '__main__':
    main()
# Judge status: Accepted
a, b = map(int,input().split())
ans = -1
for i in range(1500):
  if (a==int(i*0.08)) and (b==int(i*0.1)):
    ans = i
    break
print(ans)
# Judge status: Accepted
N = int(input())
cmin = N
for i in range(1,N//2):
    j = N-i
    a = str(i)
    b = str(j)
    cnt = 0
    for k in range(len(a)):
        cnt += int(a[k])
    for k in range(len(b)):
        cnt += int(b[k])
    cmin = min(cmin,cnt)
print(cmin)
# Judge status: Accepted
c = input()
alp = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]
count1 = 0
count2 = 0
while count2 <= 26:
  if alp[count1] == c:
     count1 += 1
     count2 += 27
  else:
    count1 += 1
    count2 += 1
print(alp[count1])
# Judge status: Accepted
N = int(input())
a = 1
while a*2 <= N:
  a *= 2

print(a)
# Judge status: Accepted
N,K,S = map(int,input().split())
import numpy as np
ans = np.array([S+1]*N)
if S==10**9:
  ans = np.array([S-10**5]*N)
ans[0:K]=S
ans = list(ans)
print(' '.join(map(str,ans)))
# Judge status: Wrong Answer
import math

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

e=math.sqrt(d)

if e.is_integer():

  print("yes")
else:
  print("no")
# Judge status: Accepted
import bisect

n = int(input())
a = sorted(list(map(int, input().split())))
b = sorted(list(map(int, input().split())))
c = sorted(list(map(int, input().split())))
ans = 0
for i in b:
    an = bisect.bisect_left(a, i)
    cn = n - bisect.bisect_right(c, i)
    ans += an * cn

print(ans)
# Judge status: Wrong Answer
a = list(map(int,input().split()))
#b = list(map(int,input().split()))
b=int(input())

for i in range(b):
    if a[0]<=a[1]<=a[2] or a[0]<=a[2]<=a[1] or a[2]<=a[1]<=a[0] or a[1]<=a[2]<=a[0] or a[2]<=a[0]<=a[1]:
        a[2]=2*a[2]
    if a[1]<=a[0]<=a[2]:
        a[1]=2*a[1]
if a[0]<a[1]<a[2]:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
from itertools import product, permutations, combinations

n = int(input())
pn = tuple(map(int, input().split(' ')))
qn = tuple(map(int, input().split(' ')))

orders = []
for i, v in enumerate(permutations(range(1, n + 1), n)):
    if v == pn:
        orders.append(i)
    if v == qn:
        orders.append(i)
        
print(abs(orders[0] - orders[1]))
# Judge status: Wrong Answer
x,y = map(int,input().split())

ans = 0

if x <= y:
  ans = y - x
  
else: # x > y
  if abs(x) > abs(y):
    if y < 0:
      ans = abs(x - y) + 1
    else:
      ans = abs(x - y) + 2
      
  elif abs(x) < abs(y):
    ans = abs(y - x) + 1
    if x < 0:
      ans += 1
  
  else:
    ans = 1

print(ans)
# Judge status: Accepted
import bisect

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

res = 0
for i in reversed(range(1, N)):
    for j in reversed(range(i)):
        index = bisect.bisect_left(L, L[i] + L[j])
        n = N - index
        res += (N - 1 - i) - n

print(res)
# Judge status: Accepted
x = int(input())

if 400 <= x < 600:
    print(8)
elif 600 <= x < 800:
    print(7)
elif 800 <= x < 1000:
    print(6)
elif 600 <= x < 1200:
    print(5)
elif 1200 <= x < 1400:
    print(4)
elif 1400 <= x < 1600:
    print(3)
elif 1600 <= x < 1800:
    print(2)
elif 1800 <= x < 2000:
    print(1)
# Judge status: Accepted
S = input()
s = list(set(S))
print("Yes" if len(s) == 2 and S.count(s[0]) == S.count(s[1]) == 2 else "No")
# Judge status: Accepted
import numpy as np
whole = np.array(list({i**j for i in range(1, 32) for j in range(2, 32) if i**j <= 1000}))
whole.sort()

X = int(input())

print(whole[np.where(whole<=X)].max())
# Judge status: Wrong Answer
mod = pow(10,9)+7
N = int(input())

A =map(lambda x:int(bin(int(x))[2:]) ,input().split())

counter = 0
for a in A:
    counter += a

A = str(counter)
L = len(A)
tmp = 0
for i in range(L):
    tmp += int(A[i])*(N-int(A[i]))*2**(L-i-1)
    tmp %= mod
print(tmp)
# Judge status: Accepted
l = [int(input()) for _ in range(5)]
m = [10 * ((l[i] + 9) // 10) for i in range(5)]
t = 130 * 5
for i in range(5):
    u = sum(m) - m[i] + l[i]
    t = min(t, u)
print(t)
# Judge status: Wrong Answer
N = int(input())
A1 = list(map(int, input().split()))
A2 = list(map(int, input().split()))
ans1 = []
ans2 = []

for x in range(N):
    if x == 0:
        ans1.append(A1[x])
        ans2.append(A1[x] + A2[x])
    else:
        ans1.append(ans1[x - 1] + A1[x - 1])
        ans2.append(max(ans1[x], ans2[x - 1]) + A2[x])
print(ans2[N - 1])
# Judge status: Wrong Answer
S = list(input())

M = ["01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"]

if S[0:2] in M and not(S[2:] in M):
    print("MMYY")
elif not(S[0:2] in M) and S[2:] in M:
    print("YYMM")
elif S[0:2] in M and S[2:] in M:
    print("AMBIGUOUS")
else:
    print("NA")
# Judge status: Wrong Answer
#!/usr/bin/env python3
import math
import numpy as np

n = int(input())
ans = np.inf
for i in range(1, int(math.sqrt(n))+1):
    if n%i==0:
        q = n//i
        tmp = i+q 
        if tmp <= ans:
            ans = tmp 
            i_ = i 
            q_ = q 

if i_ == 1 or q_ == 1:
    print(ans-1)
else:
    print(ans-2)
# Judge status: Accepted
N = int(input())
AB = [tuple(map(int,input().split())) for _ in range(N)]
AB.sort(key=lambda x:x[1])
cnt = 0
for a,b in AB:
    cnt += a
    if cnt > b:
        print("No")
        exit()
print("Yes")
# Judge status: Wrong Answer
n=int(input())
if n>=189:
    print('2')
elif n>=105:
    print('1')
else:
    print('0')
# Judge status: Accepted
n,a,b = map(int,input().split(" "))
s = input()
m_dict = {"a":0,"b":0,"c":0}
for i in s:
  if i == "a":
    if m_dict["a"]+m_dict["b"] < a+b:
      m_dict["a"] += 1
      print("Yes")
    else:
      print("No")
  elif i == "b":
    if m_dict["a"]+m_dict["b"] < a+b and m_dict["b"] < b:
      m_dict["b"] += 1
      print("Yes")
    else:
      print("No")
  else:
    print("No")
# Judge status: Accepted
def dist(x,y):
  return abs(x[0]-y[0])+abs(x[1]-y[1])

n,m = map(int,input().split())
s = []
for _ in range(n):
  a,b = map(int,input().split())
  s.append((a,b))
c = []
for _ in range(m):
  c_,d = map(int,input().split())
  c.append((c_,d))
for i in range(n):
  p = s[i]
  md = 10**10
  mi = 0
  for j in range(m):
    ch = c[j]
    d = dist(p,ch)
    if md > d:
      md = d
      mi = j
  print(mi+1)
# Judge status: Accepted
N,M=map(int,input().split())
f=set()
t=set()
for i in range(M):
  a,b=map(int,input().split())
  if a<2:
    f.add(b)
  elif b==N:
    t.add(a)
print(("IM","")[len(f&t)]+"POSSIBLE")
# Judge status: Accepted
n, x, t = list(map(int, input().rstrip().split(" ")))
print(((n-1)//x + 1)*t)
# Judge status: Accepted
n = int(input())
A = list(int(input()) for _ in range(n))
ans = 0
for i in range(n):
    tmp = A[i]
    ans += (tmp//2)
    if i < n-1 and tmp %2 and A[i+1] > 0:
        ans += 1
        A[i+1] -= 1
print(ans)
# Judge status: Accepted
N=int(input())
S=input()
K=10**9+7

T={}
for s in S:
    if s in T:
        T[s]+=1
    else:
        T[s]=2

X=1
for a in T:
    X=(X*T[a])%K
print((X-1)%K)
# Judge status: Accepted
x=int(input())

thousands=(x-x%500)/500
fives=(x%500-(x%500)%5)/5

happiness=int(1000*thousands+5*fives)

print(happiness)
# Judge status: Accepted
x, y =  map(int, input().split())

max_num = 4 * x
min_num = 2 * x

if y % 2 == 1:
    print('No')
elif (min_num <= y) and (max_num >= y):
    print('Yes')
else:
    print('No')
# Judge status: Accepted
"""
- Nを素因数分解する
- N = p[i]^1*p[i]^2...*p[k]^1*p[k]^2...
"""
from collections import Counter
N = int(input())
factors = []
i = 2

while N > 1:
  if N < i * i:
    factors.append(N)
    break
  while N % i == 0:
    factors.append(i)
    N //= i
  i += 1
# N == 1
ans = 0
# print(factors)
# Counter() ->{key:count}
for count in Counter(factors).values():
  i = 1
  while count >= i:
    count -= i
    i += 1
    ans += 1
print(ans)
# Judge status: Accepted
N=int(input())

if N==0:
    print(0)
    exit()

S=""
while N:
    S=str(N%2)+S
    N=-(N-(N%2))//2
print(S)
# Judge status: Accepted
a,b,c=map(int,input().split())
count=0
if a==b==c and a%2==0:
    print(-1)
    exit()
while a%2==0 and b%2==0 and c%2==0:
    A=a//2
    B=b//2
    C=c//2
    a=B+C
    b=C+A
    c=A+B
    count+=1
print(count)