func_code_string: #include <bits/stdc++.h>   using namespace std;   int main() {     long long N, T;     cin >> N;     list<long long> L;     for (int i = 0; i < N; i++) {       cin >> T;       L.push_back(T);     }     long long K, possible = 1, curr = -1, orig = 0;     cin >> K;     vector<pair<long long, long long> > operations;     long long sum = *L.begin();     list<long long>::iterator it = L.begin();     for (int i = 0; i < K && possible; i++) {       cin >> T;       ++curr;       list<long long> L2;       if (it == L.end())         possible = 0;       else {         sum = *it;         if (T != sum) {           if (T < sum)             possible = 0;           else {             sum = 0;             long long maz = *it;             while (it != L.end() && T > sum) {               sum += *it;               L2.push_back(*it);               maz = max(maz, *it);               it++;             }             if (T != sum)               possible = 0;             else {               list<long long>::iterator it2 = L2.begin();               while (it2 != L2.end() && *it2 != maz) ++it2, ++curr;               if (it2 == L2.begin()) {                 if (it2 != L2.end()) ++it2;                 ++curr;                 while (it2 != L2.end() && *it2 == maz) ++it2, ++curr;                 if (it2 == L2.end())                   possible = 0;                 else {                   list<long long>::iterator it3 = it2;                   --it2;                   --curr;                   do {                     operations.push_back(make_pair(curr, 1));                     ++it3;                   } while (it3 != L2.end());                   while (it2 != L2.begin()) {                     --it2;                     operations.push_back(make_pair(curr, 0));                     --curr;                   }                 }               } else if (it2 == L2.end())                 possible = 0;               else {                 list<long long>::iterator it3 = it2;                 do {                   --it3;                   operations.push_back(make_pair(curr, 0));                   --curr;                 } while (it3 != L2.begin());                 ++it2;                 while (it2 != L2.end()) {                   operations.push_back(make_pair(curr, 1));                   ++it2;                 }               }             }           }         } else           ++it;       }     }     if (it != L.end() || operations.size() != N - K) possible = 0;     if (possible) {       cout <<  YES  << endl;       for (int i = 0; i < operations.size(); i++) {         cout << operations[i].first + 1 <<                  << (operations[i].second == 0 ?  L  :  R ) << endl;       }     } else       cout <<  NO  << endl;     return 0;   }   