#include <bits/stdc++.h>
using namespace std;
int main() {
  unsigned long long int a[100001], b[100001], c, d = 1000000001, f = 0, n, i;
  cin >> n;
  for (i = 1; i <= n; i++) {
    cin >> a[i] >> b[i];
    f = max(f, b[i]);
    d = min(d, a[i]);
  }
  for (i = 1; i <= n; i++) {
    if (a[i] == d && b[i] == f) {
      cout << i << endl;
      break;
    }
  }
  if (i == n + 1) cout << "-1" << endl;
}
