Language: C++

#include<iostream>
#include<vector>
#include<cmath>
#include<algorithm>
#include<utility>
#include<map>
#include<set>
#include<tuple>
#include<string>

using namespace std;
#define ll long long

int main(){
    ll N;
    string S;
    int a;
    cin >> N;
    vector<tuple<string,int,int> > L;
    for(int i = 0; i < N; i++){
        cin >> S >> a;
        L.push_back(make_tuple(S,-a,i+1));
    }
    sort(L.begin(),L.end());
    
    // ans
    for(int i = 0; i < N; i++){
        cout << get<2>L[i] << endl;
    }
    return 0;
}

Compiler output:
In file included from /usr/include/c++/14/bits/memory_resource.h:47,
                 from /usr/include/c++/14/string:68,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/tuple: In instantiation of 'struct std::tuple_element<2, std::tuple<> >':
/usr/include/c++/14/bits/utility.h:84:11:   required by substitution of 'template<long unsigned int __i, class _Tp> using std::__tuple_element_t = typename std::tuple_element::type [with long unsigned int __i = 2; _Tp = std::tuple<>]'
   84 |     using __tuple_element_t = typename tuple_element<__i, _Tp>::type;
      |           ^~~~~~~~~~~~~~~~~
/usr/include/c++/14/tuple:2466:5:   required by substitution of 'template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&) [with _Ostream = std::basic_ostream<char>&; _Tp = <missing>]'
 2466 |     get(const tuple<_Elements...>&& __t) noexcept
      |     ^~~
a.cc:28:17:   required from here
   28 |         cout << get<2>L[i] << endl;
      |                 ^~~~~~
/usr/include/c++/14/tuple:2422:25: error: static assertion failed: tuple index must be in range
 2422 |       static_assert(__i < sizeof...(_Types), "tuple index must be in range");
      |                     ~~~~^~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/tuple:2422:25: note: the comparison reduces to '(2 < 0)'
In file included from /usr/include/c++/14/bits/stl_pair.h:62,
                 from /usr/include/c++/14/bits/stl_algobase.h:64,
                 from /usr/include/c++/14/string:51:
/usr/include/c++/14/bits/utility.h: In instantiation of 'struct std::_Nth_type<2>':
/usr/include/c++/14/tuple:2424:13:   required from 'struct std::tuple_element<2, std::tuple<> >'
 2424 |       using type = typename _Nth_type<__i, _Types...>::type;
      |             ^~~~
/usr/include/c++/14/bits/utility.h:84:11:   required by substitution of 'template<long unsigned int __i, class _Tp> using std::__tuple_element_t = typename std::tuple_element::type [with long unsigned int __i = 2; _Tp = std::tuple<>]'
   84 |     using __tuple_element_t = typename tuple_element<__i, _Tp>::type;
      |           ^~~~~~~~~~~~~~~~~
/usr/include/c++/14/tuple:2466:5:   required by substitution of 'template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&) [with _Ostream = std::basic_ostream<char>&; _Tp = <missing>]'
 2466 |     get(const tuple<_Elements...>&& __t) noexcept
      |     ^~~
a.cc:28:17:   required from here
   28 |         cout << get<2>L[i] << endl;
      |                 ^~~~~~
/usr/include/c++/14/bits/utility.h:237:13: error: '__type_pack_element' index is out of range
  237 |     { using type = __type_pack_element<_Np, _Types...>; };
      |             ^~~~
a.cc: In function 'int main()':
a.cc:28:17: error: use of deleted function 'constexpr std::__enable_if_t<(__i >= sizeof... (_Types))> std::get(const tuple<_Elements ...>&) [with long unsigned int __i = 2; _Elements = {}; __enable_if_t<(__i >= sizeof... (_Types))> = void]'
   28 |         cout << get<2>L[i] << endl;
      |                 ^~~~~~
/usr/include/c++/14/tuple:2476:5: note: declared here
 2476 |     get(const tuple<_Elements...>&) = delete;
      |     ^~~
a.cc:28:17: error: use of deleted function 'constexpr std::__enable_if_t<(__i >= sizeof... (_Types))> std::get(const tuple<_Elements ...>&) [with long unsigned int __i = 2; _Elements = {}; __enable_if_t<(__i >= sizeof... (_Types))> = void]'
   28 |         cout << get<2>L[i] << endl;
      |                 ^~~~~~
/usr/include/c++/14/tuple:2476:5: note: declared here
 2476 |     get(const tuple<_Elements...>&) = delete;
      |     ^~~
a.cc:28:17: error: use of deleted function 'constexpr std::__enable_if_t<(__i >= sizeof... (_Types))> std::get(const tuple<_Elements ...>&) [with long unsigned int __i = 2; _Elements = {}; __enable_if_t<(__i >= sizeof... (_Types))> = void]'
   28 |         cout << get<2>L[i] << endl;
      |                 ^~~~~~
/usr/include/c++/14/tuple:2476:5: note: declared here
 2476 |     get(const tuple<_Elements...>&) = delete;
      |     ^~~
a.cc:28:23: error: expected ';' before 'L'
   28 |         cout << get<2>L[i] << endl;
      |                       ^
      |                       ;