func_code_string: #include <bits/stdc++.h>   using namespace std;   vector<pair<int, int>> vc;   vector<pair<int, int>> vc2;   int main() {     int n;     cin >> n;     for (int i = 0; i < n; i++) {       int x, y;       cin >> x >> y;       vc.push_back(make_pair(x, y));     }     vc2 = vc;     sort(vc.begin(), vc.end(),          [](const pair<int, int> &left, const pair<int, int> &right) {            if (left.first != right.first)              return left.first < right.first;            else              return left.second > right.second;          });     int mini = vc[0].first;     int maxi = vc[0].second;     for (int i = 1; i < vc.size(); i++) {       if (vc[i].first >= mini && vc[i].second <= maxi)         continue;       else {         cout << -1;         return 0;       }     }     for (int i = 0; i < vc2.size(); i++) {       if (vc2[i].first == mini && vc2[i].second == maxi) {         cout << i + 1;         return 0;       }     }     return 0;   }   