#include <bits/stdc++.h>
using namespace std;
int n, a, b, men, may;
vector<pair<int, int> > arr;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  men = 1000000009;
  for (int i = 0; i < n; i++) {
    cin >> a >> b;
    arr.push_back(make_pair(a, b));
    men = min(a, men);
    may = max(may, b);
  }
  for (int i = 0; i < n; i++) {
    if (arr[i].first == men && arr[i].second == may) {
      cout << i + 1;
      return 0;
    }
  }
  cout << -1;
}
