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 = quickSort(Xn_tmp);
        console.log(Xn_tmp[N/2 - 1]);
    }
}

function quickSort(a) {
    var recurse = function(a, i, j) {
        var k, p = pivot(a, i, j);
        if (p !== -1) {
          k = partition(a, i, j, a[p]);
          //console.log('左: (#' + i + ')' + a[i] + ' 軸: (#' + p + ')' + a[p] + ' 右: (#' + j + ')' + a[j]);
          recurse(a, i, k - 1);
          recurse(a, k, j);
        }
        return a;
      },
      pivot = function(a, i, j) {
        var k = i + 1;
        while (k <= j && a[i] === a[k]) {
          k++;
        }
        if (k > j) {
          return -1;
        }
        if (a[i] >= a[k]) {
          return i;
        }
        return k;
      },
      partition = function(a, i, j, p) {
        var l = i, r = j;
        while (l <= r) {
          while (l <= j && a[l] < p) {
            l++;
          }
          while (r >= i && a[r] >= p) {
            r--;
          }
          if (l > r) {
            break;
          }
          //console.log('' + a[l] + ' と ' + a[r] + ' を交換します');
          a.swap(l++, r--);
        }
        //console.log('走査が終了しました: ' + l);
        return l;
      };
    return recurse(a, 0, a.length - 1);
  }

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