import std.stdio, std.algorithm, std.range, std.conv, std.string, std.math;
import core.stdc.stdio;
// foreach, foreach_reverse, writeln

void main() {
	int n;
	scanf("%d", &n);
	int[] x = new int[n];
	foreach (i; 0..n) scanf("%d", &x[i]);
	int[] y = x.dup;
	y.sort;
	int l = y[n/2-1], r = y[n/2];
	foreach (i; 0..n) {
		if (x[i] <= l) writeln(r);
		else writeln(l);
	}
}