#include <bits/stdc++.h>
using namespace std;
struct node {
  int x;
  int y;
};
int compare(const void *a, const void *b) {
  node *orderA = (node *)a;
  node *orderB = (node *)b;
  return (orderA->x - orderB->x);
}
int main() {
  int n, i, t;
  cin >> n;
  node *p = new node[n];
  for (i = 0; i < n; i++) {
    cin >> p[i].x >> p[i].y;
  }
  node *q = new node[n];
  for (i = 0; i < n; i++) {
    q[i].x = p[i].x;
    q[i].y = p[i].y;
  }
  qsort(p, n, sizeof(node), compare);
  int max = p[0].y;
  for (i = 0; i < n; i++) {
    if (max < p[i].y) {
      max = p[i].y;
      t = i;
    }
  }
  int d = 0;
  for (i = 0; i < n; i++) {
    if (p[i].x == p[0].x) {
      if (p[i].y == max) {
        d = 1;
        break;
      }
    }
  }
  if (d == 1) {
    for (i = 0; i < n; i++) {
      if (q[i].x == p[0].x && q[i].y == max) {
        break;
      }
    }
    cout << i + 1 << endl;
  } else {
    cout << -1 << endl;
  }
  return 0;
}
