peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
n = int(input())
v = list(map(float, input().split()))
v.sort()

for _ in range(n-1):
    v[1] = (v[0]+v[1])/2
    v.pop(0)
print(v[0])
# Judge status: Accepted
import math
import sys
readline = sys.stdin.readline


def main():
    n = int(readline().rstrip())

    for i in range(50001):
        k = math.floor(i * 1.08)
        if n == k:
            print(i)
            return
    print(':(')


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
# -*- coding:utf-8 -*-

n = int(input())
t, x, y = [0], [0], [0]
for i in range(n):
  t_i, x_i, y_i = map(int, input().strip().split())
  t.append(t_i)
  x.append(x_i)
  y.append(y_i)
  
can = "YES"
for i in range(n):
  dt = t[i+1] - t[i]
  dist = abs(x[i+1] - x[i]) + abs(y[i+1] - y[i])
  if (dt < dist):
    can = "NO"
  if(dist % 2) != (dt % 2):
    can = "NO"
print(can)
# Judge status: Wrong Answer
N,W = map(int,input().split())
A = [list(map(int, input().split())) for i in range(N)]
dp = [[0 for _ in range(W+1) ] for _ in range(N + 1)] 

for i in range(1,N + 1): 
    for j in range(W + 1): 
        if j - A[i-1][0] >= 0:
            dp[i][j] = dp[i - 1][j - A[i-1][0]] + A[i - 1][1]
        else:
            dp[i][j] = dp[i-1][j]
#print(dp)
print(max(dp[N]))
# Judge status: Accepted
N,K=map(int,input().split())
R,S,P=map(int,input().split())
L=input()
T=[]
for i in range(N):
    T.append(L[i])
for i in range(K,N):
    if T[i]==T[i-K]:
        T[i]="0"
p=0
for i in T:
    if i=="r":
        p+=P
    elif i=="s":
        p+=R
    elif i=="p":
        p+=S
print(p)
# Judge status: Wrong Answer
import numpy as np
a, b = map(int, input().split())
print(np.ceil(a+b/2))
# Judge status: Accepted
A, B = map(int, input().split())
count, outlet = 0, 1
while outlet < B:
    outlet = outlet-1
    outlet = outlet+A
    count = count+1
print(count)
# Judge status: Accepted
def main():
  import collections
  import sys
  input = sys.stdin.readline
  n = int(input())
  b = []
  for i in range(n):
    a = int(input())
    b_append = b.append
    b_append(a)

  s = set(b)
  s = tuple(s)
  c = collections.Counter(b)
  ans = 0
  for i in range(len(s)):
    if c[s[i]] % 2 == 0:
      continue
    else:
      ans += 1
  print(ans)
if __name__ == '__main__':
    main()
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))
l=[0 for i in range(n)]
for i in a:
  l[i-1]+=1

for i in l:
  print(i)
# Judge status: Accepted
N = int(input())
W = ['0'] * N
for i in range(N):
    W[i] = input()
if len(set(W)) != N:
    print("No")
    exit()
k = W[0][-1]
for i in range(1,N):
    if W[i][0] != k:
        print("No")
        exit()
    k = W[i][-1]
print("Yes")
# Judge status: Wrong Answer
x = int(input())

num = 1

while num**2+num < 2*x:
    print(num,num**2-num)
    num += 1

print(num)
# Judge status: Accepted
s = input()
if 'a' in s and 'b' in s and 'c' in s:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
n,k=map(int,input().split())
get_score=list(map(int,input().split()))
t=list(input())
dic={'r':0,'s':1,'p':2}

ans=0
for i in range(n):
    if t[i]=='D':continue
    if i+k<n and t[i]==t[i+k]:
        t[i+k]='D'
    ans+=get_score[(dic[t[i]]+2)%3]

print(ans)
# Judge status: Accepted
n,m=map(int,input().split())
a=[]
b=[]
ans=False
for _ in range(n):
    a.append(input())
for _ in range(m):
    b.append(input())
