func_code_string: #include <bits/stdc++.h>   using namespace std;   int main() {     int n, mostleft = 1000000000, mostright = 0, ans = -1;     int l[100000], r[100000];     bool bo_l[100000], bo_r[100000];     cin >> n;     for (int i = 0; i < n; i++) {       bo_l[i] = false;       bo_r[i] = false;     }     for (int i = 0; i < n; i++) {       cin >> l[i] >> r[i];       mostleft = min(mostleft, l[i]);       mostright = max(mostright, r[i]);     }     for (int i = 0; i < n; i++) {       if (mostleft == l[i]) bo_l[i] = true;       if (mostright == r[i]) bo_r[i] = true;     }     for (int i = 0; i < n; i++) {       if (bo_l[i] && bo_r[i]) ans = i + 1;     }     cout << ans;     return 0;   }   