#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  long long a[n];
  long long b[n];
  vector<int> q;
  vector<int> w;
  for (int i = 0; i < n; i++) {
    cin >> a[i] >> b[i];
    q.push_back(a[i]);
    w.push_back(b[i]);
  }
  sort(a, a + n);
  sort(b, b + n);
  int ans1 = a[0];
  int ans2 = b[n - 1];
  for (int i = 0; i < n; i++) {
    if (q[i] == ans1 && ans2 == w[i]) {
      cout << i + 1;
      return 0;
    }
  }
  cout << -1;
  return 0;
}
