CodeEff/ECCO huggingface dataset:
# Original solution
import statistics
import copy

N = int(eval(input()))
X = list(map(int, input().split()))

for i in range(N):
    buf = copy.copy(X)
    buf.pop(i)
    print((statistics.median(buf)))

# Optimized solution
N = int(eval(input()))
X = list(map(int, input().split()))
Y = sorted(X)
a = Y[N // 2 - 1]
b = Y[N // 2]

for i in X:
    if i <= a:
        print(b)
    elif i >= b:
        print(a)
# Original solution
#-*-coding:utf-8-*-

import statistics
import copy

def median(tmp_numbers):
    return statistics.median(tmp_numbers)

def main():
    numbers=[]
    n = int(eval(input()))
    numbers=list(map(int,input().split()))

    for i in range(n):
        tmp_numbers=copy.deepcopy(numbers)
        tmp_numbers.pop(i)
        ans = median(tmp_numbers)
        print(ans)

if __name__=="__main__":
    main()

# Optimized solution
#-*-coding:utf-8-*-

def main():
    numbers=[]
    n = int(eval(input()))
    numbers=list(map(int,input().split()))
    sort_numbers=sorted(numbers)
# left/right算出はsorted arrayで
    left=sort_numbers[n//2-1]
    right=sort_numbers[n//2]
# loopは元の配列で
    for i in numbers:
        if i > left:
            print(left)
        else:
            print(right)

if __name__=="__main__":
    main()
# Original solution
ri = lambda: int(input())
rl = lambda: list(map(int,input().split()))
rr = lambda N: [ri() for _ in range(N)]
YN = lambda b: print('YES') if b else print('NO')
yn = lambda b: print('Yes') if b else print('No')
OE = lambda x: print('Odd') if x%2 else print('Even')
INF = 10**18

N=ri()
X=rl()
Xs = sorted(X)
Xsl = Xs[:N//2]
Xsr = Xs[N//2:]

for x in X:
    if x in Xsl:
            print(Xsr[0])
    else:
            print(Xsl[-1])



# Optimized solution
ri = lambda: int(input())
rl = lambda: list(map(int,input().split()))
rr = lambda N: [ri() for _ in range(N)]
YN = lambda b: print('YES') if b else print('NO')
yn = lambda b: print('Yes') if b else print('No')
OE = lambda x: print('Odd') if x%2 else print('Even')
INF = 10**18

N=ri()
X=rl()
Xs = sorted(X)
Xsl = Xs[:N//2]
Xsr = Xs[N//2:]
r = Xsr[0]
l = Xsl[-1]

for x in X:
    if x <= l:
            print(r)
    else:
            print(l)
# Original solution
def mid(n):
    return int((n + 1) / 2)

N = int(eval(input()))
X = list(map(int, input().split()))
save = X[:]
for i in range(N):
    X = save[:]
    del X[i]
    X.sort()
    print((X[mid(N - 1) - 1]))



# Optimized solution
N = int(eval(input()))
X = list(map(int, input().split()))

save = X[:]

save.sort()

midL = save[int(N / 2 - 1)]
midR = save[int(N / 2)]

for i in X:
    if i <= midL:
        print(midR)
    else:
        print(midL)
# Original solution
N=int(input())
L=list(map(int,input().split()))
[print(sorted(L[:i]+L[i+1:])[N//2-1]) for i in range(N)]


# Optimized solution
N=int(eval(input()))
L=list(map(int,input().split()))
LL=sorted(L)
M1=LL[N//2-1]
M2=LL[N//2]
for i in L:
  if i>=M2:
    print(M1)
  else:
    print(M2)
# Original solution
n=int(eval(input()))
x=list(map(int,input().split()))
for i in range(n):
    z=x.pop(i)
    y=sorted(x)
    print((y[n//2-1]))
    x.insert(i,z)
    


# Optimized solution
n=int(eval(input()))
x=list(map(int,input().split()))
y=sorted(x)
l=y[n//2-1]
r=y[n//2]
for a in x:
  print((l if a >= r else r))
# Original solution
from statistics import median
N = int(eval(input()))
X = list(map(int, input().split()))

for i in range(N):
    print((median(X[:i]+X[i+1:])))

# Optimized solution
N = int(eval(input()))
X = list(map(int, input().split()))

tmpls = sorted(X)
low = tmpls[N//2 -1]
high = tmpls[N//2]

for i in X:
    if i > low:
        print(low)
    else:
        print(high)
# Original solution
from collections import deque

N=int(eval(input()))
X=list(map(int,input().split()))

for i in range(N):
  d=deque(X)
  d.remove(X[i])
  d=list(d)
  d.sort()
  print((d[N//2-1]))

# Optimized solution
N=int(eval(input()))
X=list(map(int,input().split()))

x=[]
for i in range(N):
  x.append(X[i])
x.sort()

for i in range(N):
  if X[i]<x[N//2]:
    print((x[N//2]))
  else:
    print((x[N//2-1]))
# Original solution
n = int(eval(input()))
x = list(map(int, input().split()))

def med(a):
    b = sorted(a)
    num = int((len(b)+1)/2)
    return b[num-1]


for i in range(n):
    temp = x[:]
    temp.remove(x[i])
    print((med(temp)))

# Optimized solution
n = int(eval(input()))
x = list(map(int, input().split()))

a = len(x)
b = sorted(x)
fa = b[int((a/2)-1)]
se = b[int(a/2)]

for i in range(n):
    if x[i] <= fa:
        print(se)
    else:
        print(fa)
# Original solution
n = int(eval(input()))
x = list(map(int, input().split()))

sx = sorted(x)
m = (n+1)//2
med1 = sx[m - 1]
med2 = sx[m]

for _x in x:
    if _x <= med1:
        print(med2)
    else:
        print(med1)

# Optimized solution
n = int(eval(input()))
x = list(map(int, input().split()))
x_ = sorted(x)
c = x_[n//2 - 1]
c_ = x_[n//2]

for i in range(n):
    if x[i] <= c:
        print(c_)
    else:
        print(c)
# Original solution
n=int(eval(input()))
x=list(map(int,input().split()))
for i in range(n):
    x1=x[:i]
    x2=x[i+1:]
    x1.extend(x2)
    x1.sort()
    print((x1[n//2-1]))


# Optimized solution
n=int(eval(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]))
    else:
        print((y[n//2-1]))
# Original solution
n = int(eval(input()))
nums = list(map(int,input().split()))

for i in range(len(nums)):
  tmp_nums = sorted(nums[:i]+nums[i+1:])
  print((tmp_nums[len(tmp_nums)//2]))

# Optimized solution
n = int(eval(input()))
x = list(map(int, input().split()))
y = sorted(x)
a = y[n//2-1]
b = y[n//2]
for i in range(n):
  if x[i] <= a:
    print(b)
  else:
    print(a)
# Original solution
def main():
    N = int(eval(input()))
    X = [int(i) for i in input().split()]
    
    sorted_X = sorted(X)
    median_1 = sorted_X[int(N/2)-1]
    median_2 = sorted_X[int(N/2)]
    
    for i in range(N):
        remove_num = X[i]
        if(sorted_X.index(remove_num) > (N/2 - 1)):
            print(median_1)
        else:
            print(median_2)
    
if __name__=="__main__":
    main()

# Optimized solution
def main():
    N = int(eval(input()))
    X = [int(i) for i in input().split()]
    
    sorted_X = sorted(X)
    median_1 = sorted_X[int(N/2)-1]
    median_2 = sorted_X[int(N/2)]
    
    for i in range(N):
        remove_num = X[i]
        if(remove_num > median_1):
            print(median_1)
        else:
            print(median_2)
    
if __name__=="__main__":
    main()
# Original solution
n = (int)(eval(input()))
l = (list)(list(map(int, input().split())))

sorted_l = sorted(l)

for i in range(n):
    tmp = sorted_l.copy()
    tmp.remove(l[i])
    med = tmp[(n-1)//2]
    print(med)


# Optimized solution
n = (int)(eval(input()))
l = (list)(list(map(int, input().split())))

tmp = l.copy()
tmp.sort()

left = tmp[n//2-1]
right = tmp[n//2]

for item in l:
    if item <= left:
        print(right)
    else:
        print(left)
# Original solution
N = int(eval(input()))
A = list(map(int, input().split()))

from statistics import median 
for i in range(len(A)):
    tmp = A.pop(0)
    print((median(A)))
    A.append(tmp)

# Optimized solution
N = int(eval(input()))
X = list(map(int,input().split()))
copy_X = X.copy()
X.sort()
for i in copy_X:
    if(i<X[N//2]):
        print((X[N//2]))
    else:
        print((X[(N//2)-1]))
# Original solution
N = int(eval(input()))
X = list(map(int, input().split()))
Y = X.copy()
Y.sort()
for i in range(len(Y)):
	if X[i] < Y[int(N / 2)]:
		print((Y[int(N / 2)] ))
	else:
		print((Y[int(N / 2 - 1)]))

# Optimized solution
N = int(eval(input()))
X = list(map(int, input().split()))
Y = X.copy()
Y.sort()
for i in range(len(Y)):
	if X[i] < Y[int(N / 2)]:
		print((Y[int(N / 2)] ))
	else:
		print((Y[int(N / 2) - 1]))
# Original solution
n = int(eval(input()))
arr = list(map(int,input().split()))

for i in range(n):
    tarr = list(arr)
    tarr.remove(tarr[i])
    tarr.sort()
    print((tarr[(len(tarr) + 1) // 2 - 1]))

# Optimized solution
n = int(eval(input()))
arr = list(map(int,input().split()))

tarr = list(arr)

tarr.sort()

num1 = tarr[len(tarr) // 2 - 1]
num2 = tarr[len(tarr) // 2]

for i in range(n):
    if arr[i] < num2:
        print(num2)
    else:
        print(num1)
# Original solution
N = int(eval(input()))
X = list(map(int, input().split()))
temp = 0
for i in range(N):
    temp = X[i]
    X[i] = 0
    print((sorted(X)[int(N/2)]))
    X[i] = temp

# Optimized solution
N = int(eval(input()))
X = list(map(int, input().split()))
Xs = sorted(X)
for i in range(N):
    if X[i] < Xs[int(N/2)]:
        print((Xs[int(N/2)]))
    else:
        print((Xs[int(N/2)-1]))
# Original solution
def main():
    import sys
    n=int(sys.stdin.readline())
    m=(n-1)//2+2
    x=tuple(map(int,input().split()))
    x = (0,) + x + (0,)
    for i in range(n):
        print((sorted(x[:i+1]+x[i+2:])[m]))
if __name__ == '__main__':
    main()

# Optimized solution
# ABC094C - Many Medians (ARC095C)
def main():
    n = int(eval(input()))
    x = list(map(int, input().split()))
    # 偶数個の数から一つ数を取り除いたものの中央値はl,hのいずれか.
    l, h = sorted(x)[n // 2 - 1 : n // 2 + 1]
    ans = [h if e <= l else l for e in x] # l以下の値を取り除いたならば中央値はh
    print(("\n".join(map(str, ans))))
if __name__ == "__main__":
    main()
# Original solution
N=int(eval(input()))
X_raw=list(map(int,input().split()))

for i in range(N):
    X=X_raw[:]
#    X.pop(i)
    del X[i]
    X.sort()
    print((X[int(N/2-1)]))




# Optimized solution
N=int(eval(input()))
X=list(map(int,input().split()))
sX=sorted(X)
for i in X:
    if i<=sX[int(N/2-1)]:
        print((sX[int(N/2)]))
    else:
        print((sX[int(N/2-1)]))
# Original solution
import statistics

N=int(eval(input()))
Xs=list(map(int, input().split()))

for i in range(len(Xs)):
    Xs_i=Xs[:i]+Xs[i+1:]
    med=statistics.median(Xs_i)
    print(med)

# Optimized solution
N=int(eval(input()))
Xs=list(map(int, input().split()))
nXs=sorted(Xs)

medL=nXs[len(nXs)//2-1]
medR=nXs[len(nXs)//2]

if medL == medR:
    for i in range(N):
        print(medL)
else:
    for i in Xs:
        if i<=medL:
            print(medR)
        else:
            print(medL)
# Original solution
import sys
input = sys.stdin.readline
# sys.setrecursionlimit(100000)


def median(l):
    l = sorted(l)
    if len(l) % 2 == 1:
        return l[len(l) // 2]
    else:
        return (l[len(l)//2] + l[(len(l)//2)-1])//2


def main():
    N = int(input().strip())
    X_list = [int(i) for i in input().strip().split()]
    num = 0

    for i in range(N):
        if i < N-1:
            print((median(X_list[:i]+X_list[i+1:])))

        else:
            print((median(X_list[:i])))


if __name__ == "__main__":
    main()


# Optimized solution
import sys
input = sys.stdin.readline
# sys.setrecursionlimit(100000)


def main():
    N = int(input().strip())
    X_list = [int(i) for i in input().strip().split()]
    sorted_x = sorted(X_list)

    left = sorted_x[(N // 2)-1]
    right = sorted_x[N // 2]
    for x in X_list:
        if x <= left:
            print(right)
        else:
            print(left)


if __name__ == "__main__":
    main()
# Original solution
n = int(eval(input()))
x = list(map(int, input().split()))

c = (n - 1) // 2

for i in range(len(x)):
    x2 = x.copy()
    x2.pop(i)
    x2.sort()
    print((x2[c]))


# Optimized solution
n = int(eval(input()))
x = list(map(int, input().split()))

x2 = x.copy()
x2.sort()
c1 = x2[n // 2 - 1]
c2 = x2[n // 2]
for i in x:
    if(c1 >= i):
        print(c2)
    else:
        print(c1)
# Original solution
n = int(eval(input()))
X = list(map(int,input().split()))
h = int(n/2)
for i in range(n):
  xis = []
  if i != 0:
    xis += X[0:i]
    xis += X[i+1:n]
    print((sorted(xis)[h-1]))
  else:
    xis = X[1:]
    print((sorted(xis)[h-1]))

# Optimized solution
n = int(eval(input()))
X = list(map(int,input().split()))
h = int(n/2)
Xs = sorted(X)
m1 = Xs[h-1]
m2 = Xs[h]

for i in range(n):
  if X[i] <= m1:
    print(m2)
  else:
    print(m1)
# Original solution
N = int(eval(input()))
X = tuple(map(int, input().split()))

for i in range(N):
    Y = list(X)
    del Y[i]
    Y.sort()
    print((Y[N//2-1]))


# Optimized solution
N = int(eval(input()))
X = tuple(map(int, input().split()))

Y = list(X)
Y.sort()

greater_median = Y[N//2]
smaller_median = Y[N//2-1]
average = (greater_median + smaller_median)/2

for x in X:
    if x <= average:
        print(greater_median)
    else:
        print(smaller_median)
# Original solution
n = int(eval(input()))
x = list(map(int, input().split()))
a = sorted(x)

mid_n = len(a)//2
for i in range(n):
    if a.index(x[i]) < mid_n:
        print((a[mid_n]))
    else:
        print((a[mid_n-1]))

# Optimized solution
n = int(eval(input()))
x = list(map(int, input().split()))
a = sorted(x)

mid_n = len(a)//2
right = a[mid_n]
left = a[mid_n-1]

for i in range(n):
    if right > x[i]:
        print(right)
    else:
        print(left)
# Original solution
def main():
    #from sys import stdin, setrecursionlimit
    #setrecursionlimit(10**9)
    #r = input()
    #n = int(input())
    #a, b = map(int, input().split())
    #s, y = input().split()
    #a = input().split()
    #a = [int(input()) for i in range(n)]
    #a = list(map(int, input().split()))
    #a = [list(map(int, input().split())) for i in range(n)]
    #a = [int(s) - 1 for s in input().split()]
    #l=[int(input()) for _ in range(int(input()))]
    #res = 0
    n = int(eval(input()))
    x = list(map(int, input().split()))
    x2 = sorted(x)
    med = x2[(n+1)//2-1]
    for i in range(n):
        x3 = sorted(x[:i] + x[i+1:])
        print((x3[n//2-1]))

if __name__ == '__main__':
    main()


# Optimized solution
def main():
    #from sys import stdin, setrecursionlimit
    #setrecursionlimit(10**9)
    #r = input()
    #n = int(input())
    #a, b = map(int, input().split())
    #s, y = input().split()
    #a = input().split()
    #a = [int(input()) for i in range(n)]
    #a = list(map(int, input().split()))
    #a = [list(map(int, input().split())) for i in range(n)]
    #a = [int(s) - 1 for s in input().split()]
    #l=[int(input()) for _ in range(int(input()))]
    #res = 0
    n = int(eval(input()))
    x = list(map(int, input().split()))
    x2 = sorted(x)
    med1 = x2[n//2-1]
    med2 = x2[n//2]
    for i in x:
        if i <= med1:
            print(med2)
        else:
            print(med1)

if __name__ == '__main__':
    main()
# Original solution
def get_values():
    return [int(a) for a in input().split()]

N, = get_values()
Xs = get_values()

for idx, xi in enumerate(Xs):
    Ys = sorted(Xs[:idx] + Xs[idx+1:])
    print((Ys[len(Ys) // 2]))

# Optimized solution
def get_values():
    return [int(a) for a in input().split()]

# PROBLEM C
N, = get_values()
Xs = get_values()

Ys = sorted(Xs)
mdx = len(Ys) // 2
x2b = {x:Ys[mdx if idx < mdx else mdx - 1] for idx, x in enumerate(Ys)}
for x in Xs:
    print((x2b[x]))
# Original solution
#!usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
import itertools
sys.setrecursionlimit(10**5)
stdin = sys.stdin
def LI(): return list(map(int, stdin.readline().split()))
def LF(): return list(map(float, stdin.readline().split()))
def LI_(): return list([int(x)-1 for x in stdin.readline().split()])
def II(): return int(stdin.readline())
def IF(): return float(stdin.readline())
def LS(): return list(map(list, stdin.readline().split()))
def S(): return list(stdin.readline().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007

#A
def A():
    return

#B
def B():
    return

#C
def C():
    n = II()
    x = LI()
    for i in range(n):
        xb = x[::1]
        del xb[i]
        xb.sort()
        print((xb[n//2-1]))
    return

#D
def D():
    return

#E
def E():
    return

#F
def F():
    return

#G
def G():
    return

#H
def H():
    return

#Solve
if __name__ == '__main__':
    C()


# Optimized solution
#!usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
import itertools
sys.setrecursionlimit(10**5)
stdin = sys.stdin
def LI(): return list(map(int, stdin.readline().split()))
def LF(): return list(map(float, stdin.readline().split()))
def LI_(): return list([int(x)-1 for x in stdin.readline().split()])
def II(): return int(stdin.readline())
def IF(): return float(stdin.readline())
def LS(): return list(map(list, stdin.readline().split()))
def S(): return list(stdin.readline().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007

#A
def A():
    return

#B
def B():
    return

#C
def C():
    n = II()
    x = LI()
    xb = x[::1]
    xb.sort()
    a = xb[n // 2 - 1]
    b = xb[n // 2]
    for i in range(n):
        if x[i] <= a:
            print(b)
        elif x[i] >= b:
            print(a)
        
    return

#D
def D():
    return

#E
def E():
    return

#F
def F():
    return

#G
def G():
    return

#H
def H():
    return

#Solve
if __name__ == '__main__':
    C()
# Original solution
N = int(eval(input()))
x_list = [i for i in map(int, input().split())]

for i, x in enumerate(x_list):
    tmp = x_list.copy()
    tmp.pop(i)
    tmp.sort()
    print((tmp[(len(tmp))//2]))

# Optimized solution
N = int(eval(input()))
x_list = [i for i in list(map(int, input().split()))]
tmp = x_list.copy()
x_list.sort()
big = x_list[len(x_list)//2]
small = x_list[len(x_list)//2-1]

for x in tmp:
    if x >= big:
        print(small)
    else:
        print(big)
# Original solution
import statistics
from collections import deque

d = deque()

a = int(eval(input()))
d = list(map(int, input().split()))

#print(d)

for i in range(a):
  b = d.pop(0)
  print((statistics.median(d)))
  d.append(b)
#  print(d)

# Optimized solution
import copy

a = int(eval(input()))
l = list(map(int, input().split()))
l2 = sorted(copy.deepcopy(l))

#print(l2)

for i in l:
  if i < l2[a//2]:
    print((l2[a//2]))
  else:
    print((l2[a//2 - 1]))
# Original solution
import math
import statistics
import copy

N = int(eval(input()))
li = list(map(int, input().split()))

for i in range(N):
  a = copy.copy(li)
  a.pop(i)
  print((statistics.median(a)))

# Optimized solution
n = int(eval(input()))
s = list(map(int, input().split()))
sx = sorted(s)
a = sx[(n//2)-1]
b = sx[n//2]
for i in s:
  if i <= a:
    print(b)
  else:
    print(a)
# Original solution
import copy
n = int(eval(input()))
a = list(map(int, input().split()))
a2 = copy.copy(a)
a2.sort()
for i in range(n):
    if a2.index(a[i]) <= n//2 - 1:
        print((a2[n//2]))
    else:
        print((a2[n//2 - 1]))

# Optimized solution
import copy
n = int(eval(input()))
a = list(map(int, input().split()))
a2 = copy.copy(a)
a2.sort()
x = a2[n//2 - 1]
y = a2[n//2]
for i in a:
    if i <= x:
        print(y)
    else:
        print(x)
# Original solution
from operator import itemgetter
import collections
N = int(eval(input()))

X = list(map(int, input().split()))
d = {} 
for x in X:
  if x in d:
    d[x] += 1
  else:
    d[x] = 1
    
keys = sorted(list(d.keys()), reverse = True)

for x in X:
  idx = N//2
  d[x] -= 1
  for k in keys:
    idx -= d[k]
    if idx <= 0:
      print(k)
      break
  d[x] += 1

# Optimized solution
N = int(eval(input()))
X = list(map(int,input().split()))
SX = sorted(X)
m1,m2 = SX[N//2-1],SX[N//2]

for a in X:
    print((m2 if a <= m1 else m1))
# Original solution
n=int(eval(input()))
x = [int(i) for i in input().split()]
x = sorted([[x[i], i] for i in range(n)])
#print(x)
ans = [0]*n
#print(ans)
for i in range(n):
  x_ = x[:i]+x[i+1:]
#  print(x_)
  ans[x[i][1]] = x_[n//2-1][0]
for i in range(n):
  print((ans[i]))

# Optimized solution
n=int(eval(input()))
x = [int(i) for i in input().split()]
x = sorted([[x[i], i] for i in range(n)])
#print(x)
ans = [0]*n
for i in range(n):
  if i < n//2:
    ans[x[i][1]] = x[n//2][0]
  else:
    ans[x[i][1]] = x[n//2-1][0]
for i in range(n):
  print((ans[i]))
# Original solution
#!/usr/bin/env python3
n = int(eval(input()))
x = list(map(int,input().split()))
a = sorted(x)
base = a[n//2]
for i in range(n):
    #if x[i] > a[n//2-1] or (x[i] == a[n//2-1] and a.count(x[i]) > 1): print(a[n//2-1])
    if x[i] > a[n//2-1]: print((a[n//2-1]))
    else: print((a[n//2]))

# Optimized solution
#!/usr/bin/env python3
n = int(eval(input()))
x = list(map(int,input().split()))
a = sorted(x)
for j in x:
    if j <= a[n//2-1]: print((a[n//2]))
    else: print((a[n//2-1]))
# Original solution
n=int(eval(input()))
x=list(map(int,input().split()))
t=x
for i in range(n):
    x=x[:i]+x[i+1:]
    x.sort()
    #print(x)
    print((x[(n-1)//2]))
    x=t
  

# Optimized solution
n=int(eval(input()))
x=list(map(int,input().split()))
t=sorted(x)
m=n//2
a=t[m-1];b=t[m]
#print(a,b)
for i in range(n):
    if x[i]<=a:
        print(b)
    else:
        print(a)
# Original solution
import copy

n = int(eval(input()))

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

soredx = sorted(x)

for i in range(n):
    temp = copy.deepcopy(soredx)
    temp.remove(x[i])
    print((temp[int(n/2-1)]))


# Optimized solution
n = int(eval(input()))

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

soredx = sorted(x)

migi = soredx[int(n/2-1)]
hidari = soredx[int(n/2)]

for i in range(n):
    if(migi<x[i]):
        print(migi)
    else:
        print(hidari)
# Original solution
import bisect
N = int(eval(input()))
X = list(map(int, input().split()))

A = []
for i in range(N):
    bisect.insort(A, X[i])

leftB = A[N//2 - 1]
rightB = A[N//2]

for i in range(N):
    if X[i] <= leftB:
        print(rightB)
    else:
        print(leftB)


# Optimized solution
N = int(eval(input()))
X = list(map(int, input().split()))
A = sorted(X)

leftB = A[N//2 - 1]
rightB = A[N//2]

for i in range(N):
    if X[i] <= leftB:
        print(rightB)
    else:
        print(leftB)
# Original solution
N=int(eval(input()))
X=[int(i) for i in input().split()]
for i in range(N):
  x=X.copy()
  del x[i]
  x.sort()
  print((x[N//2-1]))
  

# Optimized solution
N=int(eval(input()))
X=[int(i) for i in input().split()]
x=X.copy()
x.sort()
mina=x[N//2-1]
minb=x[N//2]
for i in range(N):
  if mina<X[i]:
    print(mina)
  else :
    print(minb)
# Original solution
import copy
 
n = int(eval(input()))
x = list(map(int,input().split()))
 
 
for i in range(n):
  xx = copy.deepcopy(x)
  xx.pop(i)
  xx.sort()
  print((xx[(len(xx) + 1) // 2 - 1]))

# Optimized solution
import copy

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

xx= sorted(x)
L_x = xx[n//2 - 1]
R_x = xx[n//2]

for arr in x:
  print((L_x if R_x <= arr else R_x))
# Original solution
import copy

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

for i in range(n):
    memo = copy.deepcopy(x)
    memo.pop(i)
    memo.sort()
    print((memo[(n - 1) // 2]))

# Optimized solution
n = int(eval(input()))
x = list(map(int, input().split()))
xs = sorted(x)
for i in range(n):
    if x[i] <= xs[n // 2 - 1]:
        res = xs[n // 2]
    else:
        res = xs[n // 2 - 1]
    print(res)