#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  pair<int, int> arr[n];
  int small = INT_MAX, big = INT_MIN;
  for (int i = 0; i < n; i++) {
    int a, b;
    cin >> a >> b;
    small = min(a, min(small, b));
    big = max({big, a, b});
    arr[i] = make_pair(a, b);
  }
  for (int i = 0; i < n; i++) {
    if (arr[i].first == small && arr[i].second == big) {
      cout << i + 1 << endl;
      return 0;
    }
  }
  cout << -1 << endl;
  return 0;
}
