import std.stdio, std.algorithm, std.string, std.conv, std.array, std.range, std.math;
int readint() { return readln.chomp.to!int; }
int[] readints() { return readln.split.to!(int[]); }


void main() {
    int n = readint();
    int[] b = readints();
    
    int[] a = b.dup;
    a.sort();
    int x = a[n/2], y = a[n/2 - 1];
    foreach (i; b) {
        writeln(i < x ? x : y);
    }
}