#include <bits/stdc++.h>
using namespace std;
bool f(string s1, string s2) {
  bool res = true;
  for (int i = 0; i < s1.size(); ++i) {
    if (s1[i] < s2[i]) {
    } else {
      res = false;
    }
  }
  return res;
}
int main() {
  ios::sync_with_stdio(false);
  long long n;
  cin >> n;
  pair<long long, long long> a, b{+0x3f3f3f3f, -0x3f3f3f3f};
  vector<pair<long long, long long> > vet(n);
  for (int i = 0; i < n; ++i) {
    cin >> a.first >> a.second;
    vet[i] = a;
    b.first = min(b.first, a.first);
    b.second = max(b.second, a.second);
  }
  long long c = find(vet.begin(), vet.end(), b) - vet.begin();
  c++;
  if (c <= n) {
    cout << c;
  } else {
    cout << -1;
  }
  cout << "\n";
  return 0;
}
