#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, arr[100004][2] = {0}, m_l = 1000000005, l_r = -1;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> arr[i][0] >> arr[i][1];
    m_l = min(m_l, arr[i][0]);
    l_r = max(l_r, arr[i][1]);
  }
  for (int i = 1; i <= n; i++) {
    if (arr[i][0] == m_l && arr[i][1] == l_r) {
      cout << i << endl;
      ;
      return 0;
    }
  }
  cout << "-1" << endl;
}
