#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, j, k;
  int n, a, b, x, y;
  long long l[100001], r[100001];
  cin >> n;
  long long mn = INT_MAX;
  long long mx = INT_MIN;
  for (i = 0; i < n; i++) {
    cin >> l[i] >> r[i];
    mn = mn < l[i] ? mn : l[i];
    mx = mx > r[i] ? mx : r[i];
  }
  for (i = 0; i < n; i++) {
    if (mn == l[i] && mx == r[i]) {
      cout << i + 1 << endl;
      return 0;
    }
  }
  cout << -1 << endl;
  return 0;
}
