Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
typedef long long ll;
#define _GLIBCXX_DEBUG
typedef vector<int> vec;
typedef vector<ll> lvec;
typedef vector<char>cvec;
typedef pair<ll, ll> LP;
typedef tuple<ll, ll, ll> LT;
typedef pair<int, int> P;
typedef tuple<int, int, int> T;
#define second sc;
#define first fst;
int main()	{
  int n;
  cin>>n;
  vector<int>p(n);
  vector<string>s(n);
  rep(i,n) {
    cin>>s[i]>>p[i];
    p[i]--;
  }
  vector<pair<string,int>>mp;
  rep(i,n){
    mp.push_back(make_pair(s[i],p[i]));
  }
  sort(all(mp));
  rep(i,n-1){
    if(mp[i].first==mp[i+1].first && mp[i].second<mp[i+1].second){
      int tmp=mp[i].second;
      mp[i].second=mp[i+1].second;
      mp[i+1].second=tmp;
    }
  rep(i,n){
    cout<<mp[i].second+1<<endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:15: error: '__gnu_cxx::__alloc_traits<std::allocator<std::pair<std::__cxx11::basic_string<char>, int> >, std::pair<std::__cxx11::basic_string<char>, int> >::value_type' {aka 'struct std::pair<std::__cxx11::basic_string<char>, int>'} has no member named 'fst'; did you mean 'first'?
   16 | #define first fst;
      |               ^~~
a.cc:32:14: note: in expansion of macro 'first'
   32 |     if(mp[i].first==mp[i+1].first && mp[i].second<mp[i+1].second){
      |              ^~~~~
a.cc:32:19: error: expected primary-expression before '==' token
   32 |     if(mp[i].first==mp[i+1].first && mp[i].second<mp[i+1].second){
      |                   ^~
a.cc:16:15: error: '__gnu_cxx::__alloc_traits<std::allocator<std::pair<std::__cxx11::basic_string<char>, int> >, std::pair<std::__cxx11::basic_string<char>, int> >::value_type' {aka 'struct std::pair<std::__cxx11::basic_string<char>, int>'} has no member named 'fst'; did you mean 'first'?
   16 | #define first fst;
      |               ^~~
a.cc:32:29: note: in expansion of macro 'first'
   32 |     if(mp[i].first==mp[i+1].first && mp[i].second<mp[i+1].second){
      |                             ^~~~~
a.cc:16:18: error: expected ')' before ';' token
   16 | #define first fst;
      |                  ^
a.cc:32:29: note: in expansion of macro 'first'
   32 |     if(mp[i].first==mp[i+1].first && mp[i].second<mp[i+1].second){
      |                             ^~~~~
a.cc:32:7: note: to match this '('
   32 |     if(mp[i].first==mp[i+1].first && mp[i].second<mp[i+1].second){
      |       ^
a.cc:32:40: error: expected ';' before '[' token
   32 |     if(mp[i].first==mp[i+1].first && mp[i].second<mp[i+1].second){
      |                                        ^
      |                                        ;
a.cc:32:50: error: expected primary-expression before '<' token
   32 |     if(mp[i].first==mp[i+1].first && mp[i].second<mp[i+1].second){
      |                                                  ^
a.cc:15:16: error: '__gnu_cxx::__alloc_traits<std::allocator<std::pair<std::__cxx11::basic_string<char>, int> >, std::pair<std::__cxx11::basic_string<char>, int> >::value_type' {aka 'struct std::pair<std::__cxx11::basic_string<char>, int>'} has no member named 'sc'
   15 | #define second sc;
      |                ^~
a.cc:32:59: note: in expansion of macro 'second'
   32 |     if(mp[i].first==mp[i+1].first && mp[i].second<mp[i+1].second){
      |                                                           ^~~~~~
a.cc:32:65: error: expected primary-expression before ')' token
   32 |     if(mp[i].first==mp[i+1].first && mp[i].second<mp[i+1].second){
      |                                                                 ^
a.cc:15:16: error: '__gnu_cxx::__alloc_traits<std::allocator<std::pair<std::__cxx11::basic_string<char>, int> >, std::pair<std::__cxx11::basic_string<char>, int> >::value_type' {aka 'struct std::pair<std::__cxx11::basic_string<char>, int>'} has no member named 'sc'
   15 | #define second sc;
      |                ^~
a.cc:38:17: note: in expansion of macro 'second'
   38 |     cout<<mp[i].second+1<<endl;
      |                 ^~~~~~
a.cc:38:25: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
   38 |     cout<<mp[i].second+1<<endl;
      |                       ~~^~~~~~
a.cc:40:2: error: expected '}' at end of input
   40 | }
      |  ^
a.cc:17:17: note: to match this '{'
   17 | int main()      {
      |                 ^
a.cc:32:38: error: label 'mp' used but not defined
   32 |     if(mp[i].first==mp[i+1].first && mp[i].second<mp[i+1].second){
      |                                      ^~