for i in range(n-m+1):
    for j in range(n-m+1):
        for k in range(m):
            if a[i+k][j:j+m]!=b[k]:
                break
            if k==m-1:
                ans=1
    if ans==1:
        break
print('Yes') if ans==1 else print('No')
# Judge status: Wrong Answer
from collections import defaultdict
N, M = map(int, input().split())
d = defaultdict(int)
for _ in range(M):
    a, b = map(int, input().split())
    d[a] += 1
    d[b] += 1

for i in d.values():
    print(i)
# Judge status: Accepted
from math import factorial

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

num_k=0
num_g=0
for i in range(N):
    if A[i]%2==0:
        num_g+=1
    else:
        num_k+=1

n=num_k//2
ans_k=0
for i in range(0,n*2+1,2):
    ans_k+=factorial(num_k)/factorial(i)/factorial(num_k-i)

ans_g=2**(num_g)

ans=int(ans_k*ans_g)

if P==0:
    print(ans)
else:
    ans=2**N-ans
    print(ans)
# Judge status: Accepted
n = int(input())
p = tuple(map(int, input().split()))

cnt = 0
for i in range(1, n+1):
    if i != p[i-1]:
        cnt += 1

if cnt > 2:
    print("NO")
else:
    print("YES")
# Judge status: Wrong Answer
S,T=map(str,input().split())
print(S+T)
# Judge status: Accepted
n = int(input())
ans = 0
lst = []
for i in range(1,n+1):
  ans += i
  lst.append(i)
  if ans>=n:
    break
  
num = ans-n
if num != 0:
  lst.remove(num)

L =len(lst)
for i in range(L):
  print(lst[i])
# Judge status: Accepted
N = int(input())
H = list(map(int,input().split()))
can = True

for i in reversed(range(1,N)):
    if H[i - 1] - 1 == H[i]:
        H[i - 1] -= 1
    elif H[i - 1] - 1 > H[i]:
        can = False
        break

print(['No', 'Yes'][can])
# Judge status: Wrong Answer
import sys
sys.setrecursionlimit(10 ** 5 + 10)
def input(): return sys.stdin.readline().strip()

def resolve():

    L=list(map(int,input().split()))
    prod=L[0]*L[1]*L[2]
    ans=10**9
    for i in L:
        if i%2==0:
            ans= 0
            break
        else:
            ans=min(ans,prod//i)
    print(ans)


resolve()
# Judge status: Accepted
N,K=map(int,input().split())
D=[int(x) for x in input().split()]
D=set(D)
kouho=N
while(1):
    lenkouho=len(str(kouho))
    flag=1
    for i in range(lenkouho):
        if int(str(kouho)[i]) in D:
            flag=0
    if flag==1:
        print(kouho)
        break
    kouho+=1
# Judge status: Accepted
a,b,c = map(int,input().split())

print(int((a * b) / 2))
# Judge status: Accepted
N=int(input())
A=list(map(int,input().split()))
A.sort(reverse=True)

Alice=A[::2]
Bob=A[1::2]
print(sum(Alice)-sum(Bob))
# Judge status: Accepted
n=int(input())
l=[]
for i in range(1,n+1):
  t=list(str(i))
  l.append((t[0],t[-1]))
ans=0
for i in range(1,10):
  for j in range(1,10):
    ans+=l.count((str(i),str(j)))*l.count((str(j),str(i)))
print(ans)
# Judge status: Wrong Answer
N = int(input().rstrip())
line = input().rstrip()
l = [int(v) for v in line.split()]
l.sort()
uniq_list = sorted(list(set(l)))
result = 0
cur_i = 0
for i in range(len(uniq_list)):
    for j in range(cur_i, len(l)):
        if uniq_list[i] == l[j]:
            if (N / 2) == j:
                result = uniq_list[i] - uniq_list[i - 1]
                break
            else:
                cur_i = j + 1

print(result)
# Judge status: Wrong Answer
S = list(input())
count = 0
ans = 0
for w in S:
    if w == 'R':
        count += 1
    else:
        if count > ans:
            ans = count
        count = 0
print(ans)
# Judge status: Accepted
N=int(input())
l=["a","b","c","d","e","f","g","h","i","j"]
def hu(t,c,n):
    if n<N:
        for i in range(0,c):
            hu(t+[i],c,n+1)
        hu(t+[c],c+1,n+1)
    else:
        pr(t)
def pr(t):
    for i in t:
        print(l[i],end="")
    print()
hu([0],1,1)
# Judge status: Accepted
A=list(map(int,input().split()))
a=A[0]
b=A[1]
count=0
i=1
while i<b:
    count=count+1
    i=i+a-1
print(count)
# Judge status: Wrong Answer
r = int(input())

ma = r * 2 * 3.1415
# Judge status: Accepted
from sys import stdin
nii=lambda:map(int,stdin.readline().split())

n,m=map(int,input().split())
a=sorted(list(nii()))
l=[list(nii()) for i in range(m)]
l=sorted(l,key=lambda x:x[1],reverse=True)

man=[]
num=0
for b,c in l:
  man+=[c]*b
  num+=b
  if num>n:
    break

ans=0
for i in range(n):
  if i<num:
    ans+=max(a[i],man[i])
  else:
    ans+=a[i]
print(ans)
# Judge status: Accepted
d,t,s=map(int,input().split())
if d/s<=t:print("Yes")
else:print("No")
# Judge status: Accepted
import sys


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


MOD = 10 ** 9 + 7
sys.setrecursionlimit(20000000)
INF = float("inf")


def main():
    K = int(input())
    S = list(input())
    if len(S) <= K:
        print(*S, sep="")
    else:
        answer = S[:K] + ["..."]
        print(*answer, sep="")


if __name__ == "__main__":
    main()
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))

