peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Wrong Answer
d = 25 - (int(input()))
answer = "Christmas"

for i in range(d):
    answer += "Eve"

print(answer)
# Judge status: Wrong Answer
S = input().split()
ans =set(S)

a = len(S)
b = len(ans)

if a == b:
    print("yes")
else:
    print("no")
# Judge status: Accepted
n = input()
mod = [0]*2019
mod[0] += 1
T = 0
d = 1 # 桁数
for i, s in enumerate(n[::-1]):
  T += int(s) * d
  T %= 2019
  d = (d * 10) % 2019
  mod[T] += 1
  
res = 0  
for m in mod:
  res += m*(m-1)/2
print(int(res))
# Judge status: Wrong Answer
n = int(input())
a = input()
if len(a) > n:
  print(a[0:n+1])
else:
  print(a +'...')
# Judge status: Accepted
n = input()
if n[-1] == "3":
  print("bon")
elif n[-1] in ["0", "1", "6", "8"]:
  print("pon")
else:
  print("hon")
# Judge status: Accepted
n,l=map(int,input().split())
s=[input() for _ in range(n)]
s.sort()
x=''
for i in s:
  x+=i
print(x)
# Judge status: Accepted
from math import factorial
n,p=map(int,input().split())
A=list(map(int,input().split()))

a,b=0,0
for i in A:
    if i%2==0:a +=1
    else:b +=1

cnt=0 if p==1 else 1
for i in range(p,b+1,2):
    if i==0:continue
    cnt +=factorial(b)//(factorial(i)*factorial(b-i))

print(cnt*(2**a))
# Judge status: Wrong Answer
import math
L = int(input())

length = L*100
max_vol=0
for w in range(1,math.ceil((length+1)/3)):
    if max_vol<w*((length-w)/2)**2:
        max_vol = w*((length-w)/2)**2
print(max_vol/1000000)
# Judge status: Wrong Answer
n = int(input())
red =[]
for i in range(n):
  l = str(input())
  red.append(l)

m = int(input())
blue =[]
for i in range(m):
  l = str(input())
  blue.append(l)
  
import collections

cr = collections.Counter(red)
crs = list(cr.most_common())
cb = collections.Counter(blue)
cbs = list(cb.most_common())

result =[]

for i in range(len(crs)):
  for j in range(len(cbs)):
    if crs[i][0]==cbs[j][0]:
      result.append(crs[i][1]-cbs[j][1])
    else:
      result.append(crs[i][1])

if max(result)>0:
  print(max(result))
else:
  print(0)
# Judge status: Wrong Answer
n=int(input())
mb=[int(input()) for i in range(5)]
print(-(-n//min(mb))+4)
# Judge status: Wrong Answer
n, d = map(int, input().split())
xy = []
for i in range(n):
  xy.append(list(map(int,input().split())))

c = 0

for i in range(n):
  if xy[i][0] * xy[i][0] + xy[i][1] * xy[i][1] < d * d:
    c += 1

print(c)
# Judge status: Accepted
#!/usr/bin/env python3
import fractions
a, b = map(int, input().split())
f = fractions.gcd(a, b)
ans = a * b // f
print(ans)
# Judge status: Accepted
N, A, B = map(int, input().split())

if abs(A - B) % 2 == 0:
    print(abs(A - B) // 2)
else:
    ans = min(A - 1, N - B) + (B - A - 1) // 2 + 1
    print(ans)
# Judge status: Wrong Answer
n = int(input())
a = [int(i) for i in input().split()]
print(a)
ans=0
for i in range(n-1):
  d = a[i-1] - a[i]
  if d<0:
    ans+= d+1
    a[i]=a[i]+d+1
  else:
    continue
    
print(abs(ans))
# Judge status: Accepted
N,A,B=map(int,input().split())
if (B-A)%2==0:
    print((B-A)//2)
else:
    tmp=A-1+(B-A+1)//2
    a=A+(N-B);b=N
    tmpp=N-B+(b-a+1)//2
    print(min(tmp,tmpp))
# Judge status: Wrong Answer
import math

x=0
y=0
for _ in range(5):
  i=int(input())
  x+=math.ceil(i)
  if i%10>y:
    y=i%10
print(x+y-10)
# Judge status: Accepted
n,k = map(int,input().split())
mod = 10**9+7
ans = 0

for i in range(k,n+2):
  ans += (n-i+1)*i+1
  ans %= mod
  
print(ans)
# Judge status: Accepted
import bisect
N=int(input())
ls=[int(input()) for _ in range(N)]
color=[ls[-1]]
ans=1
for i in range(N-1):
  a=ls[-2-i]
  k=bisect.bisect_right(color,a)
  if k==ans:
    color.append(a)
    ans+=1
  else:
    color[k]=a
print(ans)
# Judge status: Accepted
N, L=map(int, input().split())
ans=sum([L+i-1 for i in range(1, N+1)])
if L>0:
  ans-=L
elif N+L-1<0:
  ans-=N+L-1
print(ans)
# Judge status: Accepted
import math


def main():

    N = int(input())

    N = math.ceil(N / 2)

    print(N)


if __name__ == "__main__":
    main()
# Judge status: Accepted
n = input()
r = 0
for c in n:
  r += int(c)
if r % 9 == 0:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
import math
A,B =map(int,input().split())
soc= 1
tap=0
while(soc<B):
  soc-=1
  soc+=A
  tap+=1
#print(tap)
print(math.ceil((B-1)/(A-1)))
# Judge status: Wrong Answer
a,b,c = map(int, input().split())
d,e,f = map(int, input().split())
g,h,i = map(int, input().split())
n = int(input())
num =[]
for j in range(n):
    num.append(int(input()))
if (a and d and g )in num:
    print('Yes')
elif (b and e and h) in num:
    print('Yes')
elif (c and f and i) in num:
    print('Yes')
elif (a and b and c) in num:
    print('Yes')
elif (g and h and i) in num:
    print('Yes')
elif (a and e and i) in num:
    print('Yes')
elif (c and e and g) in num:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
mod = 10**9 + 7

def main():
    N = int(input())
    S = input()
    num_chars = 0
    A = {}
    for s in S:
        if s not in A:
            A[s] = 0
            num_chars += 1
        A[s] += 1
    # print(num_chars, A)
    B = [(a, A[a]) for a in A]

    ans = 1
    for b in B:
        ans = (ans * (b[1] + 1)) % mod
    print(ans)

if __name__ == '__main__':
    main()
# Judge status: Accepted
s = input()
print(s[0:3]+"8"+s[4:10])
# Judge status: Accepted
n,a,b = map(int,input().split())

if a > b:
    print(0)
elif n == 1:
    print(int(a==b))
else:
    print((b-a)*(n-2)+1)
# Judge status: Wrong Answer
x, y = map(int, input().split())

ans = 0
if x < y:
    if x < 0 and y > 0:   
        ans = y + x
    else:
        ans = abs(y) - abs(x)
elif x == y * -1:
    ans = 1
elif x > y and x < 0 and y < 0 and abs(y) > abs (x):
    ans = abs(y) - abs(x) + 2
else:
    ans = max(abs(y), abs(x)) - min(abs(y), abs(x)) + 1

print(ans)
# Judge status: Accepted
n=int(input())
sp=[]
for i in range(n):
  s,p=input().split()
  p=int(p)
  sp.append([s,p,i+1])
sp.sort(key=lambda sp:(sp[0],-sp[1]))
for i in sp:
  print(i[2])
# Judge status: Accepted
from collections import defaultdict
S = input()
T = input()

s_to_t = defaultdict(set)
t_to_s = defaultdict(set)

for s, t in zip(S, T):
    s_to_t[s].add(t)
    t_to_s[t].add(s)

for v in s_to_t.values():
    if len(v) > 1:
        print("No")
        exit()
for v in t_to_s.values():
    if len(v) > 1:
        print("No")
        exit()
print("Yes")
# Judge status: Accepted
n=int(input())
l=[n]
i=1
while(True):
  i+=1
  if n%2==0:
    n=n/2
  else:
    n=3*n+1
  if n in l:
    print(i)
    break
  else:
    l+=[n]
# Judge status: Wrong Answer
n = int(input())
a = list(map(int, input().split()))

ans = 0
i = 0
maxi = a[i]

while True:
    if i == n - 1:
        break
    if a[i + 1] < a[i]:
        ans += (maxi - a[i + 1])
    else:
        maxi = a[i + 1]

    i += 1

print(ans)
# Judge status: Wrong Answer
import bisect
N=int(input())
L=list(map(int,input().split()))
i=0
L=sorted(L)
for a in range(N):
  for b in range(a+1,N):
    c=bisect.bisect_left(L,L[a]+L[b])
    if c>b:
      i+=c-b
    else:
      i=i
print(i)
# Judge status: Accepted
from itertools import accumulate

n = int(input())
a = [int(i) for i in input().split()]
ac = list(accumulate(a))
d = float("inf")
for i in range(n - 1):
    d = min(abs(ac[i] * 2 - ac[-1]), d)
print(d)
# Judge status: Accepted
import math
n=int(input())
def sosu(x):
    a=1
    for i in range(2,int(math.sqrt(x))+1):
        if x%i==0:
            a=i#素数でない場合は最後のaが出力される
    return a
a=sosu(n)
if a==1:
    print(n-1)
else:
    b=n//a
    ans=(a-1)+(b-1)
    print(ans)
# Judge status: Accepted
n = list(map(int, input()))

if n[0] == n[1] == n[2]:
    print('Yes')
elif n[1] == n[2] == n[3]:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
A=['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']
N=int(input())
x=input()
X=[j for j in x]
for i in range(0,len(X)-1):
  n=(A.index(X[i])+N)%26
  X[i]=A[n]
print(X)
# Judge status: Accepted
a,b,c = map(int,input().split())
if a%2 == 0 or b%2 == 0 or c%2 == 0:
    print(0)
else:
    print(min(a*b,a*c,b*c))
# Judge status: Accepted
a,b,c=map(int,input().split())
if (b-a)==(c-b):
  print("YES")
else:
  print("NO")
# Judge status: Accepted
n, a, b = map(int,input().split())
s = input()
a_p = 0
b_p = 0
 
for i in s:
    if i == 'a' and a_p + b_p < a + b:
        print('Yes')
        a_p += 1
    elif i == 'b' and a_p + b_p < a + b and b_p < b:
        print('Yes')
        b_p += 1
    else:
        print('No')
# Judge status: Accepted
# B
n,l = map(int,input().split())
ans=0
for i in range(1,n+1):
    ans+=(l+i-1)
if l+n-1 < 0:
    print(ans-(l+n-1))
elif l+n-1 >= 0 and l <= 0:
    print(ans)
else:
    print(ans-l)
# Judge status: Wrong Answer
A,B = map(int,input().split())

if A >= 10 and B >= 10 or A == 0 or B == 0:
    print(-1)
else:
    print(A*B)
# Judge status: Wrong Answer
n = int(input())
ans = [0]*n

for x in range(1,int(n**.5)+1):
    for y in range(1,int(n**.5)+1):
        for z in range(1,int(n**.5)+1):
            a = x*x+y*y+z*z+x*y+y*z+z*x
            if a < n:
                ans[a] += 1
for i in range(n):
    print(ans[i])
# Judge status: Accepted
n=int(input())
s=list(map(int,input().split()))

cnt=0
for i in range(1,n-1):
    if s[i-1]<s[i] and s[i]<s[i+1]:
        cnt+=1
    if s[i-1]>s[i] and s[i]>s[i+1]:
        cnt+=1
print(cnt)
# Judge status: Accepted
def solve():
  Q, H, S, D = map(int, input().split())
  N = int(input())
  two = min([Q*8,H*4,S*2,D])
  one = min([Q*4,H*2,S])
  ans = two*(N//2)+one*(N%2)
  return ans
print(solve())
# Judge status: Accepted
x=int(input())
q=x//11
r=x%11
if r==0:
    print(2*q)
elif r<=6:
    print(2*q+1)
else:
    print(2*q+2)
# Judge status: Accepted
A, B, C = map(int, input().split())
K = int(input())
counter = 0

while C <= B or C <= A:
    C = 2*C
    counter += 1

while B <= A:
    B = 2*B
    counter += 1

while C <= B:
    C = 2*C
    counter += 1

if counter > K:
    print("No")
else:
    print("Yes")
# Judge status: Wrong Answer
n=int(input())
x = [int(input()) for _ in range(5)]
p = min(x)
q = n//p
print(q+4)
# Judge status: Wrong Answer
a,b,x=map(int,input().split())
if a<=x<=b:
  print('YES')
else:
  print('NO')
# Judge status: Accepted
a, b = map(int, input().split())
s = input()
number = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]
if s[a] == "-":
    if all(s[:a][i] in number for i in range(a)) and all(s[a + 1:a + b + 1][i] in number for i in range(b)):
        print("Yes")
    else:
        print("No")
else:
    print("No")
# Judge status: Accepted
K = int(input())
S = input()

if len(S) <= K:
    print(S)
else:
    print(S[:K]+"...")
# Judge status: Accepted
l=list(map(int,input().split()))
n=int(input())
a=[l[0]]
b=[2*l[0],l[1]]
c=[4*l[0],2*l[1],l[2]]
d=[8*l[0],4*l[1],2*l[2],l[3]]
ans=0
x=n//2
y=n%2
print(x*min(d)+y*min(c))
# Judge status: Wrong Answer
A,B,K=map(int,input().split())
count=1
ans=0
i=1
while count<=K:
    if A%i==0 and B%i==0:
        count+=1
        ans=i
        print(ans)
    i+=1
print(ans)
# Judge status: Accepted
import sys

sys.setrecursionlimit(10 ** 7)


def resolve():
    A = list(input())
    B = list(input())
    C = list(input())

    def solve(S, s):
        if len(S) == 0:
            return s.upper()
        s = S.pop(0)
        if s == "a":
            return solve(A, s)
        elif s == "b":
            return solve(B, s)
        else:
            return solve(C, s)

    print(solve(A, ""))


if __name__ == '__main__':
    resolve()
# Judge status: Wrong Answer
N = int(input())
L = sorted(list(map(int, input().split())))

if L[-1] > sum(L[:-1]):
  print("No")
else:
  print("Yes")
# Judge status: Accepted
from fractions import gcd

A, B = map(int, input().split())

print(A * B // gcd(A, B))
# Judge status: Wrong Answer

S = input()
S.replace("2017","2018")
print(S)
# Judge status: Accepted
import sys

s = input()

for i in range(len(s) - 1):
  if(s[i] == s[i + 1]):
    print('Bad')
    sys.exit()

print('Good')
# Judge status: Wrong Answer
Answer = input()
input_retu = input()
count = 0
for i in range(len(Answer)):
    if Answer[i] == input_retu[i]:
        continue
    else:
        count += 1
# Judge status: Accepted
n = int(input()) 
H =  [int(x) for x in input().split()]
maxv = 0
v = H[0]
count = 0

for i in range(1,n):
    if v < H[i]:
        if maxv < count:
            maxv = count
        count = 0
    else:
        count += 1
    v = H[i]

if maxv < count:
    maxv = count

print(maxv)
# Judge status: Wrong Answer
n, k = map(int, input().split())
a = list(map(int, input().split()))
low = 0
top = max(a) + 1

while top - low > 1:
  mid = (top + low) // 2
  cnt = 0
  for i in range(n):
    if a[i] % mid == 0:
      cnt += a[i] // mid
    else:
      cnt += (a[i] // mid) + 1
  if cnt <= k:
    top = mid
  else:
    low = mid
print(low)
# Judge status: Accepted
N,Y = map(int,input().split())
for a in range(N+1):
    for b in range(N+1):
        val = Y-10000*a-5000*b
        n = N-a-b
        if n>=0 and val >=0 and n*1000==val:
            print(a,b,N-a-b);exit()
print('-1 -1 -1')
# Judge status: Accepted
n,k=map(int,input().split())
d=list(input().split())
for num in range(n,100001):
    num=str(num)
    ok=True
    for c in num:
        if c in d:
            ok=False
    if ok:
        print(num)
        exit()
# Judge status: Accepted
def mi():return map(str,input().split())
from decimal import *

a,b,c=mi()
getcontext().prec=1500
a=Decimal(a)**Decimal("0.50")
b=Decimal(b)**Decimal("0.50")
c=Decimal(c)**Decimal("0.50")

if c>a+b:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
N = int(input())
S = []
for i in range(N):
    xi, li = map(int, input().split())
    S.append([xi - li, xi + li])

S.sort()

ans = 0
last = -1*float('Inf')
for si in S:
    if si[0] >= last:
        ans += 1
        last = si[1]

print(ans)
# Judge status: Wrong Answer
n, m = map(int, input().split())
MOD = 10**9+7
ans = 1
if abs(n-m) == 0:
    for i in range(1, n+1):
        ans = ans * i % MOD
    else:
        ans = ans ** 2 * 2 % MOD
elif abs(n-m) == 1:
    cnt_n = 1
    cnt_m = 1
    for i in range(1, n+1):
        cnt_n = cnt_n * i % MOD
    for i in range(1, m+1):
        cnt_m = cnt_m * i % MOD
    else:
        ans = cnt_n * cnt_m
else:
    ans = 0

print(ans)
# Judge status: Accepted
a,b = map(int,input().split())
ans = 0
n = 1

while n < b:
  n += a - 1
  ans += 1
  
print(ans)
# Judge status: Accepted
N, K = map(int, input().split()) 
A = sorted(map(int, input().split()))
ans = 0

for i in range(K):
  ans = ans + A[i]

print(ans)
# Judge status: Wrong Answer
s = input()

n = len(s)+1
L = [0]*(n)

for i in range(n-1):
  if s[i]=='<':
    L[i+1] = max(L[i+1],L[i]+1)

for i in range(n-2,0,-1):
  if s[i]=='>':
    L[i] = max(L[i],L[i+1]+1)
    
print(sum(L))
# Judge status: Accepted
d, n = map(int, input().split())
x = 100 ** d
y = x
cnt = 0
while cnt < n:
    if y % 100**(d+1) != 0:
        cnt += 1
    y += x
print(y-x)
# Judge status: Accepted
N = (int)(input())

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

Res = [0] * (N)

for a in A:
    Res[a-1] += 1

for res in Res:
    print(res)
# Judge status: Wrong Answer
x,k,d = map(int,input().split())
an = x

if x < 0:
    x = -x

if x-d*k >= 0:
    an = x-d*k
else:
    for i in range(k):
        if x > 0:
            x -= d
        else:
            x += d
            
        if an > abs(x) or x==0:
            an = x
        else:
            if (k-i-1)%2 == 0:
                an = x
            break
        
print(abs(an))
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))
ans = float('inf')

for target in range(-100, 101):
  cost = 0
  for j, a in enumerate(A):
    cost += (target - a)**2
  ans = min(ans, cost)

print(ans)
# Judge status: Accepted
import numpy as np
from numba import njit
 
n, k = map(int, input().split())
a = np.array(list(map(int, input().split())), dtype=np.int64)
 
@njit
def loop1(a):
  b = np.zeros(n+1, dtype=np.int64)
  for i in range(n):
    l = max(0, i-a[i])
    r = min(i+a[i]+1, n)
    b[l] += 1
    if r <= n-1: b[r] -= 1
  
  b = np.cumsum(b)[:-1]
  return b
 
for q in range(min(42, k)):
  a = loop1(a)
    
print(*a)
# Judge status: Wrong Answer
x=int(input());print('YNeos'[not(x==3 or x==5 or x==7)::2])
# Judge status: Accepted
n = int(input())

t = [[0] * 10 for _ in range(10)]
for i in range(1, n+1):
  s = str(i)
  t[int(s[0])][int(s[-1])] += 1

result = 0
for i in range(1, 10):
  for j in range(1, 10):
    result += t[i][j] * t[j][i]
print(result)
# Judge status: Accepted
N,L = map(int,input().split())
min = 10**4
sum = 0
for i in range(N) :
    t = i+L
    sum += t
    if abs(t) < abs(min) :
        min  = t


print(sum - min)
# Judge status: Accepted
def main():
    N = int(input())
    A = list(map(int, input().split()))
    A.sort()

    p = 1
    LIMIT =  10 ** 18
    for a in A:
        p *= a
        if p > LIMIT:
            print(-1)
            return
    
    print(p)

if __name__ == '__main__':
    main()
# Judge status: Accepted
def main():
    c_list = [list(input()) for _ in range(2)]
    if c_list[0][0] == c_list[1][2] and c_list[0][1] == c_list[1][1] and c_list[0][2] == c_list[1][0]:
        print("YES")
    else:
        print("NO")


if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
n = list(input())

sum = 0
for i in range(len(n)):
    sum += int(n[i])

# print(sum)
if sum % 9 == 0:
    print('YES')
else:
    print('No')
# Judge status: Accepted
s=sorted
(x,y,*_),p,q,r=eval('map(int,input().split()),'*4)
print(sum(s(s(p)[-x:]+s(q)[-y:]+s(r))[-x-y:]))
# Judge status: Wrong Answer
A,B,C=map(int,input().split(' '))
print(max(A*10+B+C,A+B*10+C))
# Judge status: Accepted
n, k = map(int, input().split())
lst = list(map(int, input().split()))
lst.sort()
ans = 0
for i in range(k):
  ans += lst[i]
print(ans)
# Judge status: Accepted
S = input()

ret = ""
for i in S:
    if i == "B":
        ret = ret[:-1]
    else:
        ret += i

print(ret)
# Judge status: Accepted
H = int(input())
W = int(input())
N = int(input())
answer = 0
if H >= W:
    answer = N // H
    if N % H != 0:
        answer += 1
else:
    answer = N // W
    if N % W != 0:
        answer += 1
print(answer)
# Judge status: Accepted
c11, c12,c13=[int(i) for i in input().split()]
c21, c22,c23=[int(i) for i in input().split()]
c31, c32,c33=[int(i) for i in input().split()]

ans=0
for a1 in range(c11+1):
    b1=c11-a1
    b2=c12-a1
    b3=c13-a1
    a2=c21-b1
    a3=c31-b1
    
    if c22==a2+b2 and c23==a2+b3 and c32==a3+b2 and c33==a3+b3:
        print("Yes")
        ans=1
        break

if ans==0:
    print("No")
# Judge status: Accepted
# Python3 (3.4.3)
import sys
input = sys.stdin.readline
from math import ceil,floor

# -------------------------------------------------------------
# function
# -------------------------------------------------------------


# -------------------------------------------------------------
# main
# -------------------------------------------------------------
A = [int(input()) for _ in range(5)]

total = 0
rem = 10
for a in A:
    total += ceil(a/10)*10
    rem = min(rem, (a-1)%10+1)

print(total-10+rem)
# Judge status: Accepted
def main():
    X = int(input())
    for A in range(0, 201):
        for B in range(-201, 201):
            if pow(A, 5) - pow(B, 5) == X:
                print(A, B)
                return

if __name__ == "__main__":
    main()
# Judge status: Accepted
def main():
    L,R,d = map(int,input().split())
    cnt = 0
    for i in range(L,R+1):
        if i % d == 0:
            cnt += 1
    print(cnt)
if __name__ == '__main__':
    main()
# Judge status: Accepted
import sys
from collections import *
import heapq
import math
import bisect
from itertools import permutations,accumulate,combinations,product
from fractions import gcd
def input():
    return sys.stdin.readline()[:-1]
def ruiseki(lst):
    return [0]+list(accumulate(lst))
mod=pow(10,9)+7

n=int(input())
print((n+1)//2)
# Judge status: Accepted
import sys

sys.setrecursionlimit(10 ** 8)

input = sys.stdin.readline


def main():
    A, B, C = [int(x) for x in input().split()]


    if A % 2 == 0 or B % 2 == 0 or C % 2 ==0:
        print(0)
    else:
        print(min(A * B, B * C, C * A))


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
d=input()
if d==25:
  print("Christmas")
elif d==24:
  print("Christmas Eve")
elif d==23:
  print("Christmas Eve Eve")
elif d==22:
  print("Christmas Eve Eve Eve")
# Judge status: Accepted
N = int(input())
A = [0]*N
B = [0]*N
for i in range(N):
    a, b = map(int, input().split())
    A[i] = a
    B[i] = b
ans = 0
for i in range(N-1,-1,-1):
    A[i] += ans
    ans += B[i]*((A[i]+B[i]-1)//B[i]) - A[i]
print(ans)
# Judge status: Accepted
import math
from functools import reduce
N, X = map(int, input().split())
x = [abs(X-i) for i in map(int, input().split())]
print(reduce(math.gcd, x))
# Judge status: Wrong Answer
a = input().split()
s=int(a[0])
w=int(a[1])
if s >=w:
  print("safe")
else:
  print("unsafe")
# Judge status: Accepted
n, m = map(int, input().split())

if n*2 <= m:
  t = n*2 + m
  print(t//4)
else:
  print(m//2)
# Judge status: Wrong Answer
s = input()
ans = []
for i in range(len(s)):
    if s[i] == 'B' and ans:
        ans.pop()
    else:
        ans.append(s[i])
print(ans)
# Judge status: Accepted
a,b = [int(x) for x in input().split()]
res = -1
for i in range(20000):
  if i * 8 // 100 == a and i * 10 // 100 == b:
    res = i
    break
print(res)
# Judge status: Wrong Answer
# ３重ループではTLE
# a < b < c & c < a + b

import bisect
N = int(input())
L = sorted(list(map(int,input().split())))
ans = 0

print(L)

for i in range(N):
    for j in range(i+1,N):
        t = L[i] + L[j]
        idx = bisect.bisect_left(L,t)
        ans += max(0, idx-j-1) # c < a + b の範囲を総取り
print(ans)
# Judge status: Accepted
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def i(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
INF = 10**9
mod = 10**9+7

X,Y,Z = I()
print((X-Z)//(Y+Z))
# Judge status: Wrong Answer
a,b,c=input().split()
print(a,b,c)
# Judge status: Accepted
a,b,k = map(int, input().split())

if a <= k:
    k -= a
    a = 0
    if b <= k:
        b = 0
    else:
        b -= k
else:
    a -= k

print(a,b)
# Judge status: Accepted
SP = input()
T = input()
S = ""

for i in range(len(SP)-len(T),-1,-1):
  cnt = 0
  for j in range(len(T)):
    if SP[i+j] == T[j] or SP[i+j] == "?":
      cnt = cnt +1
  if cnt == len(T):
    S = (SP[:i] + T + SP[i+len(T):]).replace("?","a")
    break
###    
if S == "":
  print("UNRESTORABLE")
else:
  print(S)
# Judge status: Accepted
def main():
    import sys
    import collections
    input = sys.stdin.readline
    N = int(input())
    S = [input() for i in range(N)]
    c = collections.Counter(S)
    max_num = c.most_common(1)[0][1]
    ss = []
    for cc in c.most_common():
        if cc[1] == max_num:
            ss.append(cc[0])
    ss.sort()
    print("".join(ss))

if __name__ == "__main__":
    main()
# Judge status: Accepted
def main():
  N = int(input())
  a = 1
  b = 1
  c = 1
  mod = (10 ** 9) + 7
  for _ in range(N):
    a = (a * 10) % mod
    b = (b * 9) % mod
    c = (c * 8) % mod
  print((a - (2*b) + c) % mod )
main()
# Judge status: Wrong Answer
l = int(input())
a = 0

for i in range(l):
    a = i*((l-i)/2)*((l-i)/2) if a < i*((l-i)/2)*((l-i)/2) else a

print(float(a))
# Judge status: Accepted
x,a,b=map(int,input().split())
if abs(x-a) <abs(x-b):
    print("A")
else:
    print("B")
# Judge status: Wrong Answer
def main():
    N = int(input())
    A = list(map(int, input().split()))
    t = sum(a - i for i, a in enumerate(A, 1))
    t = t // N
    print(min(sum(abs(a - (t + i)) for i, a in enumerate(A, 1)),
              sum(abs(a - (t + i + 1)) for i, a in enumerate(A, 1))))
            

main()
# Judge status: Accepted
n = int(input())

ans = 0


for i in range(1, n+1):
    if len(str(i)) % 2 == 1:
        ans += 1

print(ans)