#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  long long arr[n][2], a[n], b[n];
  for (int i = 0; i < n; i++) {
    cin >> arr[i][0] >> arr[i][1];
    a[i] = arr[i][0];
    b[i] = arr[i][1];
  }
  sort(a, a + n);
  sort(b, b + n);
  for (int i = 0; i < n; i++) {
    if (a[0] == arr[i][0] && b[n - 1] == arr[i][1]) {
      cout << i + 1;
      return 0;
    }
  }
  cout << "-1";
  return 0;
}
