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