#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (a == b) return a;
  if (a > b) return gcd(a - b, b);
  return gcd(b - a, a);
}
long long abs(long long a, long long b) {
  return (a - b < 0) ? (a - b) * -1 : (a - b);
}
bool isOut(long long y, long long x, long long y1, long long x1) {
  if (y >= 0 && y < y1 && x >= 0 && x < x1)
    return false;
  else
    return true;
}
char abc[] = {0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1,
              1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1};
long long dirs[] = {1, 0, -1, 0, 0, -1, 0, 1};
struct edge {
  long long fixy, cena, dist;
  bool visited;
  edge(long long x) : fixy(x), dist(100000000), cena(0), visited(false) {}
  bool operator<(const edge &l) const { return (l.cena < cena) ? false : true; }
};
struct cord {
  long long st, nd, id;
};
bool desc(cord a, cord b) {
  if (a.st < b.st)
    return true;
  else if (a.st == b.st and a.nd > b.nd)
    return true;
  else {
    return false;
  }
}
deque<cord> lefts, rights;
long long n;
int main() {
  ios::sync_with_stdio(false);
  cin >> n;
  long long a, b;
  for (long long i = 0; i < (n); i++) {
    cin >> a >> b;
    lefts.push_back({a, b, i + 1});
  }
  sort(lefts.begin(), lefts.end(), desc);
  for (long long i = 0; i < (lefts.size()); i++) {
    if (lefts[i].nd > lefts[0].nd) {
      cout << -1 << "\n";
      return 0;
    }
  }
  cout << lefts[0].id << "\n";
  return 0;
}
