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