#include <bits/stdc++.h>
using namespace std;
bool func(const pair<pair<int, int>, int>& a,
          const pair<pair<int, int>, int>& b) {
  if (a.first.first < b.first.first)
    return true;
  else if (a.first.first == b.first.first && a.first.second >= b.first.second)
    return true;
  return false;
}
int main() {
  int n;
  cin >> n;
  vector<pair<pair<int, int>, int> > vec(n);
  for (int i = 0; i < n; ++i) {
    cin >> vec[i].first.first >> vec[i].first.second;
    vec[i].second = i + 1;
  }
  sort(vec.begin(), vec.end(), func);
  bool doCover = true;
  for (int i = 1; i < n && doCover; ++i) {
    if (!(vec[0].first.first <= vec[i].first.first &&
          vec[0].first.second >= vec[i].first.second))
      doCover = false;
  }
  if (doCover)
    cout << vec[0].second;
  else
    cout << -1;
  cout << endl;
  return 0;
}