x,y,z = 0,0,0
for i in a:
  if i%4 == 0: x += 1
  elif i%2 == 0: y += 1
  else: z += 1
    
if x >= z-1+y%2: print("Yes")
else: print("No")
# Judge status: Accepted
def main():
    N = int(input())
    S = list(input())

    flag = False

    for i in range(N):
        T1 = S[:i]
        T2 = S[i:N]

        if(T1 == T2):
            flag = True
            #print('Yes')
            break

        # print(T1)
        # print(T2)
    if(flag):
        print('Yes')
    else:
        print('No')
if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
n,k=map(int,input().split())
A=list(map(int,input().split()))
A=[0]+A
B=[]
C=[0]+[-1]*n
now_city=1
seen=set()

#【ループ回数】200000
for i in range(1,len(A)):
    print("Baah")
# Judge status: Accepted
n, m, X, Y = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))

x.sort()
y.sort()

for z in range(X+1, Y):
    if x[n-1] < z  <= y[0]:
        print("No War")
        exit()
print("War")
# Judge status: Accepted
import sys
s = input()
for i in range(8):
    siki = s[0]
    tmp = int(s[0])
    for j in range(3):
        if i&(1<<j):
            siki = siki+'+'+s[j+1]
            tmp+=int(s[j+1])
        else:
            siki = siki + '-' + s[j+1]
            tmp-=int(s[j+1])
    if tmp==7:
        print(siki,"=7",sep="")
        exit()
# Judge status: Accepted
a, b, c, k = map(int, input().split())

ans = 0

ans += min(a, k) - min(c, max(0, k-a-b))

print(ans)
# Judge status: Accepted
def lucas(n):
    global nlist
    if n==0:
        return 2
    if n==1:
        return 1
    if nlist[n]!=0:
        return nlist[n]
    else:
        nlist[n]=lucas(n-1)+lucas(n-2)
        return lucas(n-1)+lucas(n-2)
    
nlist=[0 for a in range(100)]
print(lucas(int(input())))
# Judge status: Accepted
a = int(input())
if 400<=a and a<=599:
  print(8)
elif 600<=a and a<=799:
  print(7)
elif 800<=a and a<=999:
  print(6)
elif 1000<=a and a<=1199:
  print(5)
elif 1200<=a and a<=1399:
  print(4)
elif 1400<=a and a<=1599:
  print(3)
elif 1600<=a and a<=1799:
  print(2)
elif 1800<=a and a<=1999:
  print(1)
