#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<pair<int, int> > vp(n), vp1(n);
  for (int i = 0; i < n; i++) {
    int x, y;
    cin >> x >> y;
    y *= -1;
    pair<int, int> z = make_pair(x, y);
    vp1[i] = z;
  }
  vp = vp1;
  sort(vp.begin(), vp.end());
  int a = vp[0].first, b = vp[0].second;
  int idx;
  for (int i = 0; i < n; i++) {
    if (vp[i].second < b) {
      cout << -1 << endl;
      return 0;
    }
    if (vp[0] == vp1[i]) idx = i + 1;
  }
  cout << idx << endl;
  return 0;
}
