#include <bits/stdc++.h>
using namespace std;
double const EPS = 1e-8, PI = acos(-1);
const int N = 1e9 + 9, M = 1e6 + 1, OO = 1e9 + 9;
const long long MOD = 1e9 + 7;
void INPUT() {
  cout << fixed << setprecision(0);
  ios::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
}
int n, st = OO, ed = 0, id;
int main() {
  INPUT();
  cin >> n;
  pair<int, int> seg[n];
  for (int i = 0; i < n; i++) {
    cin >> seg[i].first >> seg[i].second;
    st = min(st, seg[i].first), ed = max(ed, seg[i].second);
  }
  for (int i = 0; i < n; i++) {
    if (st >= seg[i].first && ed <= seg[i].second) return cout << i + 1, 0;
  }
  cout << -1;
  return 0;
}
