#include <bits/stdc++.h>
using namespace std;
const long long int mod = 1e9 + 7;
void fast() {
  std::ios::sync_with_stdio(false);
  cin.tie(NULL);
}
long long int power(long long int a, long long int b) {
  long long int ans = 1;
  while (b != 0) {
    if (b % 2 == 1) {
      ans *= a;
    }
    b /= 2;
    a *= a;
  }
  return ans;
}
long long int invmod(long long int a) { return pow(a, mod - 2); }
void print(int a[], int n) {
  for (int i = 0; i < n; i++) cout << a[i] << " ";
}
struct points {
  int x;
  int y;
} my[100005];
int main() {
  int n;
  scanf("%d", &n);
  int mn = INT_MAX, mx = INT_MIN;
  for (int i = 0; i < n; i++) {
    scanf("%d", &my[i].x);
    scanf("%d", &my[i].y);
    mn = min(mn, my[i].x);
    mx = max(mx, my[i].y);
  }
  for (int i = 0; i < n; i++) {
    if (my[i].x == mn && my[i].y == mx) {
      cout << i + 1 << endl;
      return 0;
    }
  }
  cout << "-1" << endl;
  return 0;
}