# Judge status: Accepted
a = int(input())

print(a + a ** 2 + a ** 3)
# Judge status: Accepted
def solve(N, W, weight_values):
  dp = [0 for _ in range(W + 1)]

  for i in range(N):
    i_weight, i_value = weight_values[i]
    for w in range(W, i_weight - 1, -1):
      # dp[w] = max(dp[w - i_weight] + i_value, dp[w])
      temp = dp[w - i_weight] + i_value
      if temp > dp[w]:
        dp[w] = temp

  print(dp[W])

  
def iln(): return list(map(int, input().split()))


N, W = iln()
w_v = []
for i in range(N):
  w_v.append(iln())
  
solve(N, W, w_v)
# Judge status: Wrong Answer
N, L = map(int, input().split())

s = ((L+1-1) + (L+N-1))*N // 2

if L > 0:
    print(s - 2)
else:
    if L+N-1 >= 0:
        print(s)
    else:
        print(s - (L+N-1))
# Judge status: Wrong Answer
S=list(input())
A=list("keyence")
 
import sys
while True:
  s = S.pop(0)
  if s == A[0]:
    A.pop(0)
  else:
    pass
  if len(A) == 0:
    print("YES")
    sys.exit()
  if len(S) == 0:
    print("NO")
    sys.exit()
# Judge status: Accepted
#!/usr/bin/env python3


def main():
    A, B, M = map(int, input().split())
    a = list(map(int, input().split()))
    b = list(map(int, input().split()))

    min_cost = min(a) + min(b)
    for i in range(M):
        x, y, c = map(int, input().split())
        cost = a[x - 1] + b[y - 1] - c
        if min_cost > cost:
            min_cost = cost

    print(min_cost)


if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
x, y, na, nb, nc = map(int, input().split()) 
a = [int(i) for i in input().split()]
b = [int(i) for i in input().split()]
c = [int(i) for i in input().split()]
a.sort(reverse=True)
b.sort(reverse=True)
c.sort(reverse=True)

a = a[:x]
b = b[:y]

ai = len(a) - 1
bi = len(b) - 1
for i in c:
    if i > a[ai]:
        a[ai] = i
        bi -= 1
    elif i > b[bi]:
        b[bi] = i
        bi -= 1
    else:
        break
print(sum(a)+sum(b))
# Judge status: Wrong Answer
s = "This is a pen."
n = 1
m = 4
print(s[n-1:n-1+m])  # 'This'
print(s[0:4])  # 'This'
print(s[-4:-1])  # 'pen'
# Judge status: Accepted
# coding: utf-8


def solve(*args: str) -> str:
    k = int(args[0])
    S = args[1]

    return S if len(S) <= k else S[:k]+'...'


if __name__ == "__main__":
    print(solve(*(open(0).read().splitlines())))
# Judge status: Wrong Answer
s = input()
print('ABC' if s == 'ARC' else 'ABC')
# Judge status: Accepted
N = list((input()))

if N[0] == N[1] and N[1] == N[2] or N[-1] == N[-2] == N[-3]:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
input_line = input()
input_num = len(input_line)
ans = 'Yes'
num = 0
for i in range(input_num):
  if num == 0:
    if input_line[i] == 'h':
      if i + 1 < input_num:
        if input_line[i + 1] == 'i':
          num = 1
          ans = 'Yes'
        else:
          ans = 'No'
    else:
      ans = 'No'
  else:
    num = 0
print(ans)
# Judge status: Accepted
n,k=map(int,input().split())
a=list(map(int,input().split()))

for i in range(n-k):
    if a[i]<a[i+k]:
        print('Yes')
    else:
        print('No')
# Judge status: Accepted
#import sys
#import numpy as np
import math
#from fractions import Fraction
import itertools
from collections import deque
from collections import Counter
#import heapq
from fractions  import gcd
#input=sys.stdin.readline
import bisect
n=int(input())
s=list(input())
c=Counter(s)
c=c.values()
ans=1
mod=10**9+7
for i in c:
    ans*=(i+1)
    ans%=mod
print(ans-1)
# Judge status: Accepted
N, K = map(int, input().split())
R, S, P = map(int, input().split())
T = list(input())
score = {'r': P, 'p': S, 's': R}
ans = 0

for i in range(K):
    flag = True

    while i < N:
        if i >= K and T[i] == T[i-K]:
            flag = not flag
        else:
            flag = True

        if flag:
            ans += score[T[i]]

        i += K

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

import bisect
ans = 0
for i in b:
    A = bisect.bisect_left(a, i)
    C = n - bisect.bisect_right(c, i)
    ans += A * C
    
print(ans)
# Judge status: Wrong Answer
a1, a2, a3 = map(int,input().split())
if a1 + a2 + a3 <= 22:
    print('bust')
else:
    print('win')
# Judge status: Accepted
A, B = map(int, input().split())

A_min = 12.5 * A
A_max = 12.5 * (A + 1)

B_min = 10 * B
B_max = 10 * (B + 1)


if A % 2 == 0:
    myList1 = list(range(int(A_min), int(A_max + 1)))
else:
    myList1 = list(range(int(A_min + 1), int(A_max)))

myList2 = list(range(int(B_min), int(B_max)))

mySet = list(set(myList1) & set(myList2))

mySet = [item for item in mySet if item >= 1]

if len(mySet) == 0:
    print(-1)
else:
    print(sorted(mySet)[0])
# Judge status: Accepted
n, k = map(int, input().split())
r, s, p = map(int, input().split())
t = input()

def point(str):
  if str == "r":
    return p
  if str == "s":
    return r
  if str == "p":
    return s

total_point = 0
memory = [""] * k
for i in range(n):
  if t[i] != memory[i % k]:
    memory[i % k] = t[i]
    total_point += point(t[i])
  else:
    memory[i % k] = ""
print(total_point)
# Judge status: Accepted
from collections import defaultdict
N, K = map(int, input().split())
a = defaultdict(int)
for i in range(N):
  num, length = map(int, input().split())
  a[num] += length
num = list(a.keys())
num.sort()
cnt = 0
for i in range(len(num)):
  cnt += a[num[i]]
  if cnt >= K:
    break
print(num[i])
# Judge status: Accepted
n, a, b = (int(x) for x in input().split())
if (b - a) % 2 == 0:
	ans = (b-a) // 2
else:
	ans = min(a-1, n-b) + 1 + (b-a-1)//2
print(ans)
# Judge status: Accepted
n=int(input())
w=list(map(int,input().split()))
s=sum(w)
x=0
fin=1000
for i in range(n-1):
  x+=w[i]
  z=s-x
  con=abs(z-x)
  
  if con<fin:
    fin=con
    
