peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
r,g,b=map(str,input().split())
s=r+g+b
s=int(s)
if s%4==0:
    print("YES")
else:
    print("NO")
# Judge status: Wrong Answer
n = int(input())
ab = [list(map(int, input().split())) for _i in range(n)]

x = 0
r = 0
for i in range(n-1, -1, -1):
    a, b = ab[i]
    r += (x+a)%b
    x = r
print(r)
# Judge status: Wrong Answer
N,M=map(int,input().split())
A=list(map(int,input().split()))
s=sum(A)

if s>N:
  print(-1)
  exit()
  
print(N-s)
# Judge status: Accepted
n=int(input())
cnt=0
for a in range(1,n):
    cnt+=(n-1)//a
print(cnt)
# Judge status: Wrong Answer
import numpy as np
N=int(input())
six=[0]
nine=[0]
for i in range(1,N):
  six.append(6**i)
  nine.append(9**i)
  if 6**i>N:
    break
six=np.array(six)
nine=np.array(nine)
    
now=N
count=0
while now>0:
  sub=max(1,six[six<=now].max(),nine[nine<=now].max())
  now-=sub
  count+=1
  
print(count)
#print(six, nine)
# Judge status: Accepted
s=list(input())
an=s.count("a")
bn=s.count("b")
cn=s.count("c")
cl=[an, bn, cn]
m=max(cl)
cl.remove(m)
for n in cl:
  if (m-1)!=n and (m-1)!=n-1:
    print("NO")
    exit()
print("YES")
# Judge status: Wrong Answer
data1 = input()
data2 = input()

count = 3 -1
sw = 0
i = 0
j = len(data2)-1
while i <= count:
    if data1[i] == data2[j]:
        sw += 1
    i += 1
    j -= 1
if sw == 3:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
n = int(input())
A = list(map(int, input().split()))

sum_A = sum(A)

ans = 0
for i in range(n-1):
    sum_A -= A[i]
    ans += A[i] * sum_A
ans %= 10**9+7
print(ans)
# Judge status: Accepted
from collections import Counter

n = int(input())
a = list(map(int, input().split()))
sa =set(a)
ca = Counter(a)
ans = 0

for x in sa:
    # カウンタオブジェクトは存在しない要素に０を返す
    tmp = ca[x-1] + ca[x] + ca[x+1]
    if ans < tmp:
        ans = tmp

print(ans)
# Judge status: Wrong Answer
n,m=map(int, input().split())
aka = [0]*(n+1)
siroaka = [1]*(n+1)
aka[1] = 1
for i in range(m):
    x,y=map(int, input().split())
    if(aka[x]==1):
        siroaka[x]-=1
        siroaka[y]+=1
        if(siroaka[x]==0):
            aka[x]=0
        aka[y]=1

print(sum(aka))
# Judge status: Accepted
N = int(input())

lst = [1]
lst += [ 6**i for i in range(1, 10) if 6**i <= 100000]
lst += [ 9**i for i in range(1, 10) if 9**i <= 100000]
lst.sort()

dp = list(range(N+1))

for i in range(1, N+1):
    temp = []
    for j in lst:
        if j <= i:
            temp.append(dp[i-j] + 1) 
    dp[i] = min(temp)
print(dp[N])
# Judge status: Accepted
k = int(input())
s = input().strip()

if len(s) <= k:
  print(s)
else:
  print(s[:k] + "...")
# Judge status: Accepted
import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    from itertools import accumulate

    N = int(input())  # len(A)
    A = list(map(int, input().split()))
    zenbu=sum(A)
    B = [0] + A
    B = list(accumulate(B))  # 累積和を格納したリスト作成


    ans=10**18
    for i in range(1, N):
        ans = min(abs(B[i]-(zenbu-B[i])),ans)
    print(ans)

resolve()
# Judge status: Wrong Answer
#-*-coding:utf-8-*-
import sys
input=sys.stdin.readline

def main():
    s = input().rstrip()
    string_dict={}

    for i in s:
        if i not in string_dict:
            d = {i:1}
            string_dict.update(d) 
        else:
            print("No")
            exit()
    print("Yes")

