#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n;
  cin >> n;
  pair<long long int, long long int> ar[n];
  long long int a, b;
  for (long long int i = 0; i < n; i++) {
    cin >> a >> b;
    ar[i] = {a, b};
  }
  long long int mn = INT_MAX, mx = INT_MIN;
  for (long long int i = 0; i < n; i++) {
    if (ar[i].first < mn) {
      mn = ar[i].first;
    }
    if (ar[i].second > mx) {
      mx = ar[i].second;
    }
  }
  int res = -1;
  for (long long int i = 0; i < n; i++) {
    if (ar[i].first == mn && ar[i].second == mx) {
      res = i + 1;
      break;
    }
  }
  cout << ((res != -1) ? res : -1) << endl;
  return 0;
}
