#include <bits/stdc++.h>
using namespace std;
using PII = pair<int, int>;
PII a[300005];
int idx[300005];
map<int, int> mp;
int main() {
  int n;
  ;
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    scanf("%d %d", &a[i].first, &a[i].second);
    idx[i] = i;
  }
  sort(idx, idx + n, [&](int l, int r) {
    if (a[l].first != a[r].first)
      return a[l].first > a[r].first;
    else
      return a[l].second < a[r].second;
  });
  bool f = false;
  for (int i = 0; i < n; ++i) {
    auto it = mp.upper_bound(a[idx[i]].second);
    if (it != mp.begin()) {
      f = true;
      --it;
      printf("%d %d\n", it->second + 1, idx[i] + 1);
      break;
    } else {
      mp[a[idx[i]].second] = idx[i];
    }
  }
  if (!f) puts("-1 -1");
  return 0;
}
