#include <bits/stdc++.h>
using namespace std;
const int MAX = 100001;
int x[MAX], y[MAX];
int main() {
  int xleft, yright;
  int n, i;
  scanf(" %d", &n);
  for (i = 0; i < n; i++) {
    scanf(" %d %d", &x[i], &y[i]);
    if (i == 0) {
      xleft = x[i];
      yright = y[i];
    }
    xleft = min(xleft, x[i]);
    yright = max(yright, y[i]);
  }
  for (i = 0; i < n; i++) {
    if (x[i] == xleft && y[i] == yright) {
      printf("%d\n", i + 1);
      break;
    }
  }
  if (i == n) printf("-1\n");
  return 0;
}
