#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int nmax;
  int nmin;
  set<int> max;
  set<int> min;
  cin >> n;
  cin >> nmin;
  cin >> nmax;
  max.insert(0);
  min.insert(0);
  for (int i = 1; i < n; ++i) {
    int aux1, aux2;
    cin >> aux1;
    cin >> aux2;
    if (aux1 < nmin) {
      min.clear();
      min.insert(i);
      nmin = aux1;
    } else if (aux1 == nmin)
      min.insert(i);
    if (aux2 > nmax) {
      max.clear();
      max.insert(i);
      nmax = aux2;
    } else if (aux2 == nmax)
      max.insert(i);
  }
  set<int> intersect;
  set_intersection(min.begin(), min.end(), max.begin(), max.end(),
                   std::inserter(intersect, intersect.begin()));
  if (intersect.size()) {
    printf("%d\n", *(intersect.begin()) + 1);
  } else
    printf("-1\n");
}
