#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int mx = 0, mn = 0;
  int a[n], b[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i] >> b[i];
    if (a[i] < a[mn]) mn = i;
    if (b[i] > b[mx]) mx = i;
  }
  int yes = -2;
  for (int i = 0; i < n; i++) {
    if (a[i] == a[mn] && b[i] == b[mx]) {
      yes = i;
      break;
    }
  }
  cout << yes + 1 << endl;
}
