#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) { return (b == 0 ? a : gcd(b, a % b)); }
int lcm(int a, int b) {
  int temp = gcd(a, b);
  return temp ? (a * b / temp) : 0;
}
int main() {
  int n, x, y, min = 1000000001, max = 0, min2, max2, index;
  cin >> n;
  cin >> x >> y;
  min = min2 = x;
  max = max2 = y;
  index = 1;
  for (int i = 1; i < n; i++) {
    cin >> x >> y;
    if (x <= min && y >= max) {
      index = i + 1;
      max = max2 = y;
      min = min2 = x;
    } else if (y >= max)
      max = y;
    else if (x <= min)
      min = x;
  }
  if (max == max2 && min == min2)
    cout << index << endl;
  else
    cout << -1 << endl;
  return 0;
}
