#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  t = 1;
  while (t--) {
    long long n, index = -1, j, w, h, count = 0, minl = INT_MAX, maxr = INT_MIN,
                 i;
    string s;
    cin >> n;
    long long l[n], r[n];
    for (i = 0; i < n; i++) {
      cin >> l[i];
      cin >> r[i];
      minl = min(minl, l[i]);
      maxr = max(maxr, r[i]);
    }
    for (i = 0; i < n; i++) {
      if (l[i] <= minl && r[i] >= maxr) {
        index = i + 1;
        break;
      }
    }
    if (index != -1)
      cout << index;
    else {
      cout << -1;
    }
  }
}
