#include <bits/stdc++.h>
const int MAXN = 100005;
using namespace std;
pair<int, int> a[MAXN];
int n;
int scan() {
  int t = 0, m = 1;
  char c;
  c = getchar();
  while ((c < '0' || c > '9') and c != '-') c = getchar();
  if (c == '-') c = getchar(), m = -1;
  while (c >= '0' && c <= '9') t = (t << 3) + (t << 1) + c - '0', c = getchar();
  return (t * m);
}
int main() {
  std::ios::sync_with_stdio(false);
  n = scan();
  int max, min;
  max = 0;
  min = 1e9;
  for (int i = 1; i <= n; i++) {
    a[i].first = scan();
    a[i].second = scan();
    if (a[i].first < min) min = a[i].first;
    if (a[i].second > max) max = a[i].second;
  }
  bool f = false;
  for (int i = 1; i <= n; i++) {
    if (a[i].first == min && a[i].second == max) {
      cout << i;
      f = true;
      break;
    }
  }
  if (f == false) cout << -1;
  return 0;
}
