#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 1;
int ll[N], rr[N];
int main() {
  int n, l = INT_MAX, r = INT_MIN;
  cin >> n;
  for (int i = 0; i < n; i++)
    cin >> ll[i] >> rr[i], l = min(l, ll[i]), r = max(r, rr[i]);
  for (int i = 0; i < n; i++)
    if (l == ll[i] && r == rr[i]) {
      cout << i + 1;
      return 0;
    }
  cout << -1;
  return 0;
}
