#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i;
  cin >> n;
  int min = INT_MAX, max = INT_MIN;
  int arr[n], arr2[n], x = -1;
  for (i = 0; i < n; i++) {
    cin >> arr[i] >> arr2[i];
    if (arr[i] < min) min = arr[i];
    if (arr2[i] > max) max = arr2[i];
  }
  for (i = 0; i < n; i++) {
    if (arr[i] == min && arr2[i] == max) x = i + 1;
  }
  cout << x;
}
