#include <bits/stdc++.h>
using namespace std;
typedef struct {
  long long start;
  long long end;
  long long entry_n;
} seg;
bool operator<(const seg &t, const seg &u) {
  if (t.start < u.start) return true;
  if (t.start > u.start) return false;
  if (t.start == u.start) return (t.end < u.end);
}
seg a[100009];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    seg tmp;
    cin >> tmp.start >> tmp.end;
    tmp.entry_n = i + 1;
    a[i] = tmp;
  }
  sort(a, a + n);
  int p = 0;
  long long s = a[p].start;
  while (p < n && a[p].start == s) p++;
  if (p) p--;
  long long x = a[p].start;
  long long y = a[p].end;
  long long ans = a[p].entry_n;
  bool flag = true;
  for (int i = 0; i < n; ++i) {
    long long d1 = (a[i].start - x);
    long long d2 = (a[i].end - y);
    if (d1 * d2 <= 0) continue;
    flag = false;
    break;
  }
  if (flag)
    cout << ans << endl;
  else
    cout << "-1" << endl;
  return 0;
}
