#include <bits/stdc++.h>
using namespace std;
int n;
int l[100005];
int r[100005];
int main() {
  scanf("%d", &n);
  scanf("%d%d", &l[0], &r[0]);
  int mi = l[0], ma = r[0];
  for (int i = 1; i < n; i++) {
    scanf("%d%d", &l[i], &r[i]);
    mi = min(mi, l[i]);
    ma = max(ma, r[i]);
  }
  for (int i = 0; i < n; i++) {
    if (l[i] == mi && r[i] == ma) {
      printf("%d\n", i + 1);
      return 0;
    }
  }
  printf("-1\n");
  return 0;
}
