import std.algorithm;
import std.array;
import std.container;
import std.conv;
import std.math;
import std.numeric;
import std.range;
import std.stdio;
import std.string;
import std.typecons;

void calc(int[] a) {
    auto p = (a.length - 1) / 2; // 真ん中の位置
    auto s = a.dup.sort();
    foreach (e; a) {
        writeln(e <= s[p] ? s[p + 1] : s[p]);
    }
}

void main() {
    readint;
    auto a = readints;
    calc(a);
}

void scan(T...)(ref T a) {
    string[] ss = readln.split;
    foreach (i, t; T) a[i] = ss[i].to!t;
}
T read(T)() { return readln.chomp.to!T; }
T[] reads(T)() { return readln.split.to!(T[]); }
alias readint = read!int;
alias readints = reads!int;
