#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, n, i, j, ans = -1, c, d;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> a >> b;
    if (i == 0) {
      c = a;
      d = b;
    }
    if (a < c) {
      c = a;
      ans = -1;
    }
    if (d < b) {
      d = b;
      ans = -1;
    }
    if ((a == c) && (b == d)) {
      ans = i + 1;
    }
  }
  cout << ans;
}
