N = int(eval(input()))

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

sort_X = sorted(X)

l, r = sort_X[N//2-1], sort_X[N//2]

for x in X:

  if(x <= l):

    print(r)

  else:

    print(l)
N = int(eval(input()))

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

sort_X = sorted(X)

l = sort_X[N//2-1]

r = sort_X[N//2]

for x in X:

  if(x <= l):

    print(r)

  else:

    print(l)
N = int(eval(input()))
X = list(map(int, input().split()))
sort_X = sorted(X)
l, r = sort_X[N // 2 - 1], sort_X[N // 2]
for x in X:
    if x <= l:
        print(r)
    else:
        print(l)

N = int(eval(input()))
X = list(map(int, input().split()))
sort_X = sorted(X)
l = sort_X[N // 2 - 1]
r = sort_X[N // 2]
for x in X:
    if x <= l:
        print(r)
    else:
        print(l)

-l, r = sort_X[N // 2 - 1], sort_X[N // 2] +l = sort_X[N // 2 - 1] +r = sort_X[N // 2]