print(fin)
# Judge status: Wrong Answer
a,b = map(int, input().split())
if a+b<=24: print(a+b)
else: print((a+b)//24)
# Judge status: Accepted
def f(a,b):
    if b:return f(b,a%b)
    p=set()
    for i in range(2,int(a**0.5)+1):
        while True:
            if a%i==0:
                a//=i
                p.add(i)
            else:
                break
    if a!=1:
        return len(p)+2
    return len(p)+1
print(f(*map(int,input().split())))
# Judge status: Accepted
a = input().split()

if a[0] == a[1] and a[1] == a[2]:
	print('No')
elif a[0] != a[1] and a[1] != a[2] and a[2] != a[0]:
	print('No')
else:
	print('Yes')
# Judge status: Accepted
x,y=map(int,input().split())
if x%y==0:
	print(-1)
else:
	print(x)
# Judge status: Wrong Answer
a,b = map(int, input().split())
if (a+b)%2==0:
  print((a+b)%2)
else:
  print("IMPOSSIBLE")
# Judge status: Accepted
x,a,b=map(int,input().split())
if (b-a)<=0:
    print("delicious")
else:
    if (b-a)<=x:
        print("safe")
    else:
        print("dangerous")
# Judge status: Accepted
n, m = map(int, input().split())
s = []
c = []
number = 100000
for i in range(m):
    x, y = map(int, input().split())
    s = s + [x]
    c = c + [str(y)]
for i in range(1000):
    count = 0
    i_list = list(str(i))
    if len(i_list) == n:
        for j in range(m):
            if i_list[s[j] - 1] != c[j]:
                count += 1
        if count == 0:
            number = i
            break
if number < 10000:
    print(number)
else:
    print('-1')
# Judge status: Wrong Answer
import math
N,D = map(int,input().split())
print(math.ceil(D/(N*2+1)))
# Judge status: Accepted
S=input()
L = len(list(S))
ans = ""

for i in range(L):
  ans = ans + "x"

print(ans)
# Judge status: Accepted
n,k=list(map(int,input().split()))
m=list(map(int,input().split()))

s=sum(m[:k])
mx=s
for i in range(1,n-k+1):
    s-=m[i-1]
    s+=m[i+k-1]
    mx=max(mx,s)
print((mx+k)/2)
# Judge status: Accepted
a, b, x= map(int, input().split())
if a <= x <= a + b:
  print('YES')
else:
  print('NO')
# Judge status: Wrong Answer
N = int(input())
T, A = map(int,input().split())
H = list(map(int,input().split()))

pointID = -1
min_diff = 9999999999

for i in range (N):
    #地点i の温度 と 平均気温の差(絶対値)
    diff = abs(T - 1000 * H[i] - A)

    if diff < min_diff:
        pointID = i+1
        min_diff = diff

print(pointID)
# Judge status: Wrong Answer
import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections
import copy
import bisect

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

if __name__ == "__main__":
    n,x = map(int,input().split())
    X = list(map(int,input().split()))
    X.sort()
    a = bisect.bisect_left(X,x)
    X.insert(a,x)
    ans = []
    for i in range(1,len(X)):
        diff = X[i] - X[i-1]
        ans.append(diff)
    print(min(ans))
# Judge status: Wrong Answer
import numpy as np

D, N = [int(i) for i in input().split()]

ans = (N+1)*10**(2*D)

print(ans)
# Judge status: Accepted
n = int(input())
a = [int(input()) for _ in range(n)]
ans = 0
cur_sum = 0  # 0が入るまでのsum
for i in range(n):
    if a[i] == 0:
        ans += cur_sum // 2
        cur_sum = 0
    else:
        cur_sum += a[i]
ans += cur_sum // 2
print(ans)
# Judge status: Wrong Answer
n = int(input()) - 1

num = 1
while 26**num < n:
    n -= 26**num
    num += 1

r = []
while 25 < n:
    r.append(n % 26)
    n //= 26

r.append(n)

if len(r) < num:
    for i in range(num - len(r)):
        r.append(0)

for i in r[::-1]:
    print(chr(97+i), end='')
# Judge status: Accepted
s=[input() for _ in range(int(input()))]
t=[input() for _ in range(int(input()))]
 
res=0
for i in set(s):
    res=max(s.count(i)-t.count(i),res)
print(res)
# Judge status: Accepted
W,H,N = map(int,input().split())

XW = [1] * W
YW = [1] * H

for i in range(N):
  x,y,a = map(int,input().split())
  if a == 1:
    XW[:x] = [0]*x
  elif a == 2:
    XW[x:] = [0]*(W-x)
  elif a == 3:
    YW[:y] = [0]*y
  elif a == 4:
    YW[y:] = [0]*(H-y)
print(sum(XW)*sum(YW))
# Judge status: Accepted
N = int(input())
a = list(map(int,input().split()))
a.insert(0,0)

counter = 0

for i in range(1,N+1,2):
    if a[i] % 2 == 1:
        counter += 1

print(counter)
# Judge status: Wrong Answer
checklist=["A","C","G","T"]
sn = list(input())

answer = 0
count = 0
for s in sn :
  if s in checklist:
    count += 1
  else :
    answer = max(answer,count)
    count = 0

print(answer)
print(sn)
# Judge status: Accepted
s = list(input());tmp = ""
t = ["maerd", "remaerd", "esare", "resare"]
while s:
    tmp += s.pop()
    if tmp in t: tmp = ""
if len(tmp)>=7: print("NO")
else: print("YES")
# Judge status: Accepted
txt = ""
num = (int)(input())
message = [[0 for i in range(26)] for j in range(num)]

for i in range(num):
  text = input()
  for j in text:
    #print(ord(j))
    message[i][ord(j) - 97] += 1
#print(message[0])
r_message = [[0 for i in range(num)] for j in range(26)]
for i in range(26):
  for j in range(num):
    r_message[i][j] = message[j][i]
#print(r_message)
for j in range(26):  
  for k in range(min(r_message[j])):
  	txt += chr(j + 97)
print(txt)
# Judge status: Accepted
import sys
n=int(input())
s=input()
if n%2==1:
    print("No")
    sys.exit()
s1=s[0:int(n/2)]
s2=s[int(n/2):]
if s1==s2:
    print("Yes")
else:
    print("No")
#print(s1)
#print(s2)
# Judge status: Accepted
n=int(input())
s=input()
m=n//2
print("Yes" if s==s[0:m]+s[0:m] else "No")
# Judge status: Wrong Answer
n = input()
mx = 0
for i in range(3):
    if int(n[i]) > mx: 
        mx = int(n[i])
print(str(mx)*3)
# Judge status: Wrong Answer
N = list(str(input()))
K = int((input()))

for i in range(len(N) - 1):
    if ord(N[i]) >= 98 and K >= 123 - int(ord(N[i])):
        K = K - (123 - ord(N[i]))
        N[i] = 'a'
a = ord(N[len(N)-1]) + K
if a > 122:
    b = (a - 98) % 25
    a = b + 97
N[len(N)-1] = chr(a)
for j in N:
    print(j, end='')
# Judge status: Accepted
import collections

i = int(input())
li = list(map(int,input().split()))
c = collections.Counter(li)
li = list(set(li))
li.sort(reverse=True)
ans = 1
x = 0
i = 0

for i in li:
    if c[i] > 3 and x == 0:
        ans = i**2
        x += 2
    elif c[i] > 1:
        ans *= i
        x += 1
    if x == 2:
        break

if x == 2:
    print(ans)
else:
    print(0)
# 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,B*C,C*A))
# Judge status: Accepted
def main():
    import sys
    a = input()
    ans =0
    for i in range(2**3):
        t = a[0]
        for j in range(3):
            if i & (1 <<j):
                t = t +'+'
            else:
                t = t +'-'
            t = t +a[j+1]
        ans =eval(t)
        if ans == 7:
            print(t+'=7')
            sys.exit()
if __name__ =='__main__':
    main()
# Judge status: Accepted
d = {}
n = int(input())

for i in range(n):
  x = input()
  if x in d:
    d[x] += 1
  else:
    d[x] = 1

mx = 0
ans = []

for itm in d.items():
  if itm[1] == mx:
    ans.append(itm[0])
  elif itm[1] > mx:
    ans = [itm[0]]
    mx = itm[1]
  else:
    continue

ans.sort()

for x in ans:
  print(x)
# Judge status: Wrong Answer
n, m = map(int, input().split())


m = (n-1) // 2
a = (n - 1) // 2
d = 1
memo = set([])
cnt = 0
for i in range(m):

    if (n - d in memo):
        cnt += 1
        d += 1
    memo.add(d)
    if cnt > 1 or a < 1 or a+d > n:
        print(1/0)
    print(a, a+d)
    a -= 1
    d += 2
# Judge status: Accepted
N =int(input())

d = {}

for word in input().split():
    if word in d:
        print("NO")
        exit()
    else:
        d[word] = 1

print("YES")
# Judge status: Wrong Answer
n=int(input())
vlis=list(map(int,input().split()))
while len(vlis)>=2:
	tlis=[]
	for i in range(len(vlis)-1):
		t=(vlis[i]+vlis[i+1])/2
		tlis.append(t)
	vlis.insert(tlis.index(min(tlis)),min(tlis))
	for i in range(2):
		vlis.pop(tlis.index(min(tlis))+1)
		
print(int(vlis[0]))