#include <bits/stdc++.h>
using namespace std;
int main() {
  int ans = -1, n, mini = 2000000000, maxi = -1;
  cin >> n;
  int l[n];
  int r[n];
  for (int i = 1; i <= n; i++) {
    cin >> l[i] >> r[i];
    mini = min(mini, l[i]);
    maxi = max(maxi, r[i]);
  }
  for (int j = 1; j <= n; j++) {
    if (l[j] == mini && r[j] == maxi) ans = j;
  }
  cout << ans;
}
