func_code_string: #include <bits/stdc++.h>   using namespace std;   int n, k, tot, len[(int)(3e3 + 4)];   pair<int, int> bound[(int)(3e3 + 4)];   string s;   vector<int> poz, ans[3000004];   void fail();   int main() {     ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);     cin >> n >> k;     cin >> s;     for (int i = s.size() - 1; i >= 0; --i)       if (s[i] ==  R ) {         len[poz.size()] = (s.size() - poz.size()) - i - 1;         tot += len[poz.size()];         poz.push_back(i);       }     if (k > tot) fail();     int p = 0;     while (p < poz.size() && !len[p]) ++p;     bound[p] = {1, len[p]};     tot -= len[p];     for (int i = p + 1; i < poz.size(); ++i) {       int l, r, dist, ramas;       dist = dist = poz[i - 1] - poz[i] - 1;       l = max(1, bound[i - 1].first + 1 - dist);       tot -= len[i];       if (k - tot - len[i] + 1 >= l)         bound[i] = {k - tot - len[i] + 1, k - tot};       else if (l + len[i] - 1 <= k)         bound[i] = {l, l + len[i] - 1};       else         fail();     }     for (int i = 0; i < poz.size(); ++i) {       int p = poz[i];       while (bound[i].first <= bound[i].second) {         ans[bound[i].first].push_back(p + 1);         ++p;         ++bound[i].first;       }     }     for (int i = 1; i < k + 1; ++i) {       printf( %d  , ans[i].size());       for (auto it : ans[i]) printf( %d  , it);       printf(  n );     }     return 0;   }   void fail() {     cout << -1;     exit(0);   }   