#include <bits/stdc++.h>
using namespace std;
const int INF = 2 * int(1e09);
int n, m, x, y, a, b, l[100005], r[100005], ml = INF, mr = -1;
vector<pair<int, int> > v;
bool comp(pair<int, int> a, pair<int, int> b) {
  return a.first < b.first || (a.first == b.first && a.second < b.second);
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d %d", &l[i], &r[i]);
    ml = min(ml, l[i]);
    mr = max(mr, r[i]);
  }
  for (int i = 0; i < n; i++) {
    if (l[i] == ml && r[i] == mr) {
      cout << i + 1;
      return 0;
    }
  }
  cout << -1;
  return 0;
}
