#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
const int MAX = 1000005;
int SetBit(int n, int x) { return n | (1 << x); }
int ClearBit(int n, int x) { return n & ~(1 << x); }
int ToggleBit(int n, int x) { return n ^ (1 << x); }
bool CheckBit(int n, int x) { return (bool)(n & (1 << x)); }
int main(void) {
  int n, i, l, r;
  while (scanf("%d", &n) != EOF) {
    vector<pair<int, int> > v(n);
    l = 1e9 + 1, r = 0;
    for (i = 0; i < n; i++) {
      scanf("%d %d", &v[i].first, &v[i].second);
      if (v[i].first < l) l = v[i].first;
      if (v[i].second > r) r = v[i].second;
    }
    int k = 0;
    for (i = 0; i < n; i++) {
      if (v[i].first == l && v[i].second == r) {
        printf("%d", ++i);
        k = 1;
        break;
      }
    }
    if (!k) printf("-1");
    printf("\n");
    v.clear();
  }
  return 0;
}
