#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, left, right;
  cin >> n;
  vector<vector<int>> segs;
  vector<int> seg;
  for (int i = 0; i < n; i++) {
    cin >> left >> right;
    seg.push_back(left);
    seg.push_back(right);
    segs.push_back(seg);
    seg.clear();
  }
  int min = segs[0][0];
  int max = segs[0][1];
  for (int i = 1; i < segs.size(); i++) {
    if (min > segs[i][0]) {
      min = segs[i][0];
    }
    if (max < segs[i][1]) {
      max = segs[i][1];
    }
  }
  for (int i = 0; i < segs.size(); i++) {
    if (segs[i][0] == min && segs[i][1] == max) {
      cout << i + 1;
      return 0;
    }
  }
  cout << -1;
  return 0;
}
