let N =
    stdin.ReadLine()
    |> int
let X =
    stdin.ReadLine().Split()
    |> Array.map int

let sortedX =
    Array.indexed X
    |> Array.sortBy (fun (_,v) -> v)

let (_,larger) = sortedX.[N/2]
let (_,smaller) = sortedX.[N/2-1]

sortedX
|> Array.indexed
|> Array.sortBy (fun (_,(i,_)) -> i)
|> Array.map (fun (l,_) ->
    if l<N/2 then stdout.WriteLine larger
    else stdout.WriteLine smaller)
|> ignore