#include <bits/stdc++.h>
using namespace std;
int main() {
  long i, j, k, l, m, n, o, p;
  long long a[100005], b[100005];
  cin >> n;
  long long left = 9999999999, right = 0;
  for (i = 0; i < n; i++) {
    cin >> a[i];
    cin >> b[i];
    if (left > a[i]) left = a[i];
    if (right < b[i]) right = b[i];
  }
  p = -1;
  if (left != 9999999999 && right != 0) {
    for (i = 0; i < n; i++) {
      if (left == a[i] && right == b[i]) p = i + 1;
    }
  }
  cout << p << endl;
}
