#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, l, r;
  vector<pair<int, int> > vp, ans;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d%d", &l, &r);
    vp.push_back(make_pair(l, r));
    ans.push_back(make_pair(l, r));
  }
  l = INT_MAX;
  r = -1;
  for (int i = 0; i < n; i++) {
    l = min(l, vp[i].first);
    r = max(r, vp[i].second);
  }
  for (int i = 0; i < n; i++) {
    if (l >= ans[i].first && r <= ans[i].second) {
      printf("%d\n", i + 1);
      return 0;
    }
  }
  printf("-1\n");
  return 0;
}
