iN = int(eval(input()))

aX = [int(_) for _ in input().split()]



aXs = sorted(enumerate(aX),key=lambda x:x[1])



iMu  = iN//2

iMd  = iN//2 -1



iMuV = aXs[iMu][1]

iMdV = aXs[iMd][1]



if iMuV == iMdV:

    print(("\n".join([str(iMuV)]*iN)))

else:

    print(("\n".join(map(str,[iMuV if aX[x] < iMuV else iMdV for x in range(iN)]))))

iN = int(eval(input()))

aX = [int(_) for _ in input().split()]

aXs = sorted(aX)



iMu  = iN//2

iMd  = iN//2 -1



iMuV = aXs[iMu]

iMdV = aXs[iMd]



if iMuV == iMdV:

    print(("\n".join([str(iMuV)]*iN)))

else:

    print(("\n".join(map(str,[iMuV if x < iMuV else iMdV for x in aX]))))

iN = int(eval(input()))
aX = [int(_) for _ in input().split()]
aXs = sorted(enumerate(aX), key=lambda x: x[1])
iMu = iN // 2
iMd = iN // 2 - 1
iMuV = aXs[iMu][1]
iMdV = aXs[iMd][1]
if iMuV == iMdV:
    print(("\n".join([str(iMuV)] * iN)))
else:
    print(("\n".join(map(str, [iMuV if aX[x] < iMuV else iMdV for x in range(iN)]))))

iN = int(eval(input()))
aX = [int(_) for _ in input().split()]
aXs = sorted(aX)
iMu = iN // 2
iMd = iN // 2 - 1
iMuV = aXs[iMu]
iMdV = aXs[iMd]
if iMuV == iMdV:
    print(("\n".join([str(iMuV)] * iN)))
else:
    print(("\n".join(map(str, [iMuV if x < iMuV else iMdV for x in aX]))))

-aXs = sorted(enumerate(aX), key=lambda x: x[1]) +aXs = sorted(aX) -iMuV = aXs[iMu][1] -iMdV = aXs[iMd][1] +iMuV = aXs[iMu] +iMdV = aXs[iMd] -    print(("\n".join(map(str, [iMuV if aX[x] < iMuV else iMdV for x in range(iN)])))) +    print(("\n".join(map(str, [iMuV if x < iMuV else iMdV for x in aX]))))