peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
from collections import Counter

N = int(input())

A = Counter([int(x) for x in input().split()])

for i in range(1,N+1):
  print(A.get(i) if A.get(i) is not None else 0)
# Judge status: Accepted
n,k= map(int, input().split())

if n%k == 0:
    print(0)
else:
    print(1)
# Judge status: Wrong Answer
n = int(input())
button = []
for i in range(n):
  button.append(int(input()))
times = 0
next_button = 1
while times < 5:
  times += 1
  next_button = button[next_button-1]
  if next_button == 2:
    print(times)
    exit()
print(-1)
# Judge status: Wrong Answer
def main():
    n = int(input())
    a = n - 1
    b = 1
    menor = soma_digitos(a) + soma_digitos(b)
    temp = 0
    for i in range(n-1):
        a -= 1
        b += 1
        temp = soma_digitos(a) + soma_digitos(b)
        if menor > temp:
            menor = temp
    print(menor)

def soma_digitos(n):
    soma = 0
    while n >= 1:
        soma += n%10
        n = n//10
    return soma
main()
# Judge status: Accepted
n = int(input())
a_list = list(map(int,input().split()))
p_list = [0 for i in range(n)]
for a in a_list:
  p_list[a-1] += 1
  
for p in p_list:
  print(p)
# Judge status: Wrong Answer
n,k=map(int,input().split())
x=list(map(int,input().split()))
ans=2*10**8
for i in range(n-k+1):
  ans=min(ans,min(abs(x[i]),abs(x[k+i-1]))+x[k+i-1]-x[i])
print(ans)
# Judge status: Wrong Answer
from fractions import gcd

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

def prime_factor(n):
    x = int(n**0.5)
    res = [1]
    for i in range(2,x+1):
        while n%i==0:
            n //= i
        res.append(i)
    if n!=1:
        res.append(n)
    return res

z = gcd(a,b)
print(len(prime_factor(z)))
# Judge status: Wrong Answer
a, b, c = map(int, input().split())

s = a + b + c

if s == 17:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
l,r = map(int, input().split())
if (r-l >= 2018):
    print(0)
    exit()
a = []
for i in range(l,r+1):
    a.append(i%2019)
a.sort()
if (a[0]==0):
    print(0)
    exit()
b = []
for i in range (0,len(a)-1):
    for j in range (1,len(a)):
        b.append((a[i]*a[j])%2019)
print(min(b))
# Judge status: Accepted
s = input()
a = "Yes"
for i in range(len(s)):
    if i % 2 == 0:
        if s[i] == "L":
            a = "No"
    else:
        if s[i] == "R":
            a = "No"

print(a)
# Judge status: Wrong Answer
n = int(input())

S = [input() for _ in range(n)]

if len(S) != len(set(S)):
    print("No")
    exit()

ans = {}
for s in S:
    if s[0] in ans:
        ans[s[0]] += 1
    else:
        ans[s[0]] = 1

    if s[-1] in ans:
        ans[s[-1]] -= 1
    else:
        ans[s[-1]] = -1

if sum(ans.values()) == 0:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
O=input()
E=input()
P = ""
for i in range(len(E)):
  P += O[i]
  P += E[i]
if len(O)-len(E)==1:
  P += O[-1]
print(P)
# Judge status: Wrong Answer
s = input()

if s[:-1]=='s':
    print(s+'es')
else:
    print(s+'s')
