N = int(eval(input()))

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

L = []

for i in range(N):

  L.append([X[i], i])

L.sort()

for i in range(N):

  if i < N // 2:

    L[i].append(L[N // 2][0])

  else:

    L[i].append(L[N // 2 - 1][0])

for i in range(N):

  L[i][0], L[i][1] = L[i][1], L[i][0]

L.sort()

for i in range(N):

  print((L[i][2]))
N = int(eval(input()))

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

L = [0 for _ in range(N)]

for i in range(N):

  X[i] = X[i] * N + i

X.sort()

d = N // 2

for i in range(N):

  if i < d:

    L[X[i]%N] = X[d] // N

  else:

    L[X[i]%N] = X[d-1] // N

for i in range(N):

  print((L[i]))
N = int(eval(input()))
X = list(map(int, input().split()))
L = []
for i in range(N):
    L.append([X[i], i])
L.sort()
for i in range(N):
    if i < N // 2:
        L[i].append(L[N // 2][0])
    else:
        L[i].append(L[N // 2 - 1][0])
for i in range(N):
    L[i][0], L[i][1] = L[i][1], L[i][0]
L.sort()
for i in range(N):
    print((L[i][2]))

N = int(eval(input()))
X = list(map(int, input().split()))
L = [0 for _ in range(N)]
for i in range(N):
    X[i] = X[i] * N + i
X.sort()
d = N // 2
for i in range(N):
    if i < d:
        L[X[i] % N] = X[d] // N
    else:
        L[X[i] % N] = X[d - 1] // N
for i in range(N):
    print((L[i]))

-L = [] +L = [0 for _ in range(N)] -    L.append([X[i], i]) -L.sort() +    X[i] = X[i] * N + i +X.sort() +d = N // 2 -    if i < N // 2: -        L[i].append(L[N // 2][0]) +    if i < d: +        L[X[i] % N] = X[d] // N -        L[i].append(L[N // 2 - 1][0]) +        L[X[i] % N] = X[d - 1] // N -    L[i][0], L[i][1] = L[i][1], L[i][0] -L.sort() -for i in range(N): -    print((L[i][2])) +    print((L[i]))