#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 7;
const int INF = 1e9 + 7;
int n, l[N], r[N];
int solve() {
  int L = INF, R = -INF;
  for (int i = (0), I = (n); i < I; ++i) L = min(L, l[i]), R = max(R, r[i]);
  for (int i = (0), I = (n); i < I; ++i)
    if (l[i] == L && r[i] == R) return i + 1;
  return -1;
}
int main() {
  scanf("%d", &n);
  for (int i = (0), I = (n); i < I; ++i) scanf("%d%d", &l[i], &r[i]);
  printf("%d", solve());
  return 0;
}
