#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, i, j;
  cin >> n;
  long long int ara[n];
  for (i = 0; i < n; i++) {
    cin >> ara[i];
  }
  sort(ara, ara + n);
  long long int dis[n], dis1[n], p, mi = 1000000000000000000, cnt = 0, ans;
  dis[0] = 0;
  for (i = 1; i < n; i++) {
    dis[i] = dis[i - 1];
    if (ara[i] < 0) {
      dis[i] += abs(abs(ara[i - 1]) - abs(ara[i])) * i;
    } else {
      dis[i] += abs(ara[i - 1] - ara[i]) * i;
    }
  }
  dis1[n - 1] = 0;
  p = ara[n - 1];
  j = 1;
  for (i = n - 2; i >= 0; i--, j++) {
    dis1[i] = dis1[i + 1];
    if (p < 0) {
      dis1[i] += abs(abs(ara[i]) - abs(ara[i + 1])) * j;
    } else {
      dis1[i] += abs(ara[i] - ara[i + 1]) * j;
    }
    p = ara[i];
  }
  for (i = 0; i < n; i++) {
    cnt = 0;
    cnt += dis[i];
    cnt += dis1[i];
    if (cnt < mi) {
      mi = min(cnt, mi);
      ans = ara[i];
    }
  }
  cout << ans << endl;
  return 0;
}
