#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.precision(20);
  int n, c = 0;
  cin >> n;
  map<pair<int, int>, int> mp;
  vector<pair<int, pair<int, int>>> v;
  for (int i = 0; i < n; i++) {
    int l, r;
    cin >> l >> r;
    v.push_back(make_pair(r - l + 1, make_pair(l, r)));
    mp[{l, r}] = i + 1;
  }
  sort(v.begin(), v.end());
  int q = v[n - 1].second.first, s = v[n - 1].second.second;
  for (int i = 0; i < v.size() - 1; i++) {
    int l = v[i].second.first, r = v[i].second.second;
    if (q <= l && q <= r && l <= s && r <= s) c++;
  }
  if (c == n - 1)
    cout << mp[{q, s}];
  else
    cout << -1;
}
