#include <bits/stdc++.h>
using namespace std;
struct sgm {
  int l;
  int r;
};
int main() {
  int n;
  cin >> n;
  sgm *arr = new sgm[n];
  int *a = new int[n];
  int *b = new int[n];
  for (int i = 0; i < n; i++) {
    cin >> arr[i].l >> arr[i].r;
    a[i] = arr[i].l;
    b[i] = arr[i].r;
  }
  sort(a, a + n);
  sort(b, b + n);
  int m1 = a[0], m2 = b[n - 1];
  int flag = 1;
  for (int i = 0; i < n; i++) {
    if (arr[i].l == m1 && arr[i].r == m2) {
      cout << i + 1 << endl;
      flag = 0;
      break;
    }
  }
  if (flag) {
    cout << -1 << endl;
  }
  return 0;
}
