#include <bits/stdc++.h>
const long long int maxc = 100005;
const long long int mod = 1000000007;
using namespace std;
vector<long long int> vp;
void prime() {
  long long int cnt = 0, i, j;
  bool p[100005];
  memset(p, 1, sizeof(p));
  p[1] = 0;
  for (i = 2; i < maxc; i++) {
    if (p[i]) {
      vp.push_back(i);
      cnt++;
    }
    for (j = 0; j < cnt && i * vp[j] < maxc; j++) {
      p[i * vp[j]] = 0;
      if (i % vp[j] == 0) break;
    }
  }
}
bool cmp(pair<long long int, long long int> a,
         pair<long long int, long long int> b) {
  return a.first <= b.first && a.second < b.second;
}
long long int gcd(long long int a, long long int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n, i, x, y, mn = LLONG_MAX, mx = 0;
  cin >> n;
  vector<pair<pair<long long int, long long int>, long long int>> v;
  for (long long int i = 0; i < n; i++) {
    cin >> x >> y;
    v.push_back(make_pair(make_pair(x, y), i + 1));
    mn = min(mn, x);
    mx = max(mx, y);
  }
  for (auto it : v) {
    if (it.first.first == mn && it.first.second == mx) {
      cout << it.second;
      exit(0);
    }
  }
  cout << -1;
  return 0;
}
