#include <bits/stdc++.h>
using namespace std;
int read() {
  int x;
  scanf("%d", &x);
  return x;
}
long long readL() {
  long long x;
  scanf("%I64d", &x);
  return x;
}
int main() {
  int n = read();
  long long mx = -1e9 - 1000, mn = 1e9 + 1000;
  pair<int, int> p[n + 1], pp[n + 1];
  for (int i = 0; i < n; i++) {
    long long a = readL(), b = readL();
    p[i].first = a, p[i].second = b;
    pp[i] = p[i];
    mx = max(mx, b), mn = min(a, mn);
  }
  if (n == 1) return cout << "1\n", 0;
  sort(p, p + n);
  int i = 1;
  while (p[i].first == p[i - 1].first) {
    if (p[i - 1].second >= mx) {
      for (int j = 0; j < n; j++) {
        if (pp[j] == p[i - 1]) return cout << j + 1, 0;
      }
    }
    if (p[i].second >= mx) {
      for (int j = 0; j < n; j++) {
        if (pp[j] == p[i]) return cout << j + 1, 0;
      }
    }
    i++;
  }
  if (p[0].second >= mx) {
    for (int j = 0; j < n; j++) {
      if (pp[j] == p[0]) return cout << j + 1, 0;
    }
  } else
    cout << "-1\n";
  return 0;
}
