Imports System
Imports System.IO
Imports System.Collections.Generic

class Program
    shared sub main ()
        dim sw = new StreamWriter(Console.OpenStandardOutput())
        sw.AutoFlush = false
        Console.SetOut(sw)
        dim n = Int32.Parse(Console.ReadLine())
        dim sp() as String = Console.ReadLine().Split()
        dim a(n-1) as Int32
        dim b(n-1) as Int32
        dim t as Int32
        for i as Int32 = 0 to n-1
            Int32.TryParse(sp(i), t)
            a(i) = t
            b(i) = t
        next i
        Array.sort(b)
        dim x = n \ 2 - 1
        for i as Int32 = 0 to n-1
            if a(i) <= b(x) then
                Console.WriteLine(b(x + 1))
            else
                Console.WriteLine(b(x))
            end if
        next i
        Console.Out.Flush()
    end sub
end class