#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
pair<int, int> a[N];
int main() {
  int n;
  cin >> n;
  int mn = 1e9, mx = -1e9;
  for (int i = 0; i < n; ++i) {
    cin >> a[i].first >> a[i].second;
    mn = min(mn, a[i].first);
    mx = max(mx, a[i].second);
  }
  int ans = -1;
  for (int i = 0; i < n; ++i) {
    if (a[i].first <= mn && a[i].second >= mx) {
      ans = i + 1;
      break;
    }
  }
  cout << ans << endl;
}
