#                         author:  kagemeka 

#                         created: 2019-11-07 11:52:43(JST)

import sys

# import collections

# import math

# import string

# import bisect

# import re

# import itertools

# import statistics

# import functools

# import operator



def main():

    n, *x = (int(i) for i in sys.stdin.read().split())

    s_x = list(sorted(x))

    half = n // 2

    m_s, m_l = s_x[half - 1], s_x[half]

    for i in x:

        print((m_l if i < m_l else m_s))



if __name__ == "__main__":

    # execute only if run as a script

    main()

import sys



n, *x = map(int, sys.stdin.read().split())



def main():

    y = sorted(x)

    r = y[n // 2]

    l = y[n // 2 - 1]

    

    for i in range(n):

        if x[i] <= l:

            yield r

        else:

            yield l



if __name__ == '__main__':

    ans = main()

    print(*ans, sep='\n')

#                         author:  kagemeka
#                         created: 2019-11-07 11:52:43(JST)
import sys

# import collections
# import math
# import string
# import bisect
# import re
# import itertools
# import statistics
# import functools
# import operator
def main():
    n, *x = (int(i) for i in sys.stdin.read().split())
    s_x = list(sorted(x))
    half = n // 2
    m_s, m_l = s_x[half - 1], s_x[half]
    for i in x:
        print((m_l if i < m_l else m_s))


if __name__ == "__main__":
    # execute only if run as a script
    main()

import sys

n, *x = map(int, sys.stdin.read().split())


def main():
    y = sorted(x)
    r = y[n // 2]
    l = y[n // 2 - 1]
    for i in range(n):
        if x[i] <= l:
            yield r
        else:
            yield l


if __name__ == "__main__":
    ans = main()
    print(*ans, sep="\n")

-#                         author:  kagemeka -#                         created: 2019-11-07 11:52:43(JST) -# import collections -# import math -# import string -# import bisect -# import re -# import itertools -# import statistics -# import functools -# import operator +n, *x = map(int, sys.stdin.read().split()) + + -    n, *x = (int(i) for i in sys.stdin.read().split()) -    s_x = list(sorted(x)) -    half = n // 2 -    m_s, m_l = s_x[half - 1], s_x[half] -    for i in x: -        print((m_l if i < m_l else m_s)) +    y = sorted(x) +    r = y[n // 2] +    l = y[n // 2 - 1] +    for i in range(n): +        if x[i] <= l: +            yield r +        else: +            yield l -    # execute only if run as a script -    main() +    ans = main() +    print(*ans, sep="\n")