#include <bits/stdc++.h>
using namespace std;
int main() {
  long long i, j, k, l, m, n, p, q, r;
  while (cin >> p) {
    int x[p], y[p];
    m = 0;
    n = 10000000000;
    for (i = 0; i < p; i++) {
      cin >> x[i] >> y[i];
      if (x[i] < n) n = x[i];
      if (m < y[i]) m = y[i];
    }
    j = 0;
    for (i = 0; i < p; i++)
      if (x[i] == n && m == y[i]) {
        j++;
        cout << i + 1 << endl;
        break;
      }
    if (j == 0) cout << "-1" << endl;
  }
  return 0;
}
