#include <bits/stdc++.h>
using namespace std;
int n, le = 0x7fffffff, ri = 0, a[100010], b[100010];
int main() {
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    cin >> a[i] >> b[i];
    le = min(le, a[i]);
    ri = max(ri, b[i]);
  }
  for (int i = 1; i <= n; ++i)
    if (a[i] == le && b[i] == ri) {
      cout << i << endl;
      return 0;
    }
  cout << -1 << endl;
  return 0;
}
