#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> x(n);
  vector<int> y(n);
  int mi, mx;
  for (int i = 0; i < n; i++) {
    cin >> x[i] >> y[i];
    if (i == 0) {
      mi = x[i];
      mx = y[i];
    } else {
      mi = min(x[i], mi);
      mx = max(y[i], mx);
    }
  }
  bool t = 0;
  for (int i = 0; i < n; i++) {
    if (x[i] == mi && y[i] == mx) {
      cout << i + 1;
      t = 1;
      break;
    }
  }
  if (!t) cout << -1;
  return 0;
}
