#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a, b, aa, bb, ans;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int h, t;
    cin >> h >> t;
    if (!i) {
      a = aa = h;
      b = bb = t;
      ans = i;
    } else {
      if (h < aa) {
        aa = h;
        bb = t;
        ans = i;
      } else if (h == a) {
        if (bb < t) {
          bb = t;
          ans = i;
        }
      }
      a = min(a, h);
      b = max(b, t);
    }
  }
  if (aa <= a && bb >= b)
    cout << ans + 1 << endl;
  else
    cout << -1 << endl;
}