# Judge status: Accepted
a = int(input())
print( ((a+1)//2) / a)
# Judge status: Accepted
N = int(input())
S = {}
for _ in range(N):
    s = input()
    if s in S:
        S[s] += 1
    else:
        S[s] = 1

M = int(input())
T = {}
for _ in range(M):
    t = input()
    if t in T:
        T[t] += 1
    else:
        T[t] = 1

res = 0

for s in S:
    if s in T:
        if S[s] - T[s] > 0:
            res = max(res, S[s] - T[s])

    else:
        res = max(res, S[s])

print(res)
# Judge status: Accepted
import fractions as f

n = int(input())
a = [int(_) for _ in input().split()]

left = [0] * (n+1)
left[0] = 0
for i in range(1, n+1):
    left[i] = f.gcd(left[i-1], a[i-1])

right = [0] * (n+1)
right[n] = 0
for i in range(1, n+1):
    right[n-i] = f.gcd(right[n-i+1], a[n-i])

ans = 0
for i in range(n):
    ans = max(ans, f.gcd(left[i], right[i+1]))
print(ans)
# Judge status: Accepted
x = int(input())
a = x//(5+6)
if x-11*a==0:
  print(2*a)
elif 1<=x-11*a<=6:
  print(2*a+1)
else:
  print(2*a+2)
# Judge status: Accepted
l,r,d = list(map(int,input().split()))
print(r//d - (l-1)//d)
# Judge status: Accepted
import math
from functools import reduce

n = int(input())
ans = 0

def gcd(*numbers):
    return reduce(math.gcd, numbers)

for a in range(1,n+1):
    for b in range(1,n+1):
        for c in range(1,n+1):
            ans += gcd(a,b,c)
print(ans)
# Judge status: Accepted
S,T = map(str,input().split(" "))
print(T,end="")
print(S)
# Judge status: Wrong Answer
x, y = map(int, input().split())

if (2 * y - x) % 3 != 0 or (-y + 2 * x) % 3 != 0:
    print(0)
    exit()

n = (2*y - x) // 3
m = (-y + 2*x) // 3


def cmb(n,r):
    mod = 10**9+7
    ans = 1
    for i in range(r):
        ans *= n-i
        ans %= mod
    for i in range(1,r+1):
        ans *= pow(i,mod-2,mod)
        ans %= mod
    return ans


print(cmb(n+m, n))
# Judge status: Wrong Answer
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

total = 0
min_mod = 9
for t in (a,b,c,d,e):
  total += (t + 9) // 10
  if t%10 != 0:
    min_mod = min(t%10, min_mod)

ans = (total - 1) * 10 + min_mod
print(ans)
# Judge status: Wrong Answer
a, b  = map(int,input().split())

if (a % 3 != 0) and ( b % 3 != 0):
  print("Impossible")
  
else:
  print("Possible")
# Judge status: Accepted
n,k=map(int,input().split())
a=[]
for i in range(n):
    a_i,b_i=map(int,input().split())
    a.append([a_i,b_i])
a.sort()
num=0
for i in range(n):
    num+=a[i][1]
    if num>=k:
        print(a[i][0])
        break
# Judge status: Accepted
from collections import Counter
 
n = int(input())
a = list(map(int,input().split()))
 
ac = Counter(a)
 
m = max(a)
ans = 0
for i in range(m+1):
    ans = max(ans, ac[i-1]+ac[i]+ac[i+1])
print(ans)
# Judge status: Wrong Answer
import math
import fractions
import functools
def main():
    n = int(input())
    a = [int(t)for t in input().split()]

    M = 10**9+7
    culcm = functools.reduce(lcm,a)

    result = functools.reduce(lambda p,q:(p+culcm//q)%M,a)

    print(result)

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

if __name__ == "__main__":
    main()
# Judge status: Accepted
# A - Duplex Printing

N = int(input())

print((N+(2-1))//2)
# Judge status: Wrong Answer
a,b,c,k=map(int,input().split())
ans=a
if a+b<k: ans-=(k-(a+b))
print(ans)
# Judge status: Wrong Answer
n = int(input())
h = [int(xi) for xi in input().split()]

step = 0
mstep = 0
for xi in range(n-1):
    if h[xi]>=h[xi+1]:
        step +=1
        if mstep<step:
            mstep = step
    # else:
    #     if mstep<step:
    #         mstep = step
    #         step = 0

if mstep<step:
    mstep = step

print(mstep)
# Judge status: Accepted
a, b = map(int, input().split())
if b < 0:
    if (b-a+1)%2 == 0:
        print('Positive')
    else:
        print('Negative')
elif a <= 0 and 0 <= b:
    print('Zero')
else:
    print('Positive')
# Judge status: Accepted
N, M = map(int, input().split())
xy = [list(map(int, input().split())) for _ in range(M)]

exred = [i == 0 for i in range(N)]
n_ball = [1] * N

for i, (xi, yi) in enumerate(xy):
    exred[yi - 1] = exred[xi - 1] | exred[yi - 1]
    n_ball[xi - 1] -= 1
    n_ball[yi - 1] += 1
    if n_ball[xi - 1] == 0: exred[xi - 1] = False

ans = sum([int(item == True) for item in exred])
print(ans)
# Judge status: Accepted
s=input()
if len(set(s))==len(s):
  print("yes")
else:
  print("no")
# Judge status: Accepted
import math

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

Money=1000
Kabu=0

def MoneyWar(Money,Kabu,A,N):
  for i in range(N-1):
    if A[i]<A[i+1]:
      Kounyu=math.floor(Money/A[i])
      Money-=A[i]*Kounyu
      Kabu+=Kounyu

    if A[i]>A[i+1]:
      Money+=Kabu*A[i]
      Kabu=0

      
  if Kabu>0:
    Money+=Kabu*A[-1]
    
  return Money

print(MoneyWar(Money,Kabu,A,N))
# Judge status: Accepted
N = int(input())
number = list(map(int,input().split()))
number.sort(reverse=True)
a = int((N/2)-1)
b = int(N/2)
print(number[a]-number[b])
# Judge status: Wrong Answer
import math
N, M = map(int, input().split())

if N == 1:
  print(M)
  exit()

ans = 1

for a in range(1, int(math.sqrt(M))+1):
  if M % a != 0:
    continue

  if a * N <= M:
    ans = max(ans, a)

print(ans)
# Judge status: Accepted
n = int(input())
l0 = 2
l1 = 1
for i in range(n - 1):
  l0, l1 = l1, l0 + l1
print(l1)
# Judge status: Accepted
n = int(input())
p = list(map(int,input().split()))

cnt = 0
tmp = -1
for i in range(n):
  if p[i] == i+1:
    if i+1 == tmp+1:
      cnt+=0
      tmp = -1     
    else:
      cnt+=1
      tmp = i+1
print(cnt)
# Judge status: Accepted
# -*- coding: utf-8 -*-
import sys


def input():
    return sys.stdin.readline().strip()


N = int(input())
DATA = [list(map(int, input().split())) for i in range(N)]

dp = [[0 for _ in range(3)] for _ in range(N + 1)]

for i in range(N):
    for j in range(3):
        for k in range(3):
            if j == k:
                continue
            dp[i + 1][k] = max(dp[i + 1][k], dp[i][j] + DATA[i][k])

res = 0

for v in range(3):
    res = max(res, dp[N][v])

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

rc = s.count('R')
gc = s.count('G')
bc = s.count('B')
ans = rc * gc * bc

for i in range(n-1):
  for j in range(i+1,n):
    k = j*2 - i
    if k >= n:
      continue
    if len(set([s[i],s[j],s[k]])) == 3:
      ans -= 1
      
print(ans)
# Judge status: Wrong Answer
import sys
n, m = map(int, input().split())
 
g = [[] for _ in range(n)]
for _ in range(m):
    u, v = map(int, input().split())
    g[u-1].append(v-1)
    g[v-1].append(u-1)

print(g)
N = n-1
for i in g[0]:
    if N in g[i]:
        print('POSSIBLE')
        sys.exit()

print('IMPOSSIBLE')
# Judge status: Accepted
N, M = map(int, input().split())
if N * 2 > M:
    print(M // 2)
else:
    print(N + (M - 2 * N) // 4)
# Judge status: Accepted
n = int(input())
s = []
d = {}
for i in range(n):
	x = input()
	l = list(x)
	list.sort(l)
	ll = "".join(l)
	if ll in d:
		d[ll] += 1
	else:
		d[ll] = 1

ans = 0
for i in d:
	ss = d[i]
	if d[i] >= 2:
		ans += ss*(ss-1)/2
print (int(ans))
# Judge status: Accepted
#!/usr/bin/env python3
# -*- coding: utf-8 -*-


def main():
    ABC = list(map(int, input().split()))
    ABC.sort()
    print(int(int(ABC[0]) * int(ABC[1]) / 2))


if __name__ == "__main__":
    main()
# Judge status: Accepted
import sys

s = sys.stdin.readline()
if s[2] == s[3] and s[4] == s[5]:
  sys.stdout.write("Yes")
else:
  sys.stdout.write("No")
# Judge status: Accepted
N, X, Y= map(int, input().split()) 
Count = [0]*(N-1)
  

for i in range(1, N):
  for j in range(i+1, N+1):
    Count[min(j-i, (abs(i-X) +abs(j-Y) +1),  (abs(i-Y) +abs(j-X) +1))-1] += 1

for i in range(N-1):
  print(Count[i])
# Judge status: Wrong Answer
n,k = map(int,input().split())
A = list(map(int,input().split()))

L = []
ave = sum(A[:k])

L.append(ave)

for i in range(n-k-1):
    #print(A[i],A[k+i])
    ave = ave - A[i] + A[k+i]
    L.append(ave)

for i in range(len(L)-1):
    if L[i] < L[i+1]:
        print("Yes")
    else:
        print("No")
# Judge status: Accepted
a,b = map(int, input().split())
if (a * b) % 2 == 0:
  print("Even")
else:
  print("Odd")
# Judge status: Wrong Answer
a, b = map(int, input().split())
print(a * (a + 1) / 2 + b)
# Judge status: Wrong Answer
a,b,c = map(int, input().split())
print(['No', 'Yes'][a<c and c<=b])
# Judge status: Accepted
S=input()
print("vowel" if S=="a" or S=="i" or S=="u" or S=="e" or S=="o" else "consonant")
# Judge status: Accepted
import numpy as np
k = int(input())
s = input()
if len(s) <= k:
  print(s)
else:
  print("{}...".format(s[:k]))
# Judge status: Wrong Answer
import math
N = int(input())
number = math.ceil((N * 2) ** 0.5)
if number * (number + 1) // 2 == N:
    answers = [n for n in range(1, number + 1)]
    for answer in answers:
        print(answer)
else:
    whole=number*(number+1)//2
    sa=whole-N
    answers = [n for n in range(1, number + 1)]
    for answer in answers:
        if answer == sa:
            continue
        print(answer)
# Judge status: Accepted
n = int(input())
 
dp = [float("inf")] * (n + 1)
 
dp[0] = 0
 
for i in range(n):
    six = 1
    while i + six <= n:
        dp[i + six] = min(dp[i + six], dp[i] + 1)
        six *= 6
 
    nine = 1
    while i + nine <= n:
        dp[i + nine] = min(dp[i + nine], dp[i] + 1)
        nine *= 9
 
print(dp[n])
# Judge status: Accepted
sx,sy,tx,ty=map(int,input().split())

dx=tx-sx
dy=ty-sy
r="U"*dy+"R"*dx
r=r+"D"*dy+"L"*dx
r=r+"L"+"U"*(dy+1)+"R"*(dx+1)+"D"
r=r+"R"+"D"*(dy+1)+"L"*(dx+1)+"U"

print(r)
# Judge status: Wrong Answer
N,A,B = [int(x) for x in input().split()];

l = max(A-1,B-1);
r = max(N-B,N-A);
if (B-A)%2 == 0 :
    print(min(int((B-A)/2),l,r));
else :
    print(min(l,r));
# Judge status: Accepted
from collections import Counter

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

c=Counter(a)
ans=0
for i in c.keys():
  ans+=(c[i]*(c[i]-1))//2

for i in a:
  print(ans-c[i]+1)
# Judge status: Wrong Answer
a=int(input())
list=[]
for i in range(11,1,-1):
  b = a // (26**i)
  a = a - b*(26**i)
  list.append(b)
for i,k in zip(list,range(len(list))):
  list[k]=chr(i+96)
result=''.join(list)
print(result.replace("`",''))
# Judge status: Accepted
N = int(input())
A = sorted(int(a) for a in input().split())

# エラトステネスの篩
max_A = A[-1]
search_list = [True for _ in range(max_A)]

count = 0
for i, a in enumerate(A):
    if not search_list[a - 1]:
        continue
    for j in range(a, max_A + 1, a):
        search_list[j - 1] = False
    if i < N - 1 and A[i + 1] == a:
        continue
    count += 1

print(count)
# Judge status: Wrong Answer
import bisect

N = int(input())
L = [int(input()) for _ in range(N)]
Q = []

for l in L:
    if len(Q) == 0:
        Q.append(l)
    else:
        Q = sorted(Q)
        r = bisect.bisect_left(Q, l)
        if r == 0:
            Q.append(l)
            Q = sorted(Q)
        else:
            Q[-1] = l
print(len(Q))
# Judge status: Wrong Answer
L, R, d = map(int, input().split())
count = 0
for i in range(L, R + 1):
  if i // d == 0:
    count += 1
    
print(count)
# Judge status: Wrong Answer
from collections import deque


k = int(input())
d = deque([1,2,3,4,5,6,7,8])

for i in range(k):
    a = d.popleft()
    d.append(i*10 + i % 10 - 1)
    d.append(i*10 + i % 10)
    if a != 9:
        d.append(i*10 + i % 10 + 1)

print(a)
# Judge status: Wrong Answer
l = list(map(str, input()))

if len([x for x in set(l) if l.count(x) > 1]) > 0:
  print('yes')
else:
  print('no')
# Judge status: Wrong Answer
N = int(input())
A = list(map(int, input().split()))
ans = 0
l_1 = []
l_2 = []

for i in range(N):
  if A[i] < (10**5)*2:
    l_1.append(A[i]+i)
    l_2.append(i-A[i])
  
for num in range(2, max(l_2)+1):
  ans += l_1.count(num)*l_2.count(num)
      
print(ans)
# Judge status: Accepted
from itertools import product
A,B,C,D = list(input())
for x in product(("+","-"),repeat=3):
    if eval(A+x[0]+B+x[1]+C+x[2]+D)==7:
        print(A+x[0]+B+x[1]+C+x[2]+D+"=7")
        break
# Judge status: Accepted
a,b=map(int,input().split())
n=b-a
high=1
for i in range(2,n):
    high+=i

print(high-a)
# Judge status: Wrong Answer
N = int(input())
P = list(map(int, input().split()))
ans = 0

for i in range(N-1):
  if P[i] == i+1:
    P[i], P[i+1] = P[i+1], P[i]
    ans += 1

print(ans)
# Judge status: Accepted
def resolve():
    N, K = map(int, input().split())
    S = input()
    print(S[:K-1]+str.lower(S[K-1])+S[K:N])
resolve()
# Judge status: Accepted
O = input()
E = input()
result = ""
for i in range(len(E)):
  result += O[i] + E[i]
print(result if len(O) == len(E) else result+O[-1])
# Judge status: Accepted
N = int(input())
count = 0
flg = False
for i in range(N):
    
    d1,d2 = map(int,input().split())
    if d1 == d2:
        count += 1
        if count ==3:
            flg = True
    else:
        count = 0
if flg:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
s = input()
i, j = 0, len(s)-1
while(1):
    if s[i] == "A":
        start = i
        break
    i += 1
while(1):
    if s[j] == "Z":
        end = j + 1
        break
    j -= 1
print(s[start:end])
# Judge status: Accepted
N,M,Q=map(int,input().split())
L = []
for i in range(Q):
  L.append(list(map(int, input().split())))
  L[i][0]-=1
  L[i][1]-=1

import itertools

l =list(range(1,M+1))
ans=0

v=list(itertools.combinations_with_replacement(l,N))

for arr in v:
  score=0
  for a,b,c,d in L:
    if (arr[b] - arr[a])==c:
      
      score+=d
  ans=max(ans,score)
print(ans)
# Judge status: Accepted
S = input()
ans = 'x'*len(S)
print(ans)
# Judge status: Accepted
n=int(input())
x=[10000]*(n+2)
x[0]=0
a=[6**i for i in range(1,7)]
b=[9**i for i in range(1,6)]
c=[1]
c=a+b+c
c.sort()
for i in range(1,n+2):
    for j in c:
        if i-j>=0:
            x[i]=min(x[i],x[i-j]+1)
        else:
            break
print(x[n])
# Judge status: Accepted
N = int(input())

lstI = list(map(int, input().split()))
sortedList = sorted(lstI)

count = 0
for i in range(0, len(lstI)):
    if lstI[i] != sortedList[i]:
        count += 1

print("YES" if count == 2 or count == 0 else "NO")
# Judge status: Accepted
def prime_decomposition(n):
  i = 2
  table = []
  while i * i <= n:
    while n % i == 0:
      n //= i
      table.append(i)
    i += 1
  if n > 1:
    table.append(n)
  return table

N = int(input())
from collections import Counter
c = Counter(prime_decomposition(N))
ans = 0
for i in c:
    k = 1
    while(c[i]-k>=0):
        if c[i]>0:
           c[i] -= k
           ans += 1
           k += 1
print(ans)
# Judge status: Accepted
N = int(input())
numbers = [int(x) for x in input().split()]

negative_sign_count = len([x for x in numbers if x < 0])
abs_numbers = [abs(x) for x in numbers]
abs_numbers.sort()

# 負の数が偶数 or 0を含む場合はすべての符号を正に反転できる
if negative_sign_count % 2 == 0 or 0 in numbers:
  print(sum(abs_numbers))
# それ以外はひとつだけ正にできない数があるので、絶対値が一番小さい数を負にする
else:
  print(sum(abs_numbers[1:]) - abs_numbers[0])
# Judge status: Wrong Answer
S = input()
T = input()

if S == T[:len(T)-1] and len(S) == len(T) - 1:
    print("Yse")
else:
    print("No")
# Judge status: Wrong Answer
from sys import stdin


if __name__ == "__main__":
    _in = [_.rstrip() for _ in stdin.readlines()]
    N = int(_in[0])  # type:int
    T, A = list(map(int,_in[1].split(' ')))  # type:list(int)
    H_arr = list(map(int,_in[2].split(' ')))  # type:list(int)
    # vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
    x = (T-A)/0.006
    diff = [h-x for h in H_arr]
    cnt = diff.index(min(diff))+1
    # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    print(cnt)
# Judge status: Wrong Answer
x = int(input())
y = [int(z) for z in input().split()]
m = 100000000000000
s = sum(y)
for i in y:
      m = min(m, abs(s-i))
      s=s-i
print(m)
# Judge status: Accepted
n=int(input())
a=[0]*(n)
b=[0]*(n)
c=[0]*(n)
for _ in range(n):
    a[_],b[_],c[_]=map(int,input().split())

dp=[[0]*3 for _ in range(n)]

dp[0] = [a[0],b[0],c[0]]

for i in range(n-1):
    dp[i+1][0]=max(dp[i][1]+a[i+1], dp[i][2]+a[i+1])
    dp[i+1][1]=max(dp[i][0]+b[i+1], dp[i][2]+b[i+1])
    dp[i+1][2]=max(dp[i][0]+c[i+1], dp[i][1]+c[i+1])
print(max(dp[n-1]))
# Judge status: Accepted
X=int(input())
MAX=2*int(X**(1/5))+1
MIN=-2*int(X**(1/5))-1
for A in range(MIN,MAX):
    for B in range(MIN,MAX):
        if A**5-B**5==X:
            print(A,B)
            exit()
# Judge status: Wrong Answer
a, b = map(int, input().split())
print(a,b)

answer = a * b

print(answer)
# Judge status: Accepted
N, M = map(int, input().split())
l = input().split()
l = [int(i) for i in l]  
l.sort(reverse=True)
val = sum(l)
deadline = val/(4*M)
if l[M-1] >= deadline:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
n = int(input())
x0 = 0
y0 = 0
x1 = 1
y1 = 10 ** 9
x2 = (n - 1) // y1 + 1
y2 = (y1 - n) % y1
print(x0, y0, x1, y1, x2, y2)
# Judge status: Accepted
import sys
n,m = map(int,input().split())
ls = list(map(int,input().split()))
ls.sort()
if n >= m:
    print(0)
    sys.exit()
for i in range(m-1):
    ls[i] = ls[i+1]-ls[i]
del ls[-1]
ls.sort()
if n == 1:
    print(sum(ls))
else:
    ls = ls[:-(n-1)]
    print(sum(ls))
# Judge status: Wrong Answer
N=int(input())
S=input()
for i in range(len(S)):
  s=ord(S[i])+2
  print(chr(s) if s<=ord("Z") else chr(s-(ord("Z")-ord("A"))-1))
# Judge status: Accepted
import heapq
N, M = map(int, input().split())
a = list(map(int, input().split()))
bc = [list(map(int, input().split())) for _ in range(M)]
heapq.heapify(a)
bc = sorted(bc, reverse=True, key=lambda x: x[1])
for i in range(M):
    count = 0
    while True:
        t = heapq.heappop(a)
        if t >= bc[i][1] or bc[i][0] <= count:
            heapq.heappush(a,t)
            break
        else:
            count += 1
            heapq.heappush(a,bc[i][1])
print(sum(a))
# Judge status: Accepted
a, b = map(int, input().split())

if a == 1 and b == 1:
    print(1)
elif a ==1 or b == 1:
    print(a * b - 2)
else:
    print((a - 2) * (b - 2))
# Judge status: Accepted
"""
author : halo2halo
date : 4, Feb, 2020
"""

import sys
import itertools

# import math

# import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
INF = 10 ** 9

S = readline().decode('utf8').rstrip()

f0 = S[::2].count('0') + S[1::2].count('1')
f1 = S[::2].count('1') + S[1::2].count('0')
print(min(f0, f1))
# Judge status: Wrong Answer
N = int(input())
S = list(map(int, input().split()))
for a in range(N-1):
    if S[a] > S[a+1]:
        if S[a] - S[a+1] <= 1:
            continue
        else:
            print("No")
            exit()
for a in range(N-2):
    if S[a] > S[a+2]:
        if S[a] - S[a+2] <= 1:
            continue
        else:
            print("No")
            exit()

print("Yes")
# Judge status: Wrong Answer
n = int(input())
list = list(map(int,input().split()))

ans = 0
for i,ele in enumerate(list):
    if i == 0:
        continue
    elif i == len(list)-1:
        continue

    if ele > list[i+1]:
        ans = ans +  ele - list[i+1] + 1

print(ans)
# Judge status: Accepted
N=int(input())
s=[int(input()) for _ in range(N)]
count=0
flag=0
max=sum(s)
s.sort()
if not(max%10==0):
 print(max)
 flag=1
else:
 for i in range(0,N):
  if not((max-s[i])%10==0):
   print(max-s[i])
   flag=1
   break
if flag==0:
 print("0")
# Judge status: Accepted
#10
n = int(input())
a = list(map(int,input().split()))
cnt = [0 for i in range(10**5+2)]

for i in a:
    cnt[i] += 1
    cnt[i+1] += 1
    cnt[i+2] += 1
    
print(max(cnt))
# Judge status: Wrong Answer
def divide(n):
    k = 2
    while k**2 <= n:
        if n % k == 0:
            return k, n // k
        if k == 2:
            k += 1
        else:
            k += 2
    return 1, n


def main():
    S = int(input())
    a, b = divide(S)
    print(' '.join(map(str, [0, 0, 0, a, b, 0])))


if __name__ == '__main__':
    main()
# Judge status: Accepted
N=int(input())
K=int(input())
X=int(input())
Y=int(input())
if K>N:
    print(X*N)
else:
    print(X*K+Y*(N-K))
# Judge status: Wrong Answer
n = int(input())
time=0
alist=[]
ans='Yes'
for i in range(n):
  a,b=map(int, input().split())
  alist.append([a,b-a])
  if b<a:
    ans='No'
alist.sort(key=lambda x: x[1])
time=0
for i in range(n):
  print(time)
  if time>alist[i][1]:
    ans='No'
  time+=alist[i][0]
print(ans)
# Judge status: Accepted
r, g, b= map(int, input().split())
if (g*10+b)%4==0:
    print('YES')
else:
    print('NO')
# Judge status: Accepted
from collections import Counter
N = int(input())
s = [input() for _ in range(N)]
#a = list(map(int, input().split()))

c = Counter(s)


imax = len

values, counts = zip(*c.most_common())

for i in range(len(counts)):
    if counts[0]==counts[i]:
        imax = i

value = [values[i] for i in range(imax+1)]
value.sort()
print(*value, sep='\n')
# Judge status: Accepted
n = int(input())
ans=''
while(n>0):
     n -= 1
     ans += chr(ord('a')+n%26)
     n //= 26
print(ans[::-1])
# Judge status: Accepted
n = int(input())
s = input()
if n%2==0:
    print('Yes' if s[:int(n/2)]==s[int(n/2):] else 'No')
else:
    print('No')
# Judge status: Wrong Answer
N = int(input())
K = int(input())
X = int(input())
Y = int(input())
KX = K * X
NY = (N - K) * Y
print(KX + NY)