#include <bits/stdc++.h>
using namespace std;
struct node {
  int index, i, j;
};
int main() {
  int n, min = 1000000005, max = 0;
  scanf("%d", &n);
  struct node *Node = (struct node *)malloc(sizeof(struct node) * n);
  for (int i = 0; i < n; i++) {
    scanf("%d%d", &Node[i].i, &Node[i].j);
    Node[i].index = i + 1;
    if (Node[i].i < min) min = Node[i].i;
    if (Node[i].j > max) max = Node[i].j;
  }
  for (int i = 0; i < n; i++) {
    if (Node[i].i == min && Node[i].j == max) {
      cout << Node[i].index << endl;
      return 0;
    }
  }
  cout << "-1" << endl;
  return 0;
}
