#include <bits/stdc++.h>
using namespace std;
vector<vector<int> > AdjList;
int dx[] = {1, 0, -1, 0};
int dy[] = {0, 1, 0, -1};
int sx, sy, x, y;
int main() {
  int n;
  sx = 1000000000;
  sy = -50;
  vector<pair<int, int> > data;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> x >> y;
    sx = min(sx, x);
    sy = max(sy, y);
    data.push_back(pair<int, int>(x, y));
  }
  for (int i = 0; i < n; i++) {
    if (data[i].first <= sx && data[i].second >= sy) {
      cout << i + 1 << endl;
      return 0;
    }
  }
  cout << -1 << endl;
  return 0;
}
