#include <bits/stdc++.h>
using namespace std;
const int INF = 1000000001;
const long double EPS = 1e-9;
const int MOD = 1000000007;
const long long LLINF = 1000000000000000001;
const int maxn = 100042;
int l[maxn];
int r[maxn];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> l[i] >> r[i];
  int ml = INF, mr = -INF;
  for (int i = 1; i <= n; i++) {
    ml = min(ml, l[i]);
    mr = max(mr, r[i]);
  }
  for (int i = 1; i <= n; i++)
    if (ml == l[i] && mr == r[i]) {
      cout << i << endl;
      return 0;
    }
  cout << -1 << endl;
}
