Imports System
Imports System.IO
Imports System.Collections.Generic
class p
    shared sub main()
        dim sw = new StreamWriter(System.Console.OpenStandardOutput())
        sw.AutoFlush = false
        System.Console.SetOut(sw)
        
        dim n = Integer.Parse(Console.ReadLine()) - 1
        dim s = Console.ReadLine().Split()
        dim a(n) As Integer
        dim b(n) As Integer
        dim t = 0
        for i as Integer = 0 to n
            t = Integer.Parse(s(i))
            a(i) = t
            b(i) = t
        next i
        Array.Sort(b)
        dim x = CInt((n+1) / 2) - 1
        dim xx = CInt((n+1) / 2)
        for i as Integer = 0 to n
            if a(i) <= b(x) then
                Console.WriteLine(b(xx))
            else
                Console.WriteLine(b(x))
            end if
        next i
        
        System.Console.Out.Flush()
    end sub
end class