#include <bits/stdc++.h>
using namespace std;
long long mx = 0, mn = 2000000000, n, h = 0;
bool tr = 0;
int main() {
  cin >> n;
  for (long long a, b, i = 1; i <= n; i++) {
    cin >> a >> b;
    if (a <= mn && b >= mx) {
      tr = 1;
      mn = a;
      mx = b;
      h = i;
    } else {
      if (a < mn) {
        tr = 0;
        mn = a;
      }
      if (b > mx) {
        tr = 0;
        mx = b;
      }
    }
  }
  if (tr) {
    cout << h;
    return 0;
  }
  cout << -1;
  return 0;
}
