#include <bits/stdc++.h>
using namespace std;
const int MaxN = 3e5 + 5;
const int inf = 1e8;
const double PI = acos(-1.0);
const long long mod = 998244353;
long long arr[MaxN];
long long before[MaxN], last[MaxN], sum[MaxN];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%lld", &arr[i]);
  }
  for (int i = 0; i <= n + 1; i++) {
    before[i] = last[i] = sum[i] = 0;
  }
  sort(arr + 1, arr + n + 1);
  for (int i = 2; i <= n; i++)
    before[i] = before[i - 1] + (i - 1) * (abs(arr[i] - arr[i - 1]));
  for (int i = n - 1; i >= 1; i--)
    last[i] = last[i + 1] + (n - i) * (abs(arr[i + 1] - arr[i]));
  for (int i = 1; i <= n; i++) sum[i] = last[i] + before[i];
  int ans = n;
  for (int i = n - 1; i >= 1; i--) {
    if (sum[i] > sum[ans]) continue;
    ans = i;
  }
  cout << arr[ans] << endl;
  return 0;
}
