#include <bits/stdc++.h>
using namespace std;
int arr[100000][2];
int main() {
  int n, min = 1000000000, max = 0, index;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> arr[i][0] >> arr[i][1];
    if (arr[i][0] < min || (arr[i][0] == min && arr[i][1] > arr[index][1])) {
      min = arr[i][0];
      index = i;
    }
    if (arr[i][1] > max) max = arr[i][1];
  }
  if (arr[index][1] == max)
    cout << index + 1;
  else
    cout << -1;
  return 0;
}
