#include <bits/stdc++.h>
using namespace std;
long long int tc, cnt = 0, number, many, total = 0;
int rmove[4] = {0, 0, -1, 1};
int cmove[4] = {1, -1, 0, 0};
long long int power(long long int x, long long int y, long long int mod) {
  if (y == 0)
    return 1;
  else if (y % 2 == 0)
    return (power(x, y / 2, mod) % mod * power(x, y / 2, mod) % mod) % mod;
  else
    return x * (power(x, y / 2, mod) % mod * power(x, y / 2, mod) % mod) % mod;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> many;
  pair<int, int> arr[many];
  int left = 1e9, right = 0;
  for (int i = 0; i < many; i++) {
    cin >> arr[i].first >> arr[i].second;
    left = min(left, arr[i].first);
    right = max(right, arr[i].second);
  }
  int answer = -1;
  for (int i = 0; i < many; i++) {
    if (arr[i].first == left && arr[i].second == right) answer = i + 1;
  }
  cout << answer;
  cerr << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << " ms\n";
  return 0;
}
