#include <bits/stdc++.h>
using namespace std;
string toString(long long num) {
  stringstream ss;
  ss << num;
  string str = ss.str();
  return str;
}
long long toLong(string str) {
  long long res;
  istringstream ss(str);
  ss >> res;
  return res;
}
int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); }
int b[30000], a[30000], c[30000];
int main() {
  int n;
  long long l, r;
  cin >> n;
  int min = INT_MAX, max = INT_MIN;
  vector<pair<long long, long long>> v;
  for (int i = 0; i < (int)n; i++) {
    cin >> l >> r;
    if (l < min) {
      min = l;
    }
    if (r > max) {
      max = r;
    }
    v.push_back(make_pair(l, r));
  }
  vector<pair<long long, long long>>::iterator it;
  int i = 1;
  for (it = v.begin(), i = 1; it != v.end(); it++, i++) {
    if (it->first == min && it->second == max) {
      cout << i << endl;
      return 0;
    }
  }
  cout << "-1" << endl;
  return 0;
}
