#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 7;
vector<int> a;
int n;
int main() {
  cin >> n;
  for (int i = 0; (i) < (2 * n); ++i) {
    int x;
    cin >> x;
    a.push_back(x);
  }
  sort(a.begin(), a.end());
  a.erase(unique(a.begin(), a.end()), a.end());
  if (a.size() >= n) {
    cout << a[n - 1] << endl;
  } else {
    cout << -1 << endl;
  }
  return 0;
}
