import std.stdio;
import std.conv;
import std.string;
import std.algorithm;
import std.range;
import std.functional;
import std.math;
import core.bitop;

void main()
{
    auto n = readln.chomp.to!long;
    auto xs = readln.chomp.split.to!(long[]);

    writeln(xs[1 .. $].dup.sort()[(n / 2) - 1]);
    if (2 < n)
        foreach (i; 1 .. n - 1)
        {
            auto tmp = xs[0 .. i].dup ~ xs[i + 1 .. $].dup;
            tmp.sort();
            writeln(tmp[(n / 2) - 1]);
        }
    writeln(xs[0 .. $ - 1].sort()[(n / 2) - 1]);
}
