#include <bits/stdc++.h>
int main() {
  long long int n;
  scanf("%lld", &n);
  long long int i, x[n], y[n], min = 1000000001, max = 0;
  for (i = 0; i < n; i++) {
    scanf("%lld %lld", &x[i], &y[i]);
    if (x[i] <= min) min = x[i];
    if (y[i] >= max) max = y[i];
  }
  int count = 0;
  for (i = 0; i < n; i++) {
    if (x[i] == min && max == y[i]) {
      printf("%lld", i + 1);
      count++;
      break;
    }
  }
  if (count == 0) printf("-1");
  return 0;
}