if __name__=="__main__":
    main()
# Judge status: Accepted
a,b,c,x,y=map(int,input().split())
ret=float('inf')
for i in range(max(x,y)+1):
  ret=min(ret,i*c*2+max((x-i),0)*a+max((y-i),0)*b)
print(ret)
# Judge status: Wrong Answer
K,S = map(int, input().split())

if K == S:
	print( (K+5)*(K+4)//2 )
	exit() 

ans = 0
for X in range(K+1):
	S1 = S - X
	if S1 < 0:
		break
	else:
		if S1 <= K:
			ans += S1 + 1
		elif S1 <= 2 * K:
			ans += S1 - 2*K + 1
		else:
			continue

print(ans)
# Judge status: Accepted
# -*- coding: utf-8 -*-
s = input()
# 出力
print(s[0:3])
# Judge status: Wrong Answer
n = int(input())
ans = 0

for i in range(1, 7):
  if 2**i <= n:
    ans = 2**i

print(ans)
# Judge status: Wrong Answer
N = input()
for i in range(10):
    if N.count(str(i)) >= 3:
        print('Yes')
        break
else:
    print('No')
# Judge status: Accepted
n = int(input())
x = list(map(int,input().split()))
xs = sorted(x)
mid = xs[n//2]
tmp = n//2
for i, xx in enumerate(x):
    if xx < mid:
        print(mid)
    elif xx > mid:
        if xx == xs[tmp-1]:
            print(xs[tmp-2])
        else:
            print(xs[tmp-1])
    else:

        print(xs[tmp-1])
# Judge status: Wrong Answer
x = list(map(int,input().split()))

n = x[0]
a = x[1]
b = x[2]

s = input()
c = 0
k = 0

for i in range(0,n):
  #print(c)
  if(s[i] == "c"):
    print("No")
  elif(s[i] == "a"):
    if(c <= a + b):
      print("yes")
      c = c + 1
    else:
      print("No")
  else:
    if(c <= a + b and k <= b):
      print("Yes")
      c = c + 1
      k = k + 1
    else:
      print("No")
# Judge status: Accepted
x = int(input())
ans = int(x//5.5)
half = ans//2

y = 6*half+5*half
ans = 2*half
if x <= y:
    print(ans)
else:
    for i in range(3):
        if i % 2 == 0:
            y += 6
        else:
            y += 5
        ans += 1
        if x <= y:
            print(ans)
            break
# Judge status: Wrong Answer
def SumReturn(num):
    total=0
    while num!=0:
        total += num%10
        num //= 10
        
    return total

if __name__ == '__main__':
    
    n = int(input())
    min = 10000
    
    for i in range(n+1):
        if(min > SumReturn(i)+SumReturn(n-i)):
            min = SumReturn(i)+SumReturn(n-i)
        
        
    print(min)
# Judge status: Accepted
s=str(input())
s=list(s)
import collections
c=collections.Counter(s)
if max(c["a"],c["b"],c["c"])-min(c["a"],c["b"],c["c"])<=1:
  print("YES")
else:
  print("NO")
# Judge status: Accepted
a,b,c=map(int,input().split());print("YNeos"[a+b<c::2])
# Judge status: Accepted
a, b, c = sorted(map(int, input().split()), reverse=True)
print(sum([a << int(input()), b, c]))
# Judge status: Wrong Answer
N = int(input())
K = int(input())
X = int(input())
Y = int(input())

AC=0

if N > K:
    for _ in range(K):
        AC += X
    
    for _ in range(N-K):
        AC += Y

    print(AC)

else:
    for _ in range(K):
        AC += X
        print(AC)
# Judge status: Accepted
from fractions import gcd
from functools import reduce

n, x = map(int, input().split())
c = list(map(int, input().split()))

print(reduce(gcd, [abs(i-x) for i in c]))
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
ans = 1

if 0 in a:
    print(0)
else:
    for i in range(n):
        ans *= a[i]
        if ans > 10**18:
            print(-1)
            break
    else:
        print(ans)
# Judge status: Wrong Answer
a,b,c,d=map(int,input().split())
if abs(b-a)<=d and abs(c-b)<=d:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
N = int(input())
l = []
for i in range(1,10):
  for j in range(1,10):
    l.append(i*j)
    
if N in l:
  print("Yes")
  exit()
else:
  print("No")
  exit()
# Judge status: Accepted
A,B,N = map(int,input().split())
if B <= N:
    X = B-1
elif B > N:
    X = N
print(int((A*X)/B) - A*int(X/B))
# Judge status: Accepted
def main():
    import sys
    L = list(map(int, sys.stdin.readline().split()))
    print(L.index(0)+1)







if __name__=='__main__':
    main()
# Judge status: Accepted
N, M, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
ans = 0

a, b = [0], [0]
for i in range(N):
    a.append(A[i]+a[i])
for i in range(M):
    b.append(B[i]+b[i])

j = M

for i in range(N+1):
    if a[i]>K:
        break
    while b[j]>K-a[i]:
        j-=1
    ans = max(ans, i+j)
print(ans)
# Judge status: Accepted
n, m = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(n)]
cd = [list(map(int, input().split())) for _ in range(m)]

for i in range(n):
  a, b = ab[i]
  
  dis = 10 ** 20
  res = 0
  for i, check in enumerate(cd):
    tmp_dis = abs(a - check[0]) + abs(b - check[1])
    if dis == tmp_dis:
      continue
    if tmp_dis < dis:
      dis = tmp_dis
      res = i + 1
  
  print(res)
# Judge status: Accepted
n=int(input())
if(n>=30):
  print("Yes")
else:
  print("No")
# Judge status: Accepted
S=input()
T=list(S)
U=list(set(T))
b=[0]*2
if len(U)==2:
  for x in range(4):
    if U[0]==S[x]:
      b[0]+=1
    elif U[1]==S[x]:
      b[1]+=1
  if b[0]==2 and b[1]==2:
    print("Yes")
  else:
    print("No")
else:
  print("No")
# Judge status: Accepted
S = input()
print(sum(a < b for a, b in zip(S, S[::-1])))
# Judge status: Accepted
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    N = int(readline())
    S = input()
    ans = 0
    for i in range(1, N):
        first = set(S[:i])
        second = set(S[i:])
        score = len(first & second)
        ans = max(ans, score)

    print(ans)


if __name__ == '__main__':
    main()
# Judge status: Accepted
a,b=map(int,input().split())
if a+b >= 24:
    print(a+b-24)
else:
    print(a+b)
# Judge status: Wrong Answer
from itertools import combinations

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

l.sort(reverse=True)
ans = 0

for i in range(n):
    c = l[i]
    can_select = False
    for a, b in combinations(l[i+1:], 2):
        if c < a+b:
            ans += 1
            can_select = True
    if not can_select:
        break

print(ans)
# Judge status: Accepted
n = int(input())
B = list(map(int, input().split()))
C = []
C.append(B[0])
for i in range(len(B) - 1):
    C.append(min(B[i], B[i+1]))
C.append(B[-1])
print(sum(C))
# Judge status: Accepted
s = int(input())

l = [s]
temp = s
for i in range(2, 10**7):

    if temp % 2 == 0:
        temp //= 2
    else:
        temp = 3 * temp + 1

    if temp in l:
        print(i)
        exit()
    else:
        l.append(temp)
# Judge status: Wrong Answer
S= input()
T= input()

count = 0
i = 0
while i < len(S):
    print("len" + str(len(S)))
    print("S[i]:" + S[i])

    if S[i] != T[i]:
        count+=1
    i+=1

print(count)
# Judge status: Accepted
a, b, c = map(int, input().split())
temp = 0
for i in range(20000):
  temp = (temp + a) % b
  if temp == c:
    print('YES')
    exit()
print('NO')
# Judge status: Accepted
a,b,c,k = map(int,input().split())
if k%2 == 0:
  print(a-b)
else:
  print(b-a)
# Judge status: Accepted
def prime_factor(n):
    ass = []
    for i in range(2,int(n**0.5)+1):
        while n % i==0:
            ass.append(i)
            n = n//i
    if n != 1:
        ass.append(n)
    return ass

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

A_s = set(prime_factor(A))
B_s = set(prime_factor(B))

from fractions import gcd

print(len(A_s&B_s)+1)
# Judge status: Wrong Answer
A,B = input().split()

a = int(A)
b = B.replace(".","")

import math
print(math.floor(a*int(b)//100))
# Judge status: Accepted
N, K = map(int, input().split())
S = list(input())

l = []
bef = ""
start = 0
ans = 0

for i, s in enumerate(S):
    if bef=="":
        start = i
    elif bef!=s:
        cnt = 0
        l.append(i-start)
        start = i
    bef = s
l.append(i-start+1)

size = len(l)
ans = 0
for i in range(min(2*K+1, size)):
    ans += l[i]
ans -= 1
for i in range(min(2*K+1, size), size):
    ans += l[i]-1
print(ans)
# Judge status: Accepted
N = int(input())

print(N // 2 + N % 2)
# Judge status: Accepted
# -*- coding: utf-8 -*-
print(['NO', 'YES'][input() == input()[::-1]])
# Judge status: Accepted
from itertools import*
a = b = 0
for k, n in groupby(input()):
  n = len(list(n))
  a -= n*~n//2 + min(n, b)*(k==">")
  b = n
print(a)
# Judge status: Accepted
A, B = map(int, input().split())
ans = 0
for i in range(100,999+1):
  Pal = str(i)
  Pal += Pal[1]+Pal[0]
  Palans = int(Pal)
  if A<=Palans<=B:
    ans+=1
print(ans)
# Judge status: Accepted
from collections import Counter

n=int(input())
a=list(map(int,input().split()))
cnt=Counter(a)
lis = sorted(list(set(a)),reverse=True)
ans1,ans2 = 0,0
for val in lis:
    if ans1==0:
        if cnt[val]>=2:
            cnt[val]-=2
            ans1=val

        if cnt[val]>=2:
            ans2=val
            break
    else:
        if cnt[val]>=2:
            ans2=val
            break
print(ans1*ans2)
# Judge status: Accepted
N,A,B = map(int,input().split())

def sum_of_num(num):
    list_a = []
    sums = 0
    while num > 0:
        list_a.append(num % 10)
        num = num // 10
    for i in range(len(list_a)):
        sums = sums + list_a[i]
    return sums

list_b = []
for i in range(1,N+1):
    if A <= sum_of_num(i) <=B:
        list_b.append(i)

sums = 0
for i in range(len(list_b)):
    sums = sums + list_b[i]

print(str(sums))
# Judge status: Accepted
a,b,c = map(int,input().split())
print(max(a * 10 + b + c,a + b * 10 + c,a + b + c * 10))
# Judge status: Accepted
def main3():
    input()
    t = sorted(list(map(int, input().split())))
    ma = t.pop(-1)
    r = min(t, key=lambda x: abs(x - ma / 2))
    print(ma, r)

if __name__ == '__main__':
    main3()
# Judge status: Accepted
a, b = map(int, input().split())
if b >= a:
    print(a)
else:
    print(a-1)
# Judge status: Accepted
w=["SUN","MON","TUE","WED","THU","FRI","SAT"]
print(7-w.index(input()))
# Judge status: Accepted
N,H = map(int,input().split())
ab = [list(map(int,input().split())) for i in range(N)]
maxa = max(ab[i][0] for i in range(N))
lastb = [ab[i][1] for i in range(N) if ab[i][1] >= maxa]
lastb.sort(reverse=True)
count = 0
while H > 0 and count < len(lastb):
    H -= lastb[count]
    count += 1
if H <= 0:
    print(count)
else:
    count += (H-1)//maxa+1
    print(count)
# Judge status: Accepted
import math  # noqa: F401
from typing import Dict, List, Optional, Tuple, Union  # noqa: F401


def main(S: str, T: str):
    ans = 0
    for s, t in zip(list(S), list(T)):
        if s != t:
            ans += 1
    print(ans)


if __name__ == "__main__":
    S = input()
    T = input()
    main(S, T)
# Judge status: Accepted
l = 0
ans = 0
for c in input():
    if c == 'S':
        l += 1
    else:
        if l == 0:
            ans += 1
        else:
            l -= 1
print(ans + l)
# Judge status: Accepted
n=int(input())
W=list(map(int,input().split()))
l=0
r=sum(W)
res=100000000000

for w in W:
	l+=w
	r-=w
	res=min(res,abs(r-l))
print(res)
# Judge status: Wrong Answer
a, b, k = map(int, input().split(' '))
n = min(a, b)
cnt = 0

for i in range(1, n + 1):
    if (a % i == 0) and (b % i == 0):
        cnt += 1
        if cnt == k:
            result = i
            break

print(result)
# Judge status: Accepted
n,m=map(int,input().split())
if n==1 and m==0:
  print(0)
  exit()
c=[list(map(int,input().split())) for i in range(m)]
if [1,0] in c and n>1:
  print(-1)
  exit()
num=[1]+[0]*(n-1)
try:
  for i in c:
  	num[i[0]-1]=i[1]
except:
  print(-1)
  exit()
for i in c:
  if num[i[0]-1]!=i[1]:
    print(-1)
    exit()
print(int("".join(map(str,num))))
# Judge status: Accepted
N,A,B=map(int,input().split())

if A>B :
    print(0)
elif N==1 and A!=B:
    print(0)
elif N==1 and A==B:
    print(1)
else:
    number=B-A+1
    N=N-2
    answer=N*(B-A)+1
    print(answer)
# Judge status: Accepted
from collections import defaultdict
from collections import deque
import itertools
import copy

def readInt():
	return int(input())
def readInts():
	return list(map(int, input().split()))
def readChar():
	return input()
def readChars():
	return input().split()

n = readInt()
s = [readInt() for i in range(n)]
s.sort()
ans = sum(s)
boo = 0
if ans%10==0:
	for i in s:
		if i%10!=0:
			ans-=i
			boo = 1
			break
	if boo==0:
		ans = 0

print(ans)
# Judge status: Accepted
n=int(input())
a=[int(j)for j in input().split()]
ans=0
s=sum(a)
p=1
b=True
for i,j in enumerate(a):
    if p<j:
        print(-1)
        exit()
    ans+=p
    p-=j
    s-=j
    if i==n:
        continue
    if p<s and b:
        if p*2<s:
            p*=2
        else:
            p=s
    if p==s:
        b=False
print(ans)
# Judge status: Wrong Answer
D,T,S= [int(x) for x in input("Enter values in the range of 1 and 10000: ").split()] 
if (D and T) and S <=10000 and D/S==T:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
N, M, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

a, b = [0], [0]
for i in range(N):
	a.append(a[i] + A[i])
for i in range(M):
	b.append(b[i] + B[i])

ans, j = 0, M
for i in range(N + 1):
	if a[i] > K:
		break
	while b[j] > K - a[i]:
		j -= 1
	ans = max(ans, i + j)
print(ans)
# Judge status: Wrong Answer
N,K = map(int, input().split())
A = list(map(int, input().split()))

B = [1]
for i in range(N):
    s = B[i]
    if A[s-1] != 1:
        B.append(A[s-1])
    else:
        break
    
l = len(B)
print(B[(K%l)])
# Judge status: Accepted
first= input()
first = first.split()

N = int(first[0])
L =[]
for i in range(N):
  s = input()
  L.append(s)
  
L.sort()
for i in L:
  print(i,end="")
# Judge status: Accepted
N = int(input())
S = set()
for _ in range(N):
	S.add(input())
print(len(S))
# Judge status: Wrong Answer
S = input()
s = S.count('>')
ans = s*(s+1)/2

print(int(ans))
# Judge status: Accepted
s=input()
n=len(s)
x=0
y=n-1
for i in range(n):
    if s[i]=='A':
        x=i
        break
for i in range(n-1,0,-1):
    if s[i]=='Z':
        y=i
        break

print(y-x+1)
# Judge status: Accepted
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do():
    a,b,c=INTM()
    print(c//a*b)
if __name__ == '__main__':
    do()
# Judge status: Accepted
def cal(n,x):
    res=0
    while n>0:
        res+=n%x
        n//=x
    return res

N=int(input())

ans=N
for i in range(N+1):
    ans=min(ans,cal(i,6)+cal(N-i,9))
print(ans)
# Judge status: Accepted
N = int(input())
W = list(map(int, input().split()))
m = float('inf')
for i in range(N):
    m = min(m, abs(sum(W[:i]) - sum(W[i:])))
print(m)
# Judge status: Accepted
n = int(input())
a,b = [],[]
for i in range(n):
  x,y = map(int,input().split())
  a.append(x+y)
  b.append(x-y)

a.sort()
b.sort()
ans = max(a[-1]-a[0],b[-1]-b[0])
print(ans)
# Judge status: Wrong Answer
n = int(input())
ans = 0
for i in range(1,n+1):
    ans += ((i+i*(n//i))*(n//i))//2
    #print(ans)
print(ans)
# Judge status: Accepted

n = int(input())


def num2alpha(num):
    if num <= 26:
        return chr(64+num)
    elif num % 26 == 0:
        return num2alpha(num//26-1)+chr(90)
    else:
        return num2alpha(num//26)+chr(64+num % 26)


print(num2alpha(n).lower())
# Judge status: Wrong Answer
import sys

def s(d, i=1, a=1):
    a += i*2
    if d <= 1:
        return a
    return s(d-1,i=i*2, a=a)

H = int(input())

count = 0

while True:
    count += 1
    
    H = H // 2
    
    if H <= 1:
        break

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

L = [2,1]
for i in range(2,n):
  k = L[i-2]+L[i-1]
  L.append(k)
  
print(L[len(L)-1])
# Judge status: Wrong Answer
def resolve():
    '''
    code here
    '''
    N, K = [int(item) for item in input().split()]
    As = [int(item) for item in input().split()]

    if K > 2:
        print(N//(K-1))
    else:
        print(N-1)


if __name__ == "__main__":
    resolve()
# Judge status: Wrong Answer
X,Y,Z=map(int,input().split())
print((X-Z)//Y+Z)
# Judge status: Accepted
K, X = map(int, input().split())

Z = int(500 * K)
if Z >= X :
    print("Yes")

else:
    print("No")
# Judge status: Accepted
n,k=map(int,input().split())
x=list(map(int,input().split()))
print(min(x[i]-x[i-k+1]+min(abs(x[i]),abs(x[i-k+1])) for i in range(k-1,n)))
# Judge status: Accepted
# C Repsept

k = int(input())

mod = 0
cnt = 0
for i in range(k):
  mod = (mod*10+7) % k
  cnt += 1  
  if mod == 0:
    print(cnt)
    exit()

print(-1)
# Judge status: Accepted
def count(n):
	N = []
	while n > 0:
		N.append(n % 10)
		n = n // 10

	if N[0] == N[4] and N[1] == N[3]:
		return 1
	else:
		return 0

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

for i in range(A, B + 1):
	if count(i) == 1:
		ans += 1


print(int(ans))
# Judge status: Wrong Answer
a=int(input())
fizzbuzz = 0
for i in range(1,a+1):
  if (i%3) == 0:
      fizzbuzz += i
  elif (i%5) == 0:
      fizzbuzz += i
all_ = (1+a)*a/2
print(all_-fizzbuzz)
# Judge status: Wrong Answer
A, B, C = map(int, input().split())
print('Yes' if A+2*B >= C else 'No')
# Judge status: Accepted
n = int(input())
h = list(map(int,input().split()))
if n<2:
  print(0)
else:
  mvmn = 0
  maxmvm = 0
  for i in range(1,n):
    if h[i]>h[i-1]:
      mvmn = 0
    else:
      mvmn += 1
      maxmvm = max(maxmvm,mvmn)
  print(maxmvm)
# Judge status: Accepted
n,c,k=map(int,input().split())
t=[int(input()) for _ in range(n)]
t.sort()
ans=0
num=0
for i in range(n+3):
    if num>=n:
        break
    num2=t[num]+k
    ans+=1
    for j in range(c-1):
        num+=1
        if num==n:
            break
        if t[num]>num2:
            num-=1
            break
    num+=1
print(ans)
# Judge status: Accepted
n,k,q = map(int,input().split())
cnt = [0]*n
A = []
for i in range(q):
    a = int(input())-1
    cnt[a]+=1
s =sum(cnt)
for c in cnt:
    if s-c>=k:print("No")
    else:print("Yes")
# Judge status: Wrong Answer
A,B,C,D=map(int,input().split())

while A>0 and C>0:
  A=A-D
  C=C-B
if A>C:
  print("Yes")
else:
  print("No")
# Judge status: Wrong Answer
n, a, b = map(int, input().split())
c = a + b
q = n // c
mod = n % c
if a == 0:
    print(0)
else:
    print(q*a+mod)
# Judge status: Accepted
a,b,k = map(int,input().split())
ans_list = []
for i in range(a,a+k):
    ans_list.append(i)
    if ans_list[-1] == b:
        [print(i) for i in ans_list]
        exit()
for i in range(b-k+1,b+1):
    if ans_list.count(i) == 0:
        ans_list.append(i)
[print(i) for i in ans_list]
# Judge status: Wrong Answer
n,c,k = map(int,input().split())
t = [int(input()) for _ in range(n)]
t = sorted(t)
ans = 0
g = [0]*(n+1)
now = 0
for i in range(n-1):
    if t[i]+k >= t[i+1]:
        if g[now]>=3:
            now += 1
            g[now] += 1
            continue
        g[now] += 1
    else:
        g[now] += 1
        now += 1
g[now] += 1
for i in g:
    ans += -(-i//c)
print(ans)
# Judge status: Wrong Answer
number = int(input())
if number in range(400, 599):
    print('8')
elif number in range(600, 799):
    print('7')
elif number in range(800, 999):
    print('6')
elif number in range(1000, 1199):
    print('5')
elif number in range(1200, 1399):
    print('4')
elif number in range(1400, 1599):
    print('3')
elif number in range(1600, 1799):
    print('2')
elif number in range(1800, 1999):
    print('1')
# Judge status: Accepted
n,k = map(int,input().split())
di = [0]*(10**5)
for i in range(n):
    a,b = map(int,input().split())
    di[a-1] += b
q = 0
p = 0
while True:
    q += di[p]
    if k <= q:
        print(p +1)
        break
    p += 1
# Judge status: Accepted
# coding:utf-8
x = int(input())
r = 0
for k in range(360):
    r += x
    if r % 360 == 0:
        break
print(k + 1)
# Judge status: Accepted
a,b,c=[int(i) for i in input().split()]
if b>=c>=a:
  print('Yes')
else:
  print('No')
# Judge status: Wrong Answer
N, M = map(int, input().split())
A = list(map(int, input().split()))
t = 0
S = 0
for Ai in A:
    S=S+Ai

for Ai in A:
    if Ai >= S/(4*M):
        t = t+1

if t >= M:
    print('yes')
else:
    print('no')
# Judge status: Wrong Answer
S = list(input())
c = 0
for i in range(int(len(S)/2)):
    if S[i] != S[-(i+1)]:
        c += 1
print(c)
# Judge status: Accepted
N, R = map(int, input().split())

ans = 100*(10-N)+R
if N>=10:
  print(R)
else:
  print(ans)
# Judge status: Accepted
def main():
    n, *x = map(int, open(0).read().split())
    y = sorted(x)
    a, b = y[n // 2 - 1], y[n // 2]
    ans = ""
    for i in x:
        if i <= a:
            ans += str(b) + "\n"
        else:
            ans += str(a) + "\n"

    print(ans)


if __name__ == '__main__':
    main()
# Judge status: Accepted
n = "".join(list(input().split()))
n = int(n)
if n % 4 == 0:
  print('YES')
else:
  print('NO')
# Judge status: Accepted
#abc153c
n,k=map(int,raw_input().split())
h=map(int,raw_input().split())
h.sort(reverse=True)
if n<=k:
 print 0
else:
 print sum(h[k::])