import std.algorithm;
import std.array;
import std.conv;
import std.math;
import std.range;
import std.stdio;
import std.string;

void main() {
  int n;
  readf (" %d", &n);
  auto a = new int[n];
  foreach (t; 0 .. n) {
    readf (" %d", &a[t]);
  }
  auto b = a.dup;
  sort (b);
  int m = n / 2;
  foreach (i; 0 .. n) {
    if (a[i] <= b[m-1]) {
      writeln (b[m]);
    } else {
      writeln (b[m-1]);
    }
  }
}
