#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> l(n), r(n);
  for (int i = 0; i < n; i++) {
    cin >> l[i];
    cin >> r[i];
  }
  int max = r[0];
  int min = l[0];
  for (int i = 1; i < n; i++) {
    if (l[i] < min) min = l[i];
    if (r[i] > max) max = r[i];
  }
  int ans = 0;
  for (int i = 0; i < n; i++) {
    if ((l[i] == min) && (r[i] == max)) {
      ans = i + 1;
      break;
    } else
      ans = -1;
  }
  cout << ans << endl;
  return 0;
}
