Language: C++

#include<iostream>
#include<bits/stdc++.h>
#include<list>
using namespace std;
int main()
{
    std::list<string> s;
    string c;
    long long n,temp=0;
    cin>>c;
    s.push_back(c);
    cin>>n;
    while(n--)
    {
        int num;
        cin>>num;
        if(num==1)
            temp++;
        else
        {
            int num2;
            char c2;
            cin>>num2;
            cin>>c2;
            if(temp%2==1)
            {
                if(num2 == 2)
                    num2=1;
                else
                    num2=2;
            }
            if(num2==1)
                s.push_front(c2);
            else
                s.push_back(c2);
        }
    }
    if(temp%2==1)
        reverse(s.begin(),s.end());
    for(auto x:s)
    {
        cout<<x;
    }

}



Compiler output:
a.cc: In function 'int main()':
a.cc:33:29: error: no matching function for call to 'std::__cxx11::list<std::__cxx11::basic_string<char> >::push_front(char&)'
   33 |                 s.push_front(c2);
      |                 ~~~~~~~~~~~~^~~~
In file included from /usr/include/c++/14/list:65,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:150,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_list.h:1264:7: note: candidate: 'void std::__cxx11::list<_Tp, _Alloc>::push_front(const value_type&) [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >; value_type = std::__cxx11::basic_string<char>]'
 1264 |       push_front(const value_type& __x)
      |       ^~~~~~~~~~
/usr/include/c++/14/bits/stl_list.h:1264:36: note:   no known conversion for argument 1 from 'char' to 'const std::__cxx11::list<std::__cxx11::basic_string<char> >::value_type&' {aka 'const std::__cxx11::basic_string<char>&'}
 1264 |       push_front(const value_type& __x)
      |                  ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_list.h:1269:7: note: candidate: 'void std::__cxx11::list<_Tp, _Alloc>::push_front(value_type&&) [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >; value_type = std::__cxx11::basic_string<char>]'
 1269 |       push_front(value_type&& __x)
      |       ^~~~~~~~~~
/usr/include/c++/14/bits/stl_list.h:1269:31: note:   no known conversion for argument 1 from 'char' to 'std::__cxx11::list<std::__cxx11::basic_string<char> >::value_type&&' {aka 'std::__cxx11::basic_string<char>&&'}
 1269 |       push_front(value_type&& __x)
      |                  ~~~~~~~~~~~~~^~~
a.cc:35:28: error: no matching function for call to 'std::__cxx11::list<std::__cxx11::basic_string<char> >::push_back(char&)'
   35 |                 s.push_back(c2);
      |                 ~~~~~~~~~~~^~~~
/usr/include/c++/14/bits/stl_list.h:1314:7: note: candidate: 'void std::__cxx11::list<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >; value_type = std::__cxx11::basic_string<char>]'
 1314 |       push_back(const value_type& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_list.h:1314:35: note:   no known conversion for argument 1 from 'char' to 'const std::__cxx11::list<std::__cxx11::basic_string<char> >::value_type&' {aka 'const std::__cxx11::basic_string<char>&'}
 1314 |       push_back(const value_type& __x)
      |                 ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_list.h:1319:7: note: candidate: 'void std::__cxx11::list<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >; value_type = std::__cxx11::basic_string<char>]'
 1319 |       push_back(value_type&& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_list.h:1319:30: note:   no known conversion for argument 1 from 'char' to 'std::__cxx11::list<std::__cxx11::basic_string<char> >::value_type&&' {aka 'std::__cxx11::basic_string<char>&&'}
 1319 |       push_back(value_type&& __x)
      |                 ~~~~~~~~~~~~~^~~