function Main(input) {
    input = input.split("\n");
    N = parseInt(input[0]);
    Xn = input[1].split(" ");
    Xn = Xn.map(e => parseInt(e));
    for(var i=0; i < N; i++ ){
        Xn_tmp = (Xn.slice(0, i+1)).concat(Xn.slice(i+1, N));
        Xn_tmp.splice(i, 1);
        // sort Xn
        Xn_tmp.sort();
        console.log(Xn_tmp[N/2 - 1]);
    }
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));