#include <bits/stdc++.h>
long long cnt;
using namespace std;
void solve() {
  long long n;
  cin >> n;
  vector<long long> f(n), s(n);
  vector<pair<long long, long long>> v;
  for (long long i = 0; i < n; i++) {
    long long x, y;
    cin >> x >> y;
    f[i] = x;
    s[i] = y;
    v.push_back({x, y});
  }
  long long mn = *min_element(f.begin(), f.end());
  long long mx = *max_element(s.begin(), s.end());
  long long i = 1;
  for (auto x : v) {
    if (x.first == mn and x.second == mx) {
      cout << i;
      return;
    }
    i++;
  }
  cout << -1;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  solve();
}
