#include <bits/stdc++.h>
int main() {
  int n, l, r, ans, nl, nr, x, y;
  scanf("%d", &n);
  nl = 1 << 30;
  nr = 0;
  ans = 0;
  for (int i = 1; i <= n; i++) {
    scanf("%d%d", &x, &y);
    if (ans == 0 || x <= l && r <= y) {
      ans = i;
      l = x;
      r = y;
    }
    if (nl > x) nl = x;
    if (nr < y) nr = y;
  }
  if (l == nl && r == nr)
    printf("%d\n", ans);
  else
    printf("-1\n");
  return 0;
}
