#include <bits/stdc++.h>
using namespace std;
bool sortbysec(const pair<int, int> &a, const pair<int, int> &b) {
  return (a.second < b.second);
}
void compute() {
  long long int n;
  cin >> n;
  vector<pair<long long int, long long int>> a;
  vector<pair<long long int, long long int>> b;
  vector<pair<long long int, long long int>> c;
  for (auto i = 0; i < n; i++) {
    long long int t1, t2;
    cin >> t1 >> t2;
    c.push_back(make_pair(t1, t2));
    a.push_back(make_pair(t1, t2));
    b.push_back(make_pair(t1, t2));
  }
  sort(a.begin(), a.end());
  long long int t1 = a.begin()->first;
  sort(b.begin(), b.end(), sortbysec);
  long long int t2 = b.rbegin()->second;
  long long int t = 0;
  for (auto i = c.begin(); i != c.end(); i++) {
    ++t;
    if (i->second == t2 && i->first == t1) {
      break;
    }
  }
  if (c[t - 1].second == t2 && c[t - 1].first == t1)
    cout << t << endl;
  else
    cout << -1 << endl;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  ;
  compute();
}
