#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 5;
int l[N], r[N];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> l[i] >> r[i];
  int mn = l[0], mx = r[0];
  for (int i = 0; i < n; i++) mn = min(mn, l[i]), mx = max(mx, r[i]);
  for (int i = 0; i < n; i++)
    if (mn == l[i] && mx == r[i]) return cout << i + 1 << endl, 0;
  cout << -1 << endl;
  return 0;
}
