peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Wrong Answer
s=str(input())
x=0
for i in range(len(s)):
  if s.count(s[i])==0:
    x+=1
if x==len(s):
  print('yes')
else:
  print('no')
# Judge status: Accepted
P,Q,R=map(int,input().split())
print(P+Q+R-max(P,Q,R))
# Judge status: Wrong Answer
a,b,c = map(int,input().split())

if a != b != c:
    print(3)
if a == b and a != c and b != c: 
    print(2)
if a == b == c:
    print(1)
# Judge status: Accepted
N = int(input())
for i in range(N//4+1):
  for j in range(N//7+1):
    if 4*i + 7*j ==N:
      print('Yes')
      exit()
print('No')
# Judge status: Wrong Answer
### 数列をいったん文字列に変換
numberString = input()
print(numberString)
sumNumber = 0

### 文字列を分割、整数化
for i in range(len(numberString)):
  sumNumber += int(numberString[i])
### 和を9を法とする式で計算。

if sumNumber % 9 == 0:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
import sys
import itertools
input = sys.stdin.readline
sys.setrecursionlimit(10**6)


def dfs(s, mx, n):
    l = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k']
    if len(s) == n:
        print(s)
        return
    for i in range(mx+2):
        t = s
        t += l[i]
        dfs(t, max(mx, i), n)


def main():
    n = int(input())
    dfs('', -1, n)


main()
# Judge status: Accepted
X, Y = map(int, input().split())

low = 2*X
upper = 4*X

if low <= Y and Y <= upper and Y % 2 == 0:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
N = int(input())
a_list = list(map(int,input().split()))

cur=a_list[0]
pat=0 #0:change,1:asc,2:desc 
ans=0
for a in a_list:
    if a==cur:
        continue
    if pat==0:
        if cur<a:
            pat=1
        else:
            pat=2
        cur=a
        continue
    if pat==1 and cur>a:
        ans+=1
        pat=0
    elif pat==2 and cur<a:
        ans+=1
        pat=0

    cur=a
print(ans+1)
# Judge status: Wrong Answer
a = list(input())
b = list(input())
c = list(input())

s = a.pop(0)
while bool(a) and bool(b) and bool(c):
    if s == 'a':
        s = a.pop(0)
    elif s == 'b':
        s = b.pop(0)
    elif s == 'c':
        s = c.pop(0)
print(s.upper())
# Judge status: Accepted
N,K=map(int,input().split())
t=N%K
print(min(t,abs(t-K)))
# Judge status: Wrong Answer
s = input()

print(min(s.count("0"), s.count("1")))
# Judge status: Accepted
def main():
    a, b = map(int, input().split())
    kuchi = 1
    ans = 0

    while kuchi < b:
        kuchi = kuchi - 1 + a
        #print(kuchi, a, b)
        ans += 1
    print(ans)
    
    
if __name__ == "__main__":
    main()
# Judge status: Accepted
l = list(map(int, input().split()))
K = int(input())
l.sort()
a = l.pop()
print((2 ** K) * a + sum(l))
# Judge status: Accepted
n, x = map(int, input().split())
ls = list(map(int, input().split()))
s = sum(ls)
if s < x:
    print(n - 1)
elif s == x:
    print(n)
else:
    ls.sort()
    a = 0
    for i in range(n):
        if ls[i] <= x:
            x -= ls[i]
            a += 1
        else:
            print(a)
            break
# Judge status: Accepted
s = input()
ok = True
if s[0] != 'A': ok = False
c = 0
# print(s)
for si in s[2:-1]:
    # print('si',si)
    if 'C' == si:
        c += 1
if c != 1: ok = False

for si in s[1:2]+s[-1]:
    # print('si2',si,si.lower())
    if si != si.lower(): ok = False

print('AC' if ok else 'WA')
# Judge status: Accepted
import math
a, b, h, m = map(int, input().split())
x = (11 * m - 60 * h) * math.pi / 360
y = math.sqrt(a ** 2 + b ** 2 - 2 * a * b * math.cos(x))
print(y)
# Judge status: Wrong Answer
n, x = map(int, input().split())
l = list(map(int, input().split()))

a = 0
count = 0
for i in l:
    if a <= x:
        a += i
        count += 1
print(count)
# Judge status: Wrong Answer
n, k = map(int, input().split())
print(n//k if n//k==0 else 1)
# Judge status: Accepted
n,w = map(int,input().split())
v = [0]*n
for i in range(n):
    v[i] = list(map(int,input().split()))

dp = [[0 for j in range(w+1)] for i in range(n+1)]

for i,[W,V] in enumerate(v):
    for j in range(w):
        dp[i+1][j] = max(dp[i+1][j], dp[i][j])
        if j + W <= w:
            dp[i+1][j+W] = max(dp[i][j]+V, dp[i+1][j+W])

ans = 0
for i in range(1,n+1):
    ans = max(ans, max(dp[i]))
print(ans)
# Judge status: Wrong Answer
A,B,C,K = map(int,input().split())
ans = 0
if A+B>=K:
    print(A)
else:
    print(A-(K-(A+B)))
# Judge status: Accepted
L = [[1, 3, 5, 7, 8, 10, 12],[4, 6, 9, 11],[2]]
x, y = map(int,input().split())
ans = False
for i in range(len(L)):
  if x in L[i] and y in L[i]:
    ans = True
if ans:
  print("Yes")
else:
  print("No")
# Judge status: Wrong Answer
l = list(map(int, input().split(sep='/')))

if l[0] > 2019:
    print('TBD')
else:
    if l[1] > 5:
        print('TBD')
    else:
        if l[2] >30:
            print('TBD')
        else:
            print('Heisei')
# Judge status: Accepted
n = int(input())

A = [2, 1]

for i in range(n-1):
    A.append(A[-1] + A[-2])

print(A[-1])
# Judge status: Accepted
s = input()
ans = "AC"
if s[0] == "A":
  c_cnt = 0
  for i in range(2,len(s)-1):
    if s[i] == "C":
      c_cnt += 1
  if c_cnt == 1:
    for i in s:
      if i.lower() != "a" and i.lower() != "c" and i.lower() != i:
        ans = "WA"
        break
  else:
    ans = "WA"
else:
  ans = "WA"
print(ans)
# Judge status: Accepted
n,l=map(int,input().split())
x=[]
for i in range(n):
    x.append(i+l)

if max(x)*min(x)<=0:
    print(sum(x))
elif min(x)>0:
    print(sum(x)-min(x))
elif max(x)<0:
    print(sum(x)-max(x))
# Judge status: Accepted
import sys

s = input()

for i in range(8):
    ans = s[:i] + s[-(7-i):]
    if i == 7:
        ans = s[:7]
    
    if ans == 'keyence':
        print('YES')
        sys.exit()

print('NO')
# Judge status: Accepted
N = int(input())
N -= 1
S = chr(N % 26 + 97)
N //= 26
while N > 0:
  N -= 1
  S += chr(N % 26 + 97)
  N //= 26
print(S[::-1])
# Judge status: Wrong Answer
def is_Prime(i):
    if i == 2:
        return True
    if i % 2 == 0 or i == 1:
        return False
    s = int(i ** 1 / 2)
    while True:
        if s == 1:
            return True
        if i % s == 0:
            return False
        s -= 1

a, b = map(int, input().split())
ans = 1
for i in range(2, int(max(a, b) ** (1 / 2)) + 1):
    if a % i == b % i == 0:
        if is_Prime(i):
            ans += 1
print(ans)
# Judge status: Accepted
n=input()
ai=0
if int(n) % 10 != 0:
    for i in range(len(n)):
        ai += int(n[i])
else:
    ai = 10
print(ai)
# Judge status: Wrong Answer
N = input()
TA = input().split()
T = int(TA[0])
A = int(TA[1])

first = True
place = 0
minTmep = 0

H = list(map(int, input().split()))
for i in range(0,len(H)):
    compare = abs(A - T - H[i] * 0.006)
    if first == True:
        place = i
        minTmep = compare
        first = False
    
    if minTmep > compare:
        place = i

print(place + 1)
# Judge status: Accepted
n,k = map(int, input().split())
s = input()
k-=1
print(s[:k] + s[k].lower() + s[k+1:])
# Judge status: Wrong Answer
n = int(input())
l = list(map(int, input().split()))
sl = [0]

ma, mi = max(l), min(l)

for x in range(mi, ma):
  s = 0
  for i in l:
    s += (i - x)**2 
  sl.append(s)

print(min(sl))
# Judge status: Accepted
d, n = map(int, input().split())

div = 100 ** d

if n < 100:
    print(div * n)
    exit(0)
else:
    print(div * 101)
    exit(0)
# Judge status: Accepted
X = int(input())
if (X==7) or (X==5) or (X==3):
    print("YES")
else:
    print("NO")
# Judge status: Wrong Answer
a, b = list(map(int,input().split()))
S = list(str(input()))
S[a-1] = str.lower(S[a-1])
S = "".join(map(str,S))
print(S)
# Judge status: Wrong Answer
a,b,t=map(int,input().split())
c=0
n=2
while True:
    if a<=t:
        c+=b
        a=a*n
        n+=1
    else:
        break
print(c)
# Judge status: Wrong Answer
n, m = map(int, input().split())
ans = n
m -= n*2
ans += m // 4
print(ans)
# Judge status: Accepted
s = list(input())

while (s):
    s.pop()
    s.pop()
    sl = s[:len(s) // 2]
    sr = s[len(s) // 2:]
    if sl == sr:
        # print(sl)
        # print(sr)
        print(len(sl) * 2)
        exit()
# Judge status: Wrong Answer
n = int(input())
x = list(map(int, input().split()))
xsort = sorted(x)

for i in range(n):
    if x[i] < xsort[n//2]:
        print(xsort[2//n])
    else:
        print(xsort[n//2-1])
# Judge status: Wrong Answer
n,h = map(int, input().split())
A = 0
B = []
for _ in range(n):
    a,b = map(int, input().split())
    if A < a: A = a
    B.append(b)
B.sort(reverse=True)
hit = 0
cnt = 0
for i in range(n):
    if hit >= h: break
    if A < B[i]: 
        hit += B[i]
        cnt += 1
    else: break
if hit >= h: print(cnt)
else: print(cnt + round((h-hit)/A))
# Judge status: Accepted
import math
S=list(input())
N=len(S)
a=0
for i in range(0,N):
    if S[i]!=S[N-1-i]:
        a+=1
a=math.ceil(a/2)
print(a)
# Judge status: Accepted
n = int(input())
t = [[0 for j in range(10)] for i in range(10)]
for i in range(1,n+1):
    s = str(i)
    t[int(s[0])][int(s[-1])] += 1
ans = 0
for i in range(1,10):
    for j in range(1,10):
        ans += t[i][j]*t[j][i]
print(ans)
# Judge status: Accepted
N=int(input())
A=[]
B=[]
x=[]
c=0
for i in range(N):
    y=list(map(int,input().split()))
    A.append(y[0])
    B.append(y[1])
for i in range(N-1,-1,-1):
  x=A[i]
  y=B[i]
  if (x+c)%y!=0:
    c+=y-(x+c)%y
print(c)
# Judge status: Accepted
s=input()
t=input()
cnt=0
for i in range(len(s)):
  if s[i]!=t[i]:
    cnt+=1
print(cnt)
# Judge status: Accepted
n=int(input())
if(n==3 or n==5 or n==7):
    print("YES")
else:
    print("NO")
# Judge status: Wrong Answer
import math


def target(x):
    return math.floor(A * x / B) - A * math.floor(x / B)


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

left = 0
right = N

while right - left > 1:
    mid = (left + right) // 2
    y = target(mid)
    prv = target(mid - 1)
    nxt = target(mid + 1)
    if prv <= y <= nxt:
        left = mid
    else:
        right = mid


print(target(right))
# Judge status: Accepted
import math
def A():
    temp = [int(i) for i in input().split()]
    print(int(math.ceil(temp[0]/temp[1])))

A()
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))

x = a[0]
y = sum(a[1:])
ans = abs(x - y)
for i in range(1, n-1):
   x += a[i]
   y -= a[i]
   ans = min(abs(x-y), ans)
print(ans)
# Judge status: Accepted
s = list(input())
a = [s.count('a'),s.count('b'),s.count('c')]
print("NO" if max(a)-min(a)>1 else "YES")
# Judge status: Accepted
str = input()
if(int(str[-1]) in [2, 4, 5, 7, 9]):
    print('hon')
elif(int(str[-1]) in [0, 1, 6, 8]):
    print('pon')
else:
    print('bon')
# Judge status: Wrong Answer
from collections import Counter
N = int(input())
S = Counter(input())
ans = 1
for v in S.values():
    ans *= (v+1)
print(ans-1)
# Judge status: Wrong Answer
A=int(input())
B=int(input())
C=int(input())
N=int(input())
count=0
for i in range(A+1):
    for j in range(B+1):
        for k in range(C+1):
            if 500*i+100*j+C*k== N:
                     count+=1
print(count)
# Judge status: Accepted
A,B,K=map(int,input().split())
ans=[]

for i in range(K):
    if A+i<=B:
        ans.append(A+i)
    if B-i>=A:
        ans.append(B-i)
    
l=set(ans)
ans2=list(l)
ans2.sort()

for i in range(len(ans2)):
    print(ans2[i])
# Judge status: Wrong Answer
from itertools import accumulate, permutations, combinations, product, combinations_with_replacement
from math import floor, ceil, sqrt, factorial, log
from bisect import bisect_left, bisect_right
from collections import Counter, defaultdict
from heapq import heappop, heappush, heappushpop
from itertools import product
import sys
stdin = sys.stdin
mod = 10**9 + 7


def ns(): return stdin.readline().rstrip()


def ni(): return int(ns())


def na(): return list(map(int, stdin.readline().split()))


a, b, k = na()
takahashi = a - min((k + 1) // 2, b)
aoki = b - min(k // 2, a)
print(takahashi, aoki)
# Judge status: Accepted
n = int(input())
s = input()
t = input()

for i in range(n, -1, -1):
    ans = [""] * (2 * n - i)
    ans[:n] = list(s)
    ans[-n:] = list(t)
    if ans[:n] == list(s):
        break

print(2 * n - i)
# Judge status: Accepted
n=int(input())
for i in range(n+7):
  if i*(i+1)//2>=n:w=i;break
for i in range(w,0,-1):
  if n>=i:
    print(i)
    n-=i
# Judge status: Wrong Answer
n,c,k = map(int, input().split())
a = []
bus = 1
for i in range(n):
  a.append(int(input()))
a.sort()
j = 0
count = 1
while j + count in range(n):
  if a[j+count] < a[j] + k and count < c:
    count = count + 1
  else:
    bus = bus + 1
    j = j + count
    count = 1
print(bus)
# Judge status: Wrong Answer
N = int(input())

result = 0
if len(str(N)) % 2 == 0:
    loop = ((len(str(N)) - 1) -1) //2 + 1
    for i in range(loop):
        result += 9 * pow(10,2*i)
    else:
        for i in range(len(str(N)) - 2):
            result += 9 * pow(10,i)
            result += N - pow(10,len(str(N)) - 1) + 1

print(result)
# Judge status: Wrong Answer
from scipy.misc import comb
N,M = map(int,input().split())
even = comb(N,2)
odd = comb(M,2)
print(int(even + odd))
# Judge status: Accepted
from collections import Counter
n = int(input())
A = list(map(int, input().split()))
d = Counter(A)
key = d.keys()
ans = []
for k in key:
    if d[k] >= 2:
        ans.append(k)
        if d[k] >= 4:
            ans.append(k)
if len(ans) < 2:
    print(0)
else:
    ans.sort()
    print(ans[-1]*ans[-2])
# Judge status: Wrong Answer
import math
n, m = map(int, input().split())
# ans = 0
#
# if m >= 2*n:
#     ans += n
#     m -= 2*n
# ans += math.floor(m/4)
#
# print(ans)
#

scc = n*2 + m
ans = math.floor(scc/4)
print(ans)
# Judge status: Wrong Answer
import sys


def input(): return sys.stdin.readline().strip()
def I(): return int(input())
def LI(): return list(map(int, input().split()))
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def S(): return input()
def LS(): return input().split()


INF = float('inf')


n, x = LI()
l = LI()
cnt = 0
d = 0
for i in range(n):
    if d <= x:
        cnt += 1
        d += l[i]
print(cnt)
# Judge status: Accepted
def resolve():
	a,b=map(int,input().split())
	print(a*b)
resolve()
# Judge status: Wrong Answer
N,x = map(int,input().split())
a = [0] + list(map(int,input().split()))
b = [0]
for i in range(1,N):
  b.append(a[i]+a[i+1])

cnt = 0  
for i in range(N-1,0,-1):
  if b[i] > x:
    c = b[i] - x
    cnt += c
    b[i] -= c
    b[i-1] -= c  
print(cnt)
# Judge status: Accepted
x = int(input())
x,y=divmod(x, 11)
if y > 6:
    print(2*x+2)
elif y > 0:
    print(2*x+1)
else:
    print(2*x)
# Judge status: Accepted
N = int(input())
ans = 1
for i in range(1,N+1):
    ans *= i
    ans %= 10**9+7
print(ans)
# Judge status: Accepted
s = input()

if(len(s) % 2 == 0):
    s = s[:-2]
else:
    s = s[:-1]

while(s != ""):
    l = len(s)//2
    if(s[:l] == s[l:]):
        print(l*2)
        break
    s = s[:-2]
# Judge status: Accepted
N, M = map(int, input().split())

if N % 2 == 0:
	N -= 1

H = N // 2
if H % 2 == 1:
	H += 1

m = 0
i = 1
while m < M:
	print(i, H - i + 1)
	i += 1
	m += 1
	if i >= H - i + 1:
		break

i = 1
while m < M:
	print(H + i, N + 1 - i)
	i += 1
	m += 1
# Judge status: Wrong Answer
S = input()

key = list("keyence")

flg = False
for i in range(len(S)):
    for j in range(len(S)):
        tmp = S[0:i]+S[j:]

        if tmp == key and not flg:
            print("YES")
            exit()

if not flg:
    print("NO")
# Judge status: Accepted
max_dis = 0
a = int(input())
for _ in range(3):
    input()
b = int(input())
k = int(input())
if b - a <= k:
    print("Yay!")
else:
    print(":(")
# Judge status: Accepted
def resolve():
    '''
    code here

    '''
    import math

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

    deff = N - M

    if deff == -1:
        N, M = M, N

    if deff == 0:
        temp = math.factorial(N)
        res = (temp**2 * 2) % (10**9+7)

    elif abs(deff) == 1:
        res = (math.factorial(N) **2 // N ) % (10**9+7)

    else:
        res = 0
    
    print(res)

if __name__ == "__main__":
    resolve()
# Judge status: Wrong Answer
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
import math

n,p = iim()
A = iil()

if n > 1:
    even = 0
    odd = 0
    for i in A:
        if i%2 == 0:
            even += 1
        else:
            odd += 1

    p0 = 2**(odd-1)
    print(2**even*p0)
else:
    if p == 0:
        print(2 if A[0]%2 == p else 0)
    else:
        print(1 if A[0]%2 == p else 0)
# Judge status: Accepted
import math
N = int(input())
print(math.ceil(N / 1000) * 1000 - N)
# Judge status: Accepted
import numpy as np
from numba import jit
n, k = map(int, input().split())
a = np.array(list(map(int, input().split())))
@jit
def imos(a):
    tmp = np.zeros(n+1, dtype=np.int64)
    for i in range(n):
        tmp[max(0, i - a[i])] += 1
        tmp[min(i + a[i] + 1, n)] -= 1
    tmp = np.cumsum(tmp)
    return tmp[:n]

for j in range(1, min(k+1, 50)):
    a = imos(a)
print(*a)
# Judge status: Accepted
from collections import deque
n,m=map(int,input().split())
l=[[0] for _ in range(n+1)]
vi=[0 for _ in range(n+1)]

for i in range (m):
  a,b=map(int,input().split())
  l[a].append(b)
  l[b].append(a)
st=deque([1])
f=set([1])


while st:
  x=st.popleft()
  for k in l[x]:
    if k not in f:
      st.append(k)
      f.add(k)
      vi[k]=x   
  
print("Yes")
for m in vi[2:]:
  print(m)
# Judge status: Accepted
N = int(input())
tpr, xpr, ypr = 0, 0, 0
count = 0
for i in range(N):
    t, x, y = map(int, input().split())
    d = abs(x-xpr) + abs(y-ypr)
    n = ((t-tpr) - d) / 2
    if n >= 0 and n % 1 == 0:
        count += 1
    tpr, xpr, ypr = t, x, y
if count == N:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
# coding: utf-8
import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

def F(x):
    if x == 0:
        return ''
    if x % 2 == 0:
        return F(x//-2) + '0'
    else:
        return F((x-1)//-2) + '1'

N = ir()
answer = F(N)
if N == 0:
    answer = 0
print(answer)
# Judge status: Accepted
n = int(input())
a = list(map(int,input().split()))

max = (10 ** 9) + 7

#入力配列の総和
line = 0
for i in range (n):
    line += a[i]

#a11, a22, ...対角線要素の総和
rem = 0
for i in range(n):
    rem += a[i]*a[i]

sum = ((line*line) - rem) // 2

ans = sum % max

print(ans)
# Judge status: Accepted
N=int(input())
A=list(map(int,input().split()))
X=[0 for i in range(10**5+1)]
Q=int(input())
sum_=sum(A)
for i in range(N):
    X[A[i]]+=1
for i in range(Q):
    B,C=map(int,input().split())
    sum_+=X[B]*(C-B)
    X[C]+=X[B]
    X[B]=0
    print(sum_)
# Judge status: Accepted
n,m=map(int,input().split())
a=0
b=0
if n!=1:
    a=(n*(n-1))/2
if m!=1:
    b=(m*(m-1))/2
c=int(a+b)
print(c)
# Judge status: Accepted
x = int(input())
n = x // 100
if n * 105 >= x:
    print(1)
else:
    print(0)
# Judge status: Accepted
N = int(input())
txy = list(list(map(int, input().split())) for _ in range(N))
dt = 0
dx = 0
dy = 0
for i in range(N):
    if abs(txy[i][1]-dx)+abs(txy[i][2]-dy) > txy[i][0]-dt or (txy[i][1]+txy[i][2])%2 != txy[i][0]%2:
        print("No")
        break
    dt = txy[i][0]
    dx = txy[i][1]
    dy = txy[i][2]
else:
    print("Yes")
# Judge status: Accepted
N = int(input())
A = int(input())

answer = "Yes" if N % 500 <= A else "No"
print(answer)
# Judge status: Accepted
s = str(input())
L = []
for i in s:
  if i in L:
    print('no')
    exit()
  else:
    L.append(i)
print('yes')
# Judge status: Wrong Answer
a, b, c, d = [int(input()) for i in range(4)]
if b > a:
    a = b
print(b*c + (a - b)*d)
# Judge status: Accepted
a = input()
if 97 <= ord(a) <= 122:
    print('a')
else:
    print('A')
# Judge status: Accepted
data=list(map(int,input().split()))
data.sort(reverse=True)
print(10*data[0]+data[1]+data[2])
# Judge status: Wrong Answer
n,m=map(int,input().split())

print(n*(n-1)/2+m*(m-1)//2)
# Judge status: Accepted
from functools import reduce
from fractions import gcd
N,x=map(int,input().split())
X=[abs(int(i)-x) for i in input().split()]
print(reduce(gcd,X))
# Judge status: Accepted
from decimal import Decimal as de
a,b,c=map(de,input().split())
print('Yes' if a**de('0.5')+b**de('0.5')<c**de('0.5') else 'No')
# Judge status: Accepted
X = int(input())
print(X//500 * 1000 + (X%500)//5 * 5)
# Judge status: Accepted
N, M = map(int, input().split())
A = [int(i) for i in input().split()]
BC = []
for _ in range(M):
    B, C = map(int, input().split())
    BC.append([B, C])
BC = sorted(BC, key=lambda x: x[1], reverse=True)
# print("A: {}".format(A))
# print("BC: {}".format(BC))

A_dash = []
for ij in BC:
    i, j = ij
    A_dash.extend([j]*i)
    if len(A_dash) >= N:
        break
A_dash = A_dash[:N]

A_dash.extend(A)
A_dash = sorted(A_dash, reverse=True)[:N]

print(sum(A_dash))
# Judge status: Wrong Answer
l,r,d = map(int,input().split())
ans = 0

for i in range(100):
    if d * i <= l:
        ans += 1
    if d * i >= r:
        ans += 1
        break

print(ans)
# Judge status: Wrong Answer
n,l = map(int,input().split())

apples = [l-i for i in range(n)]

eat = float('inf')
for a in apples:
  eat = a if abs(a)< abs(eat) else eat
  
print(sum(apples) - eat)
# 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('No')
    else:
        print('Yes')
# Judge status: Accepted
D, N = map(int, input().split())

if N != 100:
  print(100**D*N)
else:
  print(100 ** D * 101)
# Judge status: Accepted
a,b,n=map(int,input().split())
x=min(n,b-1)
l=(a*x)//b
r=a*(x//b)
print(l-r)
# Judge status: Wrong Answer
"""AtCoder Beginner Contest 178.

C
"""

import sys


def input() -> str:  # noqa: A001
    """Input."""
    return sys.stdin.readline()[:-1]


def main():
    """Run."""
    mod = 1000000007
    n = int(input())

    ans = 0

    if n <= 1:
        ans = 0
    elif n == 2:
        ans = 2
    else:
        ans = 10**n
        ans -= 8**n
        ans -= 8**n
        ans += 7**n

    print(ans % mod)


main()
# Judge status: Accepted
n = int(input())
x = list(map(int,input().split()))
y = sorted(x)

for i in range(n):
  if x[i] <= y[(n//2) - 1]:
    print(y[(n//2)])
  elif x[i] >= y[(n//2)]:
    print(y[(n//2) - 1])
# Judge status: Accepted
X ,Y = map(int, input().split())
l = []
ans = 1

for i in range(Y-X):
    t = X * 2**i
    if t <=Y:
        l.append(t)
    else:
        break   

ans = len(l)
if X == Y:
    ans = 1
print(ans)
# Judge status: Wrong Answer
n = int(input())

alphabets = [chr(i) for i in range(ord('a'), ord('a') + 26)]
x = 0
for i in range(1, 100):
    if n <= 26**i:
        x = i
        break
ans = ''
for i in range(x, 0, -1):
    ans = alphabets[n % 26 - 1] + ans
    n = n // 26

print(ans)
# Judge status: Accepted
#!/usr/bin/env python3
# -*- coding: utf-8 -*-


def main():
    A, B, C, X, Y = map(int, input().split())

    print(
        min(X * A + Y * B,
            2 * X * C + B * max(0, Y - X),
            2 * Y * C + A * max(0, X - Y)))


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

Y = X[::]
Y.sort()

m = n // 2
median = (Y[m] + Y[m - 1]) / 2

for x in X:
    if x < median:
        print(Y[m])
    else:
        print(Y[m-1])
# Judge status: Wrong Answer
from collections import deque
n,m=map(int,input().split())
root=[[] for _ in range(n)]
for i in range(m):
	a,b=map(int,input().split())
	root[a-1].append(b-1)
	root[b-1].append(a-1)
times=[0]*n
sign=[-1]*n
sign[0]=0
que=deque([0])
while que:
	q=que.popleft()
	for i in root[q]:
		if sign[i]==-1:
			sign[i]=q
			que.extend(root[i])
for i in range(n-1):
	print(sign[i+1]+1)
# Judge status: Wrong Answer
q, h, s, d = map(int, input().split())
n = int(input())
m = 0
l = [q, min(q*2, h), min(q*4, h*2, s), min(q*8, h*4, s*2, d)]

if n % 2 == 0:
    m += (n / 2) * l[3]
else:
    m += (n // 2) * l[3] + l[2]

print(int(m))
# Judge status: Accepted
N = list(input())
print(N.count('1'))
# Judge status: Accepted
N = int(input())
A = list(map(int,input().split()))
B = [0]*(10**5+2)

for a in A:
  B[a+1]+=1
  B[a+2]+=1
  B[a]+=1
  
print(max(B))
# Judge status: Accepted
k=int(input())
s=input()

if len(s)<=k:
    print(s)
else:
    print(s[0:k]+'...')