#include <cstdio>
#include <string>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <list>
#include <iterator>
#include <cassert>
#include <numeric>
#pragma warning(disable:4996)

typedef long long ll;
#define MIN(a, b) ((a)>(b)? (b): (a))
#define MAX(a, b) ((a)<(b)? (b): (a))
#define LINF  9223300000000000000
#define LINF2 1223300000000000000
#define INF 2140000000
const long long MOD = 1000000007;
//const long long MOD = 998244353;

using namespace std;

char str[3005];

void solve()
{
    int n, K;
    scanf("%d%d%s", &n, &K, str);

    vector<vector<int> > v;
    int cnt = 0;
    int i;
    while (1) {
        vector<int> v0;
        for (i = 0; i < n-1; i++) {
            if (str[i] == 'R' && str[i + 1] == 'L') {
                v0.push_back(i);
                str[i] = 'L';
                str[i + 1] = 'R';
                i++;
                cnt++;
            }
        }
        if (v0.size() == 0) break;
        v.push_back(v0);
    }

    int siz = (int)v.size();
    if (K < siz || cnt < K) {
        printf("-1\n"); return;
    }
    int add = K - siz;
    for (i = 0; i < siz; i++) {
        vector<int>& v0 = v[i];
        int cnt0 = 0;
        while (add > 0 && cnt0 < (int)v0.size()-1) {
            printf("1 %d\n", v0[cnt0]+1);
            cnt0++;
            add--;
        }
        if (cnt0 < (int)v0.size()) {
            printf("%d ", (int)v0.size() - cnt0);
            int k;
            for (k = cnt0; k < (int)v0.size(); k++) {
                printf("%d", v0[k]+1);
                if (k < (int)v0.size() - 1) printf(" ");
            }
            printf("\n");
        }
    }

    return;
}

int main(int argc, char* argv[])
{
#if 1
    solve();
#else
    int T;
    scanf("%d", &T);
    int t;
    for(t=0; t<T; t++) {
        //printf("Case #%d: ", t+1);
        solve();
    }
#endif
    return 0;
}


#include <string>
#include <map>
#include <unordered_map>
#include <vector>
#include <set>
#include <algorithm>
#include <queue>
#include <stack>
#include <fstream>
#include <stdio.h>
#include <iostream>
#include <cmath>
#include <iomanip>
#include <cassert>
/*
const int MAX_MEM = 1e8;
int mpos = 0;
char mem[MAX_MEM];
inline void* operator new (size_t n) {
    assert((mpos += n) <= MAX_MEM);
    return (void*)(mem + mpos - n);
}
inline void operator delete (void*) noexcept { }
*/
 /*
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
*/

using namespace std;
typedef long long ll;

signed main() {
    ios::sync_with_stdio(false);
    int n, k;
    cin >> n >> k;
    vector<bool> mas(n);
    getchar();
    for (int i = 0; i < n; i++) {
        mas[i] = (getchar() == 'L');
    }
    vector<vector<int>> tmlm;
    int total = 0;
    bool f = false;
    vector<int> recheck;
    while (true) {
        vector<int> swp;
        bool prev = true;
        if (f) {
            for (auto i : recheck) {
                bool prev = (i - 1 < 0) || mas[i - 1];
                if (i < 0 || i >= n) {
                    continue;
                }
                if (mas[i] && mas[i] != prev) {
                    swp.push_back(i - 1);
                }
            }
        } else {
            for (int i = 0; i < n; i++) {
                if (mas[i] && mas[i] != prev) {
                    swp.push_back(i - 1);
                }
                prev = mas[i];
            }
        }
        if (swp.size() == 0) {
            break;
        }
        recheck.clear();
        for (auto i : swp) {
            swap(mas[i], mas[i + 1]);
            recheck.push_back(i);
            recheck.push_back(i - 1);
            recheck.push_back(i + 1);
        }
        f = true;
        tmlm.push_back(swp);
        total += swp.size();
    }
    if (total < k || tmlm.size() > k) {
        cout << -1;
        return 0;
    }
    int ots = k - tmlm.size();
    for (int i = 0; i < tmlm.size(); i++) {
        int m = tmlm[i].size();
        for (int j = 0; j < m; j++) {
            if (m - j - 1 > 0 && ots > 0) {
                ots--;
                cout << 1 << ' ' << tmlm[i][j] + 1 << '\n';
                continue;
            }
            cout << m - j << ' ';
            for (int s = j; s < m; s++) {
                cout << tmlm[i][s] + 1 << ' ';
            }
            cout << '\n';
            break;
        }
    }
    return 0;
}


#include <string>
#include <map>
#include <unordered_map>
#include <vector>
#include <set>
#include <algorithm>
#include <queue>
#include <stack>
#include <fstream>
#include <stdio.h>
#include <iostream>
#include <cmath>
#include <iomanip>
#include <cassert>
/*
const int MAX_MEM = 1e8;
int mpos = 0;
char mem[MAX_MEM];
inline void* operator new (size_t n) {
    assert((mpos += n) <= MAX_MEM);
    return (void*)(mem + mpos - n);
}
inline void operator delete (void*) noexcept { }
*/
/*
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
*/

using namespace std;
typedef long long ll;

int readi() {
    int x = 0;
    char c;
    while ((c = _getchar_nolock()) >= '0' && c <= '9') {
        x = (x << 3) + (x << 1) + (c & 15);
    }
    return x;
}

void outpi(int v) {
    if (v == 0) {
        _putchar_nolock('0');
        return;
    }
    char buf[10];
    int ln = 0;
    while (v) {
        buf[ln] = v % 10 + '0';
        v /= 10;
        ln++;
    }
    for (int i = ln - 1; i >= 0; i--) {
        _putchar_nolock(buf[i]);
    }
}

signed main() {
    ios::sync_with_stdio(false);
    int n = readi(), k = readi();
    vector<bool> mas(n);
    for (int i = 0; i < n; i++) {
        mas[i] = (_getchar_nolock() == 'L');
    }
    vector<vector<int>> tmlm;
    int total = 0;
    while (true) {
        vector<int> swp;
        bool prev = true;
        for (int i = 0; i < n; i++) {
            if (mas[i] && mas[i] != prev) {
                swp.push_back(i - 1);
            }
            prev = mas[i];
        }
        if (swp.size() == 0) {
            break;
        }
        for (auto i : swp) {
            swap(mas[i], mas[i + 1]);
        }
        tmlm.push_back(swp);
        total += swp.size();
    }
    if (total < k || tmlm.size() > k) {
        _putchar_nolock('-');
        _putchar_nolock('1');
        return 0;
    }
    int ots = k - tmlm.size();
    for (int i = 0; i < tmlm.size(); i++) {
        int m = tmlm[i].size();
        for (int j = 0; j < m; j++) {
            if (m - j - 1 > 0 && ots > 0) {
                ots--;
                _putchar_nolock('1');
                _putchar_nolock(' ');
                outpi(tmlm[i][j] + 1);
                _putchar_nolock('\n');
                continue;
            }
            outpi(tmlm[i][j] + 1);
            _putchar_nolock(' ');
            for (int s = j; s < m; s++) {
                outpi(tmlm[i][s] + 1);
                _putchar_nolock(' ');
            }
            _putchar_nolock('\n');
            break;
        }
    }
    return 0;
}


#include <string>
#include <map>
#include <unordered_map>
#include <vector>
#include <set>
#include <algorithm>
#include <queue>
#include <stack>
#include <fstream>
#include <stdio.h>
#include <iostream>
#include <cmath>
#include <iomanip>
#include <cassert>
/*
const int MAX_MEM = 1e8;
int mpos = 0;
char mem[MAX_MEM];
inline void* operator new (size_t n) {
    assert((mpos += n) <= MAX_MEM);
    return (void*)(mem + mpos - n);
}
inline void operator delete (void*) noexcept { }
*/
/*
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
*/

using namespace std;
typedef long long ll;

int readi() {
    int x = 0;
    char c;
    while ((c = _getchar_nolock()) >= '0' && c <= '9') {
        x = (x << 3) + (x << 1) + (c & 15);
    }
    return x;
}

void outpi(int v) {
    if (v == 0) {
        _putchar_nolock('0');
        return;
    }
    char buf[10];
    int ln = 0;
    while (v) {
        buf[ln] = v % 10 + '0';
        v /= 10;
        ln++;
    }
    for (int i = ln - 1; i >= 0; i--) {
        _putchar_nolock(buf[i]);
    }
}

signed main() {
    ios::sync_with_stdio(false);
    int n = readi(), k = readi();
    vector<bool> mas(n);
    for (int i = 0; i < n; i++) {
        mas[i] = (_getchar_nolock() == 'L');
    }
    vector<vector<int>> tmlm;
    int total = 0;
    while (true) {
        vector<int> swp;
        bool prev = true;
        for (int i = 0; i < n; i++) {
            if (mas[i] && mas[i] != prev) {
                swp.push_back(i - 1);
            }
            prev = mas[i];
        }
        if (swp.size() == 0) {
            break;
        }
        for (auto i : swp) {
            swap(mas[i], mas[i + 1]);
        }
        tmlm.push_back(swp);
        total += swp.size();
    }
    if (total < k || tmlm.size() > k) {
        _putchar_nolock('-');
        _putchar_nolock('1');
        return 0;
    }
    int ots = k - tmlm.size();
    for (int i = 0; i < tmlm.size(); i++) {
        int m = tmlm[i].size();
        for (int j = 0; j < m; j++) {
            if (m - j - 1 > 0 && ots > 0) {
                ots--;
                _putchar_nolock('1');
                _putchar_nolock(' ');
                outpi(tmlm[i][j] + 1);
                _putchar_nolock('\n');
                continue;
            }
            outpi(m - j);
            _putchar_nolock(' ');
            for (int s = j; s < m; s++) {
                outpi(tmlm[i][s] + 1);
                _putchar_nolock(' ');
            }
            _putchar_nolock('\n');
            break;
        }
    }
    return 0;
}


#include <string>
#include <map>
#include <unordered_map>
#include <vector>
#include <set>
#include <algorithm>
#include <queue>
#include <stack>
#include <fstream>
#include <stdio.h>
#include <iostream>
#include <cmath>
#include <iomanip>
#include <cassert>
/*
const int MAX_MEM = 1e8;
int mpos = 0;
char mem[MAX_MEM];
inline void* operator new (size_t n) {
    assert((mpos += n) <= MAX_MEM);
    return (void*)(mem + mpos - n);
}
inline void operator delete (void*) noexcept { }
*/
 /*
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
*/

using namespace std;
typedef long long ll;

signed main() {
    ios::sync_with_stdio(false);
    int n, k;
    cin >> n >> k;
    vector<bool> mas(n);
    getchar();
    for (int i = 0; i < n; i++) {
        mas[i] = (getchar() == 'L');
    }
    vector<vector<int>> tmlm;
    int total = 0;
    while (true) {
        vector<int> swp;
        bool prev = true;
        for (int i = 0; i < n; i++) {
            if (mas[i] && mas[i] != prev) {
                swp.push_back(i - 1);
            }
            prev = mas[i];
        }
        if (swp.size() == 0) {
            break;
        }
        for (auto i : swp) {
            swap(mas[i], mas[i + 1]);
        }
        tmlm.push_back(swp);
        total += swp.size();
    }
    if (total < k || tmlm.size() > k) {
        cout << -1;
        return 0;
    }
    int ots = k - tmlm.size();
    for (int i = 0; i < tmlm.size(); i++) {
        int m = tmlm[i].size();
        for (int j = 0; j < m; j++) {
            if (m - j - 1 > 0 && ots > 0) {
                ots--;
                cout << 1 << ' ' << tmlm[i][j] + 1 << '\n';
                continue;
            }
            cout << m - j << ' ';
            for (int s = j; s < m; s++) {
                cout << tmlm[i][s] + 1 << ' ';
            }
            cout << '\n';
            break;
        }
    }
    return 0;
}


#include <string>
#include <map>
#include <unordered_map>
#include <vector>
#include <set>
#include <algorithm>
#include <queue>
#include <stack>
#include <fstream>
#include <stdio.h>
#include <iostream>
#include <cmath>
#include <iomanip>
#include <cassert>
/*
const int MAX_MEM = 1e8;
int mpos = 0;
char mem[MAX_MEM];
inline void* operator new (size_t n) {
    assert((mpos += n) <= MAX_MEM);
    return (void*)(mem + mpos - n);
}
inline void operator delete (void*) noexcept { }
*/
 /*
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
*/

using namespace std;
typedef long long ll;

signed main() {
    ios::sync_with_stdio(false);
    int n, k;
    cin >> n >> k;
    vector<bool> mas(n);
    getchar();
    for (int i = 0; i < n; i++) {
        mas[i] = (getchar() == 'L');
    }
    vector<vector<int>> tmlm;
    int total = 0;
    bool f = false;
    vector<int> recheck;
    while (true) {
        vector<int> swp;
        if (f) {
            for (auto i : recheck) {
                if (i < 0 || i >= n) {
                    continue;
                }
                bool prev = (i - 1 < 0) || mas[i - 1];
                if (mas[i] && mas[i] != prev) {
                    swp.push_back(i - 1);
                }
            }
        } else {
            bool prev = true;
            for (int i = 0; i < n; i++) {
                if (mas[i] && mas[i] != prev) {
                    swp.push_back(i - 1);
                }
                prev = mas[i];
            }
        }
        if (swp.size() == 0) {
            break;
        }
        recheck.clear();
        vector<bool> used(n, false);
        for (auto i : swp) {
            swap(mas[i], mas[i + 1]);
            for (int ad = -1; ad <= 1; ad++) {
                int nw = i + ad;
                if (nw < 0 || nw >= n || used[nw]) {
                    continue;
                }
                recheck.push_back(nw);
                used[nw] = true;
            }
        }
        f = true;
        tmlm.push_back(swp);
        total += swp.size();
    }
    if (total < k || tmlm.size() > k) {
        cout << -1;
        return 0;
    }
    int ots = k - tmlm.size();
    for (int i = 0; i < tmlm.size(); i++) {
        int m = tmlm[i].size();
        for (int j = 0; j < m; j++) {
            if (m - j - 1 > 0 && ots > 0) {
                ots--;
                cout << 1 << ' ' << tmlm[i][j] + 1 << '\n';
                continue;
            }
            cout << m - j << ' ';
            for (int s = j; s < m; s++) {
                cout << tmlm[i][s] + 1 << ' ';
            }
            cout << '\n';
            break;
        }
    }
    return 0;
}


#include<vector>
#include<stack>
#include<cmath>
#include<algorithm>
#include<set>
#include<map>
#include<string>
#include<tuple>
#include<queue>
#include<ctime>
#include<bitset>
#include<random>
#include<iostream>
using namespace std;
//#define double long long;
typedef unsigned long long ull;
#define double long double
const double e = 0.00000005;
const double pi = 3.1415926535898;
inline int getint() {
    int val = 0;
    char c;
    while ((c = getchar()) && !(c >= '0' && c <= '9'));
    do {
        val = (val * 10) + c - '0';
    } while ((c = getchar()) && (c >= '0' && c <= '9'));
    return val;
}
int gcd(int i, int j) {
    if (j == 0)return i;
    else return gcd(j, i % j);
}
//const long long INF = 100000000000000;
const int Y = 500;
const int INF = 1000000;

bitset<3001>bs;
int arr[3001];
int main()
{
    cin.tie(0);
    cout.tie(0);
    ios_base::sync_with_stdio(false);
    // freopen("INPUT.TXT", "r", stdin);
     //freopen("OUTPUT.TXT", "w", stdout);
    vector<vector<int>>move;
    int n, k;
    cin >> n >> k;
    int cc = 0;
    long long mxm = 0;
    for (int i = 1; i <= n; ++i) {
        char tmp;
        cin >> tmp;
        bs[i] = tmp == 'R';
        if (bs[i]) {
            ++cc;
        }
        else {
            mxm += cc;
        }
    }
    while (true) {
        vector<int>tp;
        for (int i = 1; i < n; ++i) {
            if (bs[i] && !bs[i + 1]) {
                tp.push_back(i);
                ++i;
                bs[i] = true;
                bs[i - 1] = false;
            }
        }
        if (tp.size() == 0)break;
        move.push_back(tp);
    }
    if (k<move.size() || k>mxm) {
        cout << -1;
        return 0;
    }
    int i = 0;
    while (move.size() - i < k) {
        cout << 1 << " " << move[i].back() << "\n";
        if (move[i].size() == 0)++i;
        --k;
    }
    for (; i < move.size(); ++i) {
        cout << move[i].size() << " ";
        for (auto x : move[i])cout << x << " ";
        cout << "\n";
    }
    return 0;
}


#include<vector>
#include<stack>
#include<cmath>
#include<algorithm>
#include<set>
#include<map>
#include<string>
#include<tuple>
#include<queue>
#include<ctime>
#include<bitset>
#include<random>
#include<iostream>
using namespace std;
//#define double long long;
typedef unsigned long long ull;
#define double long double
const double e = 0.00000005;
const double pi = 3.1415926535898;
inline int getint() {
    int val = 0;
    char c;
    while ((c = getchar()) && !(c >= '0' && c <= '9'));
    do {
        val = (val * 10) + c - '0';
    } while ((c = getchar()) && (c >= '0' && c <= '9'));
    return val;
}
int gcd(int i, int j) {
    if (j == 0)return i;
    else return gcd(j, i % j);
}
//const long long INF = 100000000000000;
const int Y = 500;
const int INF = 1000000;

bitset<3001>bs;
int arr[3001];
int main()
{
    cin.tie(0);
    cout.tie(0);
    ios_base::sync_with_stdio(false);
    // freopen("INPUT.TXT", "r", stdin);
     //freopen("OUTPUT.TXT", "w", stdout);
    vector<vector<int>>move;
    int n, k;
    cin >> n >> k;
    int cc = 0;
    long long mxm = 0;
    string s;
    cin >> s;
    for (int i = 1; i <= n; ++i) {
        char tmp = s[i - 1];
        bs[i] = tmp == 'R';
        if (bs[i]) {
            ++cc;
        }
        else {
            mxm += cc;
        }
    }
    while (true) {
        vector<int>tp;
        for (int i = 1; i < n; ++i) {
            if (bs[i] && !bs[i + 1]) {
                tp.push_back(i);
                ++i;
                bs[i] = true;
                bs[i - 1] = false;
            }
        }
        if (tp.size() == 0)break;
        move.push_back(tp);
    }
    if (k < move.size() || k > mxm) {
        cout << -1;
        return 0;
    }
    int i = 0;
    while (move.size() - i < k) {
        cout << 1 << " " << move[i].back() << "\n";
        move[i].pop_back();
        if (move[i].size() == 0)++i;
        --k;
    }
    for (; i < move.size(); ++i) {
        cout << move[i].size() << " ";
        for (auto x : move[i])cout << x << " ";
        cout << "\n";
    }
    return 0;
}


#include<vector>
#include<stack>
#include<cmath>
#include<algorithm>
#include<set>
#include<map>
#include<string>
#include<tuple>
#include<queue>
#include<ctime>
#include<bitset>
#include<random>
#include<iostream>
using namespace std;
//#define double long long;
typedef unsigned long long ull;
#define double long double
const double e = 0.00000005;
const double pi = 3.1415926535898;
inline int getint() {
    int val = 0;
    char c;
    while ((c = getchar()) && !(c >= '0' && c <= '9'));
    do {
        val = (val * 10) + c - '0';
    } while ((c = getchar()) && (c >= '0' && c <= '9'));
    return val;
}
int gcd(int i, int j) {
    if (j == 0)return i;
    else return gcd(j, i % j);
}
//const long long INF = 100000000000000;
const int Y = 500;
const int INF = 1000000;

bitset<3001>bs;
int arr[3001];
int main()
{
    cin.tie(0);
    cout.tie(0);
    ios_base::sync_with_stdio(false);
    // freopen("INPUT.TXT", "r", stdin);
     //freopen("OUTPUT.TXT", "w", stdout);
    vector<vector<int>>move;
    int n, k;
    cin >> n >> k;
    int cc = 0;
    long long mxm = 0;
    string s;
    cin >> s;
    for (int i = 1; i <= n; ++i) {
        char tmp = s[i - 1];
        bs[i] = tmp == 'R';
        if (bs[i]) {
            ++cc;
        }
        else {
            mxm += cc;
        }
    }
    while (true) {
        vector<int>tp;
        for (int i = 1; i < n; ++i) {
            if (bs[i] && !bs[i + 1]) {
                tp.push_back(i);
                ++i;
                bs[i] = true;
                bs[i - 1] = false;
            }
        }
        if (tp.size() == 0)break;
        move.push_back(tp);
    }
    if (k < move.size() || k > mxm) {
        cout << -1;
        return 0;
    }
    int i = 0;
    while (move.size() - i < k) {
        cout << "1 " << move[i].back() << "\n";
        move[i].pop_back();
        if (move[i].size() == 0)++i;
        --k;
    }
    for (; i < move.size(); ++i) {
        cout << move[i].size() << " ";
        for (auto x : move[i])cout << x << " ";
        cout << "\n";
    }
    return 0;
}


#include<vector>
#include<stack>
#include<cmath>
#include<algorithm>
#include<set>
#include<map>
#include<string>
#include<tuple>
#include<queue>
#include<ctime>
#include<bitset>
#include<random>
#include<iostream>
using namespace std;
//#define double long long;
typedef unsigned long long ull;
#define double long double
const double e = 0.00000005;
const double pi = 3.1415926535898;
inline int getint() {
    int val = 0;
    char c;
    while ((c = getchar()) && !(c >= '0' && c <= '9'));
    do {
        val = (val * 10) + c - '0';
    } while ((c = getchar()) && (c >= '0' && c <= '9'));
    return val;
}
int gcd(int i, int j) {
    if (j == 0)return i;
    else return gcd(j, i % j);
}
//const long long INF = 100000000000000;
const int Y = 500;
const int INF = 1000000;

bitset<3001>bs;
int arr[3001];
int main()
{
    cin.tie(0);
    cout.tie(0);
    ios_base::sync_with_stdio(false);
    // freopen("INPUT.TXT", "r", stdin);
     //freopen("OUTPUT.TXT", "w", stdout);
    vector<vector<int>>move;
    int n, k;
    cin >> n >> k;
    int cc = 0;
    long long mxm = 0;
    for (int i = 1; i <= n; ++i) {
        char tmp;
        cin >> tmp;
        bs[i] = tmp == 'R';
        if (bs[i]) {
            ++cc;
        }
        else {
            mxm += cc;
        }
    }
    while (true) {
        vector<int>tp;
        for (int i = 1; i < n; ++i) {
            if (bs[i] && !bs[i + 1]) {
                tp.push_back(i);
                ++i;
                bs[i] = true;
                bs[i - 1] = false;
            }
        }
        if (tp.size() == 0)break;
        move.push_back(tp);
    }
    if (k < move.size() || k > mxm) {
        cout << -1;
        return 0;
    }
    int i = 0;
    while (move.size() - i < k) {
        cout << 1 << " " << move[i].back() << "\n";
        move[i].pop_back();
        if (move[i].size() == 0)++i;
        --k;
    }
    for (; i < move.size(); ++i) {
        cout << move[i].size() << " ";
        for (auto x : move[i])cout << x << " ";
        cout << "\n";
    }
    return 0;
}


#include<vector>
#include<stack>
#include<cmath>
#include<algorithm>
#include<set>
#include<map>
#include<string>
#include<tuple>
#include<queue>
#include<ctime>
#include<bitset>
#include<random>
#include<iostream>
using namespace std;
//#define double long long;
typedef unsigned long long ull;
#define double long double
const double e = 0.00000005;
const double pi = 3.1415926535898;
inline int getint() {
    int val = 0;
    char c;
    while ((c = getchar()) && !(c >= '0' && c <= '9'));
    do {
        val = (val * 10) + c - '0';
    } while ((c = getchar()) && (c >= '0' && c <= '9'));
    return val;
}
int gcd(int i, int j) {
    if (j == 0)return i;
    else return gcd(j, i % j);
}
//const long long INF = 100000000000000;
const int Y = 500;
const int INF = 1000000;

bitset<3001>bs;
int arr[3001];
int main()
{
    cin.tie(0);
    cout.tie(0);
    ios_base::sync_with_stdio(false);
    // freopen("INPUT.TXT", "r", stdin);
     //freopen("OUTPUT.TXT", "w", stdout);
    int n, k;
    cin >> n >> k;
    int mx = 0, mn = 0;
    for (int i = 1; i <= n; ++i) {
        char tmp;
        cin >> tmp;
        bs[i] = tmp == 'R';
    }
    int pp = 0;
    int np = n;
    for (int i = n; i > 0; --i) {
        if (bs[i]) {
            int w = np - i;
            arr[i] = max(w, pp);
            mx += np - i;
            --np;
            if(arr[i])pp = arr[i] + 1;
            mn = max(mn, arr[i]);
        }
    }
    if (k<mn || k>mx) {
        cout << -1;
        return 0;
    }
    while (k) {
        pp = 0;
        np = n;
        mn = 0;
        mx = 0;
        while (bs[np])--np;
        for (int i = np; i > 0; --i) {
            if (bs[i]) {
                int w = np - i;
                arr[i] = max(w, pp);
                --np;
                if (arr[i])pp = arr[i] + 1;
                mn = max(mn, arr[i]);
                mx += np - i;
            }
        }
        vector<int>ViVod;
        if (mn == k) {
            for (int i = n - 1; i > 0; --i) {
                if (bs[i] && !bs[i + 1]) {
                    bs[i] = false;
                    bs[i + 1] = true;
                    ViVod.push_back(i);
                    --i;
                }
            }
        }
        else {
            for (int i = n - 1; i > 0; --i) {
                if (bs[i] && !bs[i + 1]) {
                    bs[i] = false;
                    bs[i + 1] = true;
                    ViVod.push_back(i);
                    break;
                }
            }
        }
        cout << ViVod.size() << " ";
        for (int i = ViVod.size() - 1; i >= 0; --i)cout << ViVod[i] << " ";
        cout << "\n";
        --k;
    }
    return 0;
}


#ifdef _MSC_VER
#define _CRT_SECURE_NO_WARNINGS
#  include <intrin.h>
#  define __builtin_popcount __popcnt
#endif

#define _USE_MATH_DEFINES

#include <stdio.h>
#include <iostream>
#include <vector>
#include <unordered_map>
#include <stack>
#include <list>
#include <math.h>
#include <bitset>
#include <iterator>
#include <map>
#include <iomanip>
#include <functional>
#include <string>
#include <algorithm>
#include <queue>
#include <random>
#include <set>
#include <cassert>

using namespace std;

template<class T> ostream& operator<<(ostream& os, const vector<T>& v) {
	for (auto i = begin(v); i != end(v); i++) os << *i << (i == end(v) - 1 ? "" : " "); return os;
}
template<class T> istream& operator>>(istream& is, vector<T>& v) {
	for (auto i = begin(v); i != end(v); i++) is >> *i; return is;
}

#define MOD 1000000007
#define inf 2000000000
#define FWT_SIZE 2000000
#define pii pair<int,int>
#define all(x) (x).begin(), (x).end()
#define sort_all(x) sort(all(x))
#define make_unique(x) (x).erase(unique(all(x)), (x).end())

char input[10000];

int n, k;
inline bool is_possible(int pos)
{
	if (pos < 0)
		return false;
	if (pos + 1 >= n)
		return false;
	return input[pos] == 'R' && input[pos+1]=='L';
}

int main() {

#if defined(_DEBUG)
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif

	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);

	scanf("%d %d", &n, &k);
	scanf("%s", input);

	vector<vector<int>> ans;
	vector<int> next_pos;
	for (int i = 0; i + 1 < n; i++)
	{
		if (is_possible(i))
			next_pos.push_back(i);
	}

	while (next_pos.size() > 0)
	{
		ans.push_back(next_pos);
		vector<int> new_next;
		for (int x : next_pos)
		{
			//if (input[x] != 'R' || input[x + 1] != 'L')
			//	throw 1;
			swap(input[x], input[x + 1]);
			if (is_possible(x - 1))
				new_next.push_back(x - 1);
			if (is_possible(x + 1))
				new_next.push_back(x + 1);
		}
		sort(all(new_next)); make_unique(new_next);
		next_pos = new_next;
	}

	if (ans.size() > k)
	{
		printf("-1");
	}
	else
	{
		vector<vector<int>> new_ans;
		int wask = k;
		k -= ans.size();
		for (auto &x : ans)
		{
			while (k > 0 && x.size() > 1)
			{
				vector<int> tmp;
				tmp.push_back(x.back());
				x.pop_back();
				k--;
				new_ans.push_back(tmp);
			}
			new_ans.push_back(x);
		}

		if (new_ans.size() != wask)
		{
			printf("-1");
		}
		else
		{
			for (auto& x : new_ans) {
				printf("%d ", x.size());
				for (int j : x)
					printf("%d ", j+1);
				printf("\n");
			}
		}
	}

	return 0;
}


#include <stdio.h>
#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <math.h>

#define ll long long
#define ull unsigned long long

using namespace std;

const int inf = 1000000000;
const double eps = 1e-7;

void solve() {
	int n, k;
	string s;
	cin >> n >> k >> s;

	int cnt = 0;
	vector<vector<int>> res;
	for (;;) {
		vector<int> a;
		for (int i = 1; i < s.size(); ++i)
			if (s[i - 1] == 'R' && s[i] == 'L') {
				a.emplace_back(i);
				++cnt;
			}
		for (auto pos : a)
			swap(s[pos - 1], s[pos]);
		if (a.empty())
			break;
		res.emplace_back(a);
	}

	if (cnt < k || k < res.size()) {
		printf("-1\n");
		return;
	}

	for (int i = 0; i < res.size(); ++i) {
		if (cnt - res[i].size() >= k - 1) {
			printf("%d", (int)res[i].size());
			for (auto e : res[i])
				printf(" %d", e);
			printf("\n");
			cnt -= res[i].size();
			--k;
		}
		else if (cnt == k) {
			for (auto e : res[i]) {
				printf("1 %d\n", e);
				--cnt;
				--k;
			}
		}
		else {
			int x = cnt - k + 1;
			printf("%d", x);
			for (int j = 0; j < x; ++j)
				printf(" %d", res[i][j]);
			printf("\n");
			cnt -= x;
			--k;
			for (int j = x; j < res[i].size(); ++j) {
				printf("1 %d\n", res[i][j]);
				--cnt;
				--k;
			}
		}
	}
}

int main() {
	int t = 1;
	//cin >> t;
	for (int i = 0; i < t; ++i)
		solve();
	return 0;
}


#include <stdio.h>
#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <math.h>

#define ll long long
#define ull unsigned long long

using namespace std;

const int inf = 1000000000;
const double eps = 1e-7;

void solve() {
	int n, k;
	string s;
	cin >> n >> k >> s;

	int cnt = 0;
	vector<vector<int>> res;
	for (;;) {
		vector<int> a;
		for (int i = 1; i < s.size(); ++i)
			if (s[i - 1] == 'R' && s[i] == 'L') {
				swap(s[i - 1], s[i]);
				a.emplace_back(i);
				++cnt;
			}
		if (a.empty())
			break;
		res.emplace_back(a);
	}

	if (cnt < k || k < res.size()) {
		cout << -1 << endl;
		return;
	}

	for (int i = 0; i < res.size(); ++i) {
		if (cnt - res[i].size() >= k - 1) {
			printf("%d", (int)res[i].size());
			for (auto e : res[i])
				printf(" %d", e);
			printf("\n");
			cnt -= res[i].size();
			--k;
		}
		else if (cnt == k) {
			for (auto e : res[i]) {
				printf("1 %d\n", e);
				--cnt;
				--k;
			}
		}
		else {
			int x = cnt - k + 1;
			printf("%d", x);
			for (int j = 0; j < x; ++j)
				printf(" %d", res[i][j]);
			printf("\n");
			cnt -= x;
			--k;
			for (int j = x; j < res[i].size(); ++j) {
				printf("1 %d\n", res[i][j]);
				--cnt;
				--k;
			}
		}
	}
}

int main() {
	int t = 1;
	//cin >> t;
	for (int i = 0; i < t; ++i)
		solve();
	return 0;
}


#define ll long long
using namespace std;
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
const int maxN = 3001;

int main()
{
	int n, k;
	vector<int> changes;
	cin >> n >> k;
	bool side[maxN];
	char str[maxN] = ""; scanf("%s", str);
	for (int i = 0; i < n; i++) {
		if (str[i] == 'R') side[i] = 1; else side[i] = 0;}
	bool isStable = false;
	int j = 1; int totalCh = 0;
	int counter = 1;
	for (j = 0;counter!=0; j++) {
		counter = 0;
		for (int i = 0; i < n - 1; i++)
		{
			if (side[i] == 1 && side[i + 1] == 0)
			{
				changes.push_back(i); side[i] = 0; side[i + 1] = 1; i++;
				totalCh++;counter++;
			}
		}
		if (counter == 0) { break; }
		changes.insert(changes.end() - counter, counter);
	}
	if (k<j || k>changes.size() - j) { cout << -1; return 0; }
	for (int i = 0; i < changes.size()-1; i++)
	{
		int size; size = changes[i];
		while (j < k && size>0) { size--; i++; printf("%s%d%s", "1 ", changes[i]+1, "\n"); }
		if (size > 0)
		{
			printf("%d%s", size, " ");
			while(size>0)
			{
				i++;
				printf("%d%s", changes[i]+1, " ");
				size--;
			}
			printf("%s", "\n");
		}
	}
}


#define ll long long
using namespace std;
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
const int maxN = 3001;

int main()
{
	int n, k;
	vector<int> changes;
	cin >> n >> k;
	bool side[maxN];
	char str[maxN] = ""; scanf("%s", str);
	for (int i = 0; i < n; i++) {
		if (str[i] == 'R') side[i] = 1; else side[i] = 0;}
	bool isStable = false;
	int j = 1; int totalCh = 0;
	int counter = 1;
	for (j = 0;counter!=0; j++) {
		counter = 0;
		for (int i = 0; i < n - 1; i++)
		{
			if (side[i] == 1 && side[i + 1] == 0)
			{
				changes.push_back(i); side[i] = 0; side[i + 1] = 1; i++;
				totalCh++;counter++;
			}
		}
		if (counter == 0) { break; }
		changes.insert(changes.end() - counter, counter);
	}
	if (k<j || k>changes.size() - j) { cout << -1; return 0; }
	for (int i = 0; i < changes.size()-1; i++)
	{
		int size; size = changes[i];
		while (j < k && size>0) { size--; j++; i++; printf("%s%d%s", "1 ", changes[i] + 1, "\n"); }
		if (size > 0)
		{
			printf("%d%s", size, " ");
			while(size>0)
			{
				i++;
				printf("%d%s", changes[i]+1, " ");
				size--;
			}
			printf("%s", "\n");
		}
		else { j--; }
	}
}


#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")

#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <fstream>
#include <sstream>
#include <set>
#include <map>
#include <vector>
#include <list>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <string>
#include <queue>
#include <bitset>		//UWAGA - w czasie kompilacji musi byc znany rozmiar wektora - nie mozna go zmienic
#include <cassert>
#include <iomanip>		//do setprecision
#include <ctime>
#include <complex>
#include <chrono>
#include<unordered_map>
using namespace std;

#define FOR(i,b,e) for(int i=(b);i<(e);++i)
#define FORQ(i,b,e) for(int i=(b);i<=(e);++i)
#define FORD(i,b,e) for(int i=(b)-1;i>=(e);--i)
#define REP(x, n) for(int x = 0; x < (n); ++x)
#define ALL(u) (u).begin(),(u).end()

#define ST first
#define ND second
#define PB push_back
#define MP make_pair
#define LL long long
#define ULL unsigned LL
#define LD long double

typedef pair<int, int> PII;

const double pi = 3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342;

const int MR = 3010;
const int MS = 3e6 + 10;

char s[MR];

vector<int> pos[MS];

int main()
{
	int n, k;
	scanf("%d%d%s", &n, &k, s);

	REP(i, n - 1)
		if (s[i] == 'R' && s[i + 1] == 'L')
			pos[0].push_back(i);

	int lvl = 0, ile = 0;
	while (!pos[lvl].empty())
	{
		ile += pos[lvl].size();
		for (int p : pos[lvl])
		{
			s[p] = 'L';
			if (p && s[p - 1] == 'R')
				pos[lvl + 1].push_back(p - 1);
			s[p + 1] = 'R';
			if (p < n - 1 && s[p + 1] == 'L')
				pos[lvl + 1].push_back(p + 1);
		}

		lvl++;
	}

	if (ile < k /*|| lvl > k*/)
		printf("-1\n");
	else
	{
		int left = k;
		REP(i, lvl)
		{
			int taken = 0;
			while (left > lvl - i && taken < pos[i].size())
			{
				left--;
				printf("1 %d\n", pos[i][taken++]);
			}

			if (taken == pos[i].size())
				continue;

			left--;
			printf("%d ", pos[i].size() - taken);
			FOR(j, taken, pos[i].size())
				printf("%d ", pos[i][j] + 1);
			printf("\n");
		}
	}

	return 0;
}

// FOR GNU C++ use the following pattern:
// Uncomment the code below and change your main into main2
// It does not build in MS C++
// But it does increase the stack size from 256 MB on CF and uses GNU C++

//#include <Processthreadsapi.h>
//#include <iostream>
//#include <Synchapi.h>
//#include <windows.h>
//#include <process.h>
//
//DWORD WINAPI MyThreadFunction(LPVOID lpParam) {
//    main2(nullptr);
//    return 0;
//}
//int main() {
//    auto h = CreateThread(nullptr, 1024 << 20, MyThreadFunction, nullptr, STACK_SIZE_PARAM_IS_A_RESERVATION, nullptr);
//    WaitForSingleObject(h, INFINITE);
//}


#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")

#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <fstream>
#include <sstream>
#include <set>
#include <map>
#include <vector>
#include <list>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <string>
#include <queue>
#include <bitset>		//UWAGA - w czasie kompilacji musi byc znany rozmiar wektora - nie mozna go zmienic
#include <cassert>
#include <iomanip>		//do setprecision
#include <ctime>
#include <complex>
#include <chrono>
#include<unordered_map>
using namespace std;

#define FOR(i,b,e) for(int i=(b);i<(e);++i)
#define FORQ(i,b,e) for(int i=(b);i<=(e);++i)
#define FORD(i,b,e) for(int i=(b)-1;i>=(e);--i)
#define REP(x, n) for(int x = 0; x < (n); ++x)
#define ALL(u) (u).begin(),(u).end()

#define ST first
#define ND second
#define PB push_back
#define MP make_pair
#define LL long long
#define ULL unsigned LL
#define LD long double

typedef pair<int, int> PII;

const double pi = 3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342;

const int MR = 3010;
const int MS = 3e6 + 10;

char s[MR];

vector<int> pos[MS];

int main()
{
	int n, k;
	scanf("%d%d%s", &n, &k, s);

	REP(i, n - 1)
		if (s[i] == 'R' && s[i + 1] == 'L')
			pos[0].push_back(i);

	int lvl = 0, ile = 0;
	while (!pos[lvl].empty())
	{
		ile += pos[lvl].size();
		for (int p : pos[lvl])
		{
			s[p] = 'L';
			if (p && s[p - 1] == 'R')
				pos[lvl + 1].push_back(p - 1);
			s[p + 1] = 'R';
			if (p < n - 2 && s[p + 2] == 'L')
				pos[lvl + 1].push_back(p + 2);
		}

		lvl++;
	}

	if (ile < k || lvl > k)
		printf("-1\n");
	else
	{
		int left = k;
		REP(i, lvl)
		{
			int taken = 0;
			while (left > lvl - i && taken < pos[i].size())
			{
				left--;
				printf("1 %d\n", pos[i][taken++]);
			}

			if (taken == pos[i].size())
				continue;

			left--;
			printf("%d ", pos[i].size() - taken);
			FOR(j, taken, pos[i].size())
				printf("%d ", pos[i][j] + 1);
			printf("\n");
		}
	}

	return 0;
}

// FOR GNU C++ use the following pattern:
// Uncomment the code below and change your main into main2
// It does not build in MS C++
// But it does increase the stack size from 256 MB on CF and uses GNU C++

//#include <Processthreadsapi.h>
//#include <iostream>
//#include <Synchapi.h>
//#include <windows.h>
//#include <process.h>
//
//DWORD WINAPI MyThreadFunction(LPVOID lpParam) {
//    main2(nullptr);
//    return 0;
//}
//int main() {
//    auto h = CreateThread(nullptr, 1024 << 20, MyThreadFunction, nullptr, STACK_SIZE_PARAM_IS_A_RESERVATION, nullptr);
//    WaitForSingleObject(h, INFINITE);
//}


#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")

#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <fstream>
#include <sstream>
#include <set>
#include <map>
#include <vector>
#include <list>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <string>
#include <queue>
#include <bitset>		//UWAGA - w czasie kompilacji musi byc znany rozmiar wektora - nie mozna go zmienic
#include <cassert>
#include <iomanip>		//do setprecision
#include <ctime>
#include <complex>
#include <chrono>
#include<unordered_map>
using namespace std;

#define FOR(i,b,e) for(int i=(b);i<(e);++i)
#define FORQ(i,b,e) for(int i=(b);i<=(e);++i)
#define FORD(i,b,e) for(int i=(b)-1;i>=(e);--i)
#define REP(x, n) for(int x = 0; x < (n); ++x)
#define ALL(u) (u).begin(),(u).end()

#define ST first
#define ND second
#define PB push_back
#define MP make_pair
#define LL long long
#define ULL unsigned LL
#define LD long double

typedef pair<int, int> PII;

const double pi = 3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342;

const int MR = 3010;
const int MS = 3e6 + 10;

char s[MR];

vector<int> prt[MS];

int main()
{
	int n, k;
	scanf("%d%d%s", &n, &k, s);
	vector<int> res;
	set<int> S;
	REP(i, n - 1)
		if (s[i] == 'R' && s[i + 1] == 'L')
			S.insert(i);

	while (!S.empty())
	{
		auto it = S.begin();
		res.push_back(*it);
		S.erase(it);

		s[res.back()] = 'L';
		if (res.back() && s[res.back() - 1] == 'R')
			S.insert(res.back() - 1);
		s[res.back() + 1] = 'R';
		if (res.back() < n - 1 && s[res.back() + 1] == 'L')
			S.insert(res.back() + 1);
	}

	if (res.size() < k)
		printf("-1\n");
	else
	{
		int left = res.size(), pos = 0, lim = n / 2;
		REP(i, k)
		{
			int ile = min(left - (k - left-1), lim);
			REP(j, ile)
				prt[i].push_back(res[pos++]);
			left -= ile;
		}

		if (left)
			printf("-1\n");
		else
		{
			REP(i, k)
			{
				printf("%d ", prt[i].size());
				for (int j : prt[i])
					printf("%d ", j + 1);
				printf("\n");
			}
		}
	}

	return 0;
}

// FOR GNU C++ use the following pattern:
// Uncomment the code below and change your main into main2
// It does not build in MS C++
// But it does increase the stack size from 256 MB on CF and uses GNU C++

//#include <Processthreadsapi.h>
//#include <iostream>
//#include <Synchapi.h>
//#include <windows.h>
//#include <process.h>
//
//DWORD WINAPI MyThreadFunction(LPVOID lpParam) {
//    main2(nullptr);
//    return 0;
//}
//int main() {
//    auto h = CreateThread(nullptr, 1024 << 20, MyThreadFunction, nullptr, STACK_SIZE_PARAM_IS_A_RESERVATION, nullptr);
//    WaitForSingleObject(h, INFINITE);
//}


#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")

#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <fstream>
#include <sstream>
#include <set>
#include <map>
#include <vector>
#include <list>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <string>
#include <queue>
#include <bitset>		//UWAGA - w czasie kompilacji musi byc znany rozmiar wektora - nie mozna go zmienic
#include <cassert>
#include <iomanip>		//do setprecision
#include <ctime>
#include <complex>
#include <chrono>
#include<unordered_map>
using namespace std;

#define FOR(i,b,e) for(int i=(b);i<(e);++i)
#define FORQ(i,b,e) for(int i=(b);i<=(e);++i)
#define FORD(i,b,e) for(int i=(b)-1;i>=(e);--i)
#define REP(x, n) for(int x = 0; x < (n); ++x)
#define ALL(u) (u).begin(),(u).end()

#define ST first
#define ND second
#define PB push_back
#define MP make_pair
#define LL long long
#define ULL unsigned LL
#define LD long double

typedef pair<int, int> PII;

const double pi = 3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342;

const int MR = 3010;
const int MS = 3e6 + 10;

char s[MR];

vector<int> prt[MS];

int main()
{
	int n, k;
	scanf("%d%d%s", &n, &k, s);
	vector<int> res;
	set<int> S;
	REP(i, n - 1)
		if (s[i] == 'R' && s[i + 1] == 'L')
			S.insert(i);

	while (!S.empty())
	{
		auto it = S.begin();
		res.push_back(*it);
		S.erase(it);

		s[res.back()] = 'L';
		if (res.back() && s[res.back() - 1] == 'R')
			S.insert(res.back() - 1);
		s[res.back() + 1] = 'R';
		if (res.back() < n - 2 && s[res.back() + 2] == 'L')
			S.insert(res.back() + 1);
	}

	if (res.size() < k)
		printf("-1\n");
	else
	{
		int left = res.size(), pos = 0, lim = n / 2;
		REP(i, k)
		{
			int ile = min(left - (k - i - 1), lim);
			REP(j, ile)
				prt[i].push_back(res[pos++]);
			left -= ile;
		}

		if (left)
			printf("-1\n");
		else
		{
			REP(i, k)
			{
				printf("%d ", prt[i].size());
				for (int j : prt[i])
					printf("%d ", j + 1);
				printf("\n");
			}
		}
	}

	return 0;
}


#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")

#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <fstream>
#include <sstream>
#include <set>
#include <map>
#include <vector>
#include <list>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <string>
#include <queue>
#include <bitset>		//UWAGA - w czasie kompilacji musi byc znany rozmiar wektora - nie mozna go zmienic
#include <cassert>
#include <iomanip>		//do setprecision
#include <ctime>
#include <complex>
#include <chrono>
#include<unordered_map>
using namespace std;

#define FOR(i,b,e) for(int i=(b);i<(e);++i)
#define FORQ(i,b,e) for(int i=(b);i<=(e);++i)
#define FORD(i,b,e) for(int i=(b)-1;i>=(e);--i)
#define REP(x, n) for(int x = 0; x < (n); ++x)
#define ALL(u) (u).begin(),(u).end()

#define ST first
#define ND second
#define PB push_back
#define MP make_pair
#define LL long long
#define ULL unsigned LL
#define LD long double

typedef pair<int, int> PII;

const double pi = 3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342;

const int MR = 3010;
const int MS = 3e6 + 10;

char s[MR];

vector<int> prt[MS];

int main()
{
	int n, k;
	scanf("%d%d%s", &n, &k, s);
	vector<int> res;
	set<int> S;
	REP(i, n - 1)
		if (s[i] == 'R' && s[i + 1] == 'L')
			S.insert(i);

	while (!S.empty())
	{
		auto it = S.begin();
		res.push_back(*it);

		s[res.back()] = 'L';
		if (res.back() && s[res.back() - 1] == 'R')
			S.insert(res.back() - 1);
		s[res.back() + 1] = 'R';
		if (res.back() < n - 1 && s[res.back() + 1] == 'L')
			S.insert(res.back() + 1);

		S.erase(it);
	}

	if (res.size() < k)
		printf("-1\n");
	else
	{
		int left = res.size(), pos = 0, lim = n / 2;
		REP(i, k)
		{
			int ile = min(left - (k - i - 1), lim);
			REP(j, ile)
				prt[i].push_back(res[pos++]);
			left -= ile;
		}

		if (left)
			printf("-1\n");
		REP(i, k)
		{
			printf("%d ", prt[i].size());
			for (int j : prt[i])
				printf("%d ", j + 1);
			printf("\n");
		}
	}

	return 0;
}

// FOR GNU C++ use the following pattern:
// Uncomment the code below and change your main into main2
// It does not build in MS C++
// But it does increase the stack size from 256 MB on CF and uses GNU C++

//#include <Processthreadsapi.h>
//#include <iostream>
//#include <Synchapi.h>
//#include <windows.h>
//#include <process.h>
//
//DWORD WINAPI MyThreadFunction(LPVOID lpParam) {
//    main2(nullptr);
//    return 0;
//}
//int main() {
//    auto h = CreateThread(nullptr, 1024 << 20, MyThreadFunction, nullptr, STACK_SIZE_PARAM_IS_A_RESERVATION, nullptr);
//    WaitForSingleObject(h, INFINITE);
//}


#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")

#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <fstream>
#include <sstream>
#include <set>
#include <map>
#include <vector>
#include <list>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <string>
#include <queue>
#include <bitset>		//UWAGA - w czasie kompilacji musi byc znany rozmiar wektora - nie mozna go zmienic
#include <cassert>
#include <iomanip>		//do setprecision
#include <ctime>
#include <complex>
#include <chrono>
#include<unordered_map>
using namespace std;

#define FOR(i,b,e) for(int i=(b);i<(e);++i)
#define FORQ(i,b,e) for(int i=(b);i<=(e);++i)
#define FORD(i,b,e) for(int i=(b)-1;i>=(e);--i)
#define REP(x, n) for(int x = 0; x < (n); ++x)
#define ALL(u) (u).begin(),(u).end()

#define ST first
#define ND second
#define PB push_back
#define MP make_pair
#define LL long long
#define ULL unsigned LL
#define LD long double

typedef pair<int, int> PII;

const double pi = 3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342;

const int MR = 3010;
const int MS = 3e6 + 10;

char s[MR];

vector<int> pos[MS];

int main()
{
	int n, k;
	scanf("%d%d%s", &n, &k, s);

	REP(i, n - 1)
		if (s[i] == 'R' && s[i + 1] == 'L')
			pos[0].push_back(i);

	int lvl = 0, ile = 0;
	while (!pos[lvl].empty())
	{
		ile += pos[lvl].size();
		for (int p : pos[lvl])
		{
			s[p] = 'L';
			if (p && s[p - 1] == 'R')
				pos[lvl + 1].push_back(p - 1);
			s[p + 1] = 'R';
			if (p < n - 2 && s[p + 2] == 'L')
				pos[lvl + 1].push_back(p + 1);
		}

		lvl++;
	}

	if (ile < k || lvl > k)
		printf("-1\n");
	else
	{
		int left = k;
		REP(i, lvl)
		{
			int taken = 0;
			while (left > lvl - i && taken < pos[i].size())
			{
				left--;
				printf("1 %d\n", pos[i][taken++]);
			}

			if (taken == pos[i].size())
				continue;

			left--;
			printf("%d ", pos[i].size() - taken);
			FOR(j, taken, pos[i].size())
				printf("%d ", pos[i][j] + 1);
			printf("\n");
		}
	}

	return 0;
}

// FOR GNU C++ use the following pattern:
// Uncomment the code below and change your main into main2
// It does not build in MS C++
// But it does increase the stack size from 256 MB on CF and uses GNU C++

//#include <Processthreadsapi.h>
//#include <iostream>
//#include <Synchapi.h>
//#include <windows.h>
//#include <process.h>
//
//DWORD WINAPI MyThreadFunction(LPVOID lpParam) {
//    main2(nullptr);
//    return 0;
//}
//int main() {
//    auto h = CreateThread(nullptr, 1024 << 20, MyThreadFunction, nullptr, STACK_SIZE_PARAM_IS_A_RESERVATION, nullptr);
//    WaitForSingleObject(h, INFINITE);
//}


#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")

#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <fstream>
#include <sstream>
#include <set>
#include <map>
#include <vector>
#include <list>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <string>
#include <queue>
#include <bitset>		//UWAGA - w czasie kompilacji musi byc znany rozmiar wektora - nie mozna go zmienic
#include <cassert>
#include <iomanip>		//do setprecision
#include <ctime>
#include <complex>
#include <chrono>
#include<unordered_map>
using namespace std;

#define FOR(i,b,e) for(int i=(b);i<(e);++i)
#define FORQ(i,b,e) for(int i=(b);i<=(e);++i)
#define FORD(i,b,e) for(int i=(b)-1;i>=(e);--i)
#define REP(x, n) for(int x = 0; x < (n); ++x)
#define ALL(u) (u).begin(),(u).end()

#define ST first
#define ND second
#define PB push_back
#define MP make_pair
#define LL long long
#define ULL unsigned LL
#define LD long double

typedef pair<int, int> PII;

const double pi = 3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342;

const int MR = 3010;
const int MS = 3e6 + 10;

char s[MR];

vector<int> prt[MS];

int main()
{
	int n, k;
	scanf("%d%d%s", &n, &k, s);
	vector<int> res;
	set<int> S;
	REP(i, n - 1)
		if (s[i] == 'R' && s[i + 1] == 'L')
			S.insert(i);

	while (!S.empty())
	{
		auto it = S.begin();
		res.push_back(*it);
		S.erase(it);

		s[res.back()] = 'L';
		if (res.back() && s[res.back() - 1] == 'R')
			S.insert(res.back() - 1);
		s[res.back() + 1] = 'R';
		if (res.back() < n - 1 && s[res.back() + 1] == 'L')
			S.insert(res.back() + 1);
	}

	if (res.size() < k)
		printf("-1\n");
	else
	{
		int left = res.size(), pos = 0, lim = n / 2;
		REP(i, k)
		{
			int ile = min(left - (k - i - 1), lim);
			REP(j, ile)
				prt[i].push_back(res[pos++]);
			left -= ile;
		}

		if (left)
			printf("-1\n");
		REP(i, k)
		{
			printf("%d ", prt[i].size());
			for (int j : prt[i])
				printf("%d ", j + 1);
			printf("\n");
		}
	}

	return 0;
}

// FOR GNU C++ use the following pattern:
// Uncomment the code below and change your main into main2
// It does not build in MS C++
// But it does increase the stack size from 256 MB on CF and uses GNU C++

//#include <Processthreadsapi.h>
//#include <iostream>
//#include <Synchapi.h>
//#include <windows.h>
//#include <process.h>
//
//DWORD WINAPI MyThreadFunction(LPVOID lpParam) {
//    main2(nullptr);
//    return 0;
//}
//int main() {
//    auto h = CreateThread(nullptr, 1024 << 20, MyThreadFunction, nullptr, STACK_SIZE_PARAM_IS_A_RESERVATION, nullptr);
//    WaitForSingleObject(h, INFINITE);
//}


#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")

#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <fstream>
#include <sstream>
#include <set>
#include <map>
#include <vector>
#include <list>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <string>
#include <queue>
#include <bitset>		//UWAGA - w czasie kompilacji musi byc znany rozmiar wektora - nie mozna go zmienic
#include <cassert>
#include <iomanip>		//do setprecision
#include <ctime>
#include <complex>
#include <chrono>
#include<unordered_map>
using namespace std;

#define FOR(i,b,e) for(int i=(b);i<(e);++i)
#define FORQ(i,b,e) for(int i=(b);i<=(e);++i)
#define FORD(i,b,e) for(int i=(b)-1;i>=(e);--i)
#define REP(x, n) for(int x = 0; x < (n); ++x)
#define ALL(u) (u).begin(),(u).end()

#define ST first
#define ND second
#define PB push_back
#define MP make_pair
#define LL long long
#define ULL unsigned LL
#define LD long double

typedef pair<int, int> PII;

const double pi = 3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342;

const int MR = 3010;

char s[MR];

int main()
{
	int n, k;
	scanf("%d%d%s", &n, &k, s);
	vector<int> res;
	set<int> S;
	REP(i, n - 1)
		if (s[i] == 'R' && s[i + 1] == 'L')
			S.insert(i);

	while (!S.empty())
	{
		auto it = S.begin();
		res.push_back(*it);

		s[res.back()] = 'L';
		if (res.back() && s[res.back() - 1] == 'R')
			S.insert(res.back() - 1);
		s[res.back() + 1] = 'R';
		if (res.back() < n - 1 && s[res.back() + 1] == 'L')
			S.insert(res.back() + 1);

		S.erase(it);
	}

	if (res.size() < k)
		printf("-1\n");
	else
	{
		int ile = res.size() - k + 1;
		printf("%d ", ile);
		REP(i, ile)
			printf("%d ", res[i] + 1);
		printf("\n");
		FOR(j, ile, res.size())
			printf("1 %d\n", res[j] + 1);
	}

	return 0;
}

// FOR GNU C++ use the following pattern:
// Uncomment the code below and change your main into main2
// It does not build in MS C++
// But it does increase the stack size from 256 MB on CF and uses GNU C++

//#include <Processthreadsapi.h>
//#include <iostream>
//#include <Synchapi.h>
//#include <windows.h>
//#include <process.h>
//
//DWORD WINAPI MyThreadFunction(LPVOID lpParam) {
//    main2(nullptr);
//    return 0;
//}
//int main() {
//    auto h = CreateThread(nullptr, 1024 << 20, MyThreadFunction, nullptr, STACK_SIZE_PARAM_IS_A_RESERVATION, nullptr);
//    WaitForSingleObject(h, INFINITE);
//}


#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")

#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <fstream>
#include <sstream>
#include <set>
#include <map>
#include <vector>
#include <list>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <string>
#include <queue>
#include <bitset>		//UWAGA - w czasie kompilacji musi byc znany rozmiar wektora - nie mozna go zmienic
#include <cassert>
#include <iomanip>		//do setprecision
#include <ctime>
#include <complex>
#include <chrono>
#include<unordered_map>
using namespace std;

#define FOR(i,b,e) for(int i=(b);i<(e);++i)
#define FORQ(i,b,e) for(int i=(b);i<=(e);++i)
#define FORD(i,b,e) for(int i=(b)-1;i>=(e);--i)
#define REP(x, n) for(int x = 0; x < (n); ++x)
#define ALL(u) (u).begin(),(u).end()

#define ST first
#define ND second
#define PB push_back
#define MP make_pair
#define LL long long
#define ULL unsigned LL
#define LD long double

typedef pair<int, int> PII;

const double pi = 3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342;

const int MR = 3010;
const int MS = 3e6 + 10;

char s[MR];

vector<int> pos[MS];

int main()
{
	int n, k;
	scanf("%d%d%s", &n, &k, s);

	REP(i, n - 1)
		if (s[i] == 'R' && s[i + 1] == 'L')
			pos[0].push_back(i);

	int lvl = 0, ile = 0;
	while (!pos[lvl].empty())
	{
		ile += pos[lvl].size();
		for (int p : pos[lvl])
		{
			s[p] = 'L';
			if (p && s[p - 1] == 'R')
				pos[lvl + 1].push_back(p - 1);
			s[p + 1] = 'R';
			if (p < n - 2 && s[p + 2] == 'L')
				pos[lvl + 1].push_back(p + 1);
		}

		lvl++;
	}

	if (ile < k || lvl > k)
		printf("-1\n");
	else
	{
		int left = k;
		REP(i, lvl)
		{
			int taken = 0;
			while (left > lvl - i && taken < pos[i].size())
			{
				left--;
				printf("1 %d\n", pos[i][taken++] + 1);
			}

			if (taken == pos[i].size())
				continue;

			left--;
			printf("%d ", pos[i].size() - taken);
			FOR(j, taken, pos[i].size())
				printf("%d ", pos[i][j] + 1);
			printf("\n");
		}
	}

	return 0;
}

// FOR GNU C++ use the following pattern:
// Uncomment the code below and change your main into main2
// It does not build in MS C++
// But it does increase the stack size from 256 MB on CF and uses GNU C++

//#include <Processthreadsapi.h>
//#include <iostream>
//#include <Synchapi.h>
//#include <windows.h>
//#include <process.h>
//
//DWORD WINAPI MyThreadFunction(LPVOID lpParam) {
//    main2(nullptr);
//    return 0;
//}
//int main() {
//    auto h = CreateThread(nullptr, 1024 << 20, MyThreadFunction, nullptr, STACK_SIZE_PARAM_IS_A_RESERVATION, nullptr);
//    WaitForSingleObject(h, INFINITE);
//}


#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")

#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <fstream>
#include <sstream>
#include <set>
#include <map>
#include <vector>
#include <list>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <string>
#include <queue>
#include <bitset>		//UWAGA - w czasie kompilacji musi byc znany rozmiar wektora - nie mozna go zmienic
#include <cassert>
#include <iomanip>		//do setprecision
#include <ctime>
#include <complex>
#include <chrono>
#include<unordered_map>
using namespace std;

#define FOR(i,b,e) for(int i=(b);i<(e);++i)
#define FORQ(i,b,e) for(int i=(b);i<=(e);++i)
#define FORD(i,b,e) for(int i=(b)-1;i>=(e);--i)
#define REP(x, n) for(int x = 0; x < (n); ++x)
#define ALL(u) (u).begin(),(u).end()

#define ST first
#define ND second
#define PB push_back
#define MP make_pair
#define LL long long
#define ULL unsigned LL
#define LD long double

typedef pair<int, int> PII;

const double pi = 3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342;

const int MR = 3010;
const int MS = 3e6 + 10;

char s[MR];

vector<int> pos[MS];

int main()
{
	int n, k;
	scanf("%d%d%s", &n, &k, s);

	REP(i, n - 1)
		if (s[i] == 'R' && s[i + 1] == 'L')
			pos[0].push_back(i);

	int lvl = 0, ile = 0;
	while (!pos[lvl].empty())
	{
		ile += pos[lvl].size();
		for (int p : pos[lvl])
		{
			s[p] = 'L';
			if (p && s[p - 1] == 'R')
				pos[lvl + 1].push_back(p - 1);
			s[p + 1] = 'R';
			if (p < n - 1 && s[p + 1] == 'L')
				pos[lvl + 1].push_back(p + 1);
		}

		lvl++;
	}

	if (ile < k || lvl > k)
		printf("-1\n");
	else
	{
		int left = k;
		REP(i, lvl)
		{
			int taken = 0;
			while (left > lvl - i && taken < pos[i].size())
			{
				left--;
				printf("1 %d\n", pos[i][taken++]);
			}

			if (taken == pos[i].size())
				continue;

			left--;
			printf("%d ", pos[i].size() - taken);
			FOR(j, taken, pos[i].size())
				printf("%d ", pos[i][j] + 1);
			printf("\n");
		}
	}

	return 0;
}

// FOR GNU C++ use the following pattern:
// Uncomment the code below and change your main into main2
// It does not build in MS C++
// But it does increase the stack size from 256 MB on CF and uses GNU C++

//#include <Processthreadsapi.h>
//#include <iostream>
//#include <Synchapi.h>
//#include <windows.h>
//#include <process.h>
//
//DWORD WINAPI MyThreadFunction(LPVOID lpParam) {
//    main2(nullptr);
//    return 0;
//}
//int main() {
//    auto h = CreateThread(nullptr, 1024 << 20, MyThreadFunction, nullptr, STACK_SIZE_PARAM_IS_A_RESERVATION, nullptr);
//    WaitForSingleObject(h, INFINITE);
//}


#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")

#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <fstream>
#include <sstream>
#include <set>
#include <map>
#include <vector>
#include <list>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <string>
#include <queue>
#include <bitset>		//UWAGA - w czasie kompilacji musi byc znany rozmiar wektora - nie mozna go zmienic
#include <cassert>
#include <iomanip>		//do setprecision
#include <ctime>
#include <complex>
#include <chrono>
#include<unordered_map>
using namespace std;

#define FOR(i,b,e) for(int i=(b);i<(e);++i)
#define FORQ(i,b,e) for(int i=(b);i<=(e);++i)
#define FORD(i,b,e) for(int i=(b)-1;i>=(e);--i)
#define REP(x, n) for(int x = 0; x < (n); ++x)
#define ALL(u) (u).begin(),(u).end()

#define ST first
#define ND second
#define PB push_back
#define MP make_pair
#define LL long long
#define ULL unsigned LL
#define LD long double

typedef pair<int, int> PII;

const double pi = 3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342;

const int MR = 3010;
const int MS = 3e6 + 10;

char s[MR];

vector<int> prt[MS];

int main()
{
	int n, k;
	scanf("%d%d%s", &n, &k, s);
	vector<int> res;
	set<int> S;
	REP(i, n - 1)
		if (s[i] == 'R' && s[i + 1] == 'L')
			S.insert(i);

	while (!S.empty())
	{
		auto it = S.begin();
		res.push_back(*it);
		S.erase(it);

		s[res.back()] = 'L';
		if (res.back() && s[res.back() - 1] == 'R')
			S.insert(res.back() - 1);
		s[res.back() + 1] = 'R';
		if (res.back() < n - 1 && s[res.back() + 1] == 'L')
			S.insert(res.back() + 1);
	}

	if (res.size() < k)
		printf("-1\n");
	else
	{
		int left = res.size(), pos = 0, lim = n / 2;
		REP(i, k)
		{
			int ile = min(left - (k - i - 1), lim);
			REP(j, ile)
				prt[i].push_back(res[pos++]);
			left -= ile;
		}

		if (left)
			printf("-1\n");
		else
		{
			REP(i, k)
			{
				printf("%d ", prt[i].size());
				for (int j : prt[i])
					printf("%d ", j + 1);
				printf("\n");
			}
		}
	}

	return 0;
}

// FOR GNU C++ use the following pattern:
// Uncomment the code below and change your main into main2
// It does not build in MS C++
// But it does increase the stack size from 256 MB on CF and uses GNU C++

//#include <Processthreadsapi.h>
//#include <iostream>
//#include <Synchapi.h>
//#include <windows.h>
//#include <process.h>
//
//DWORD WINAPI MyThreadFunction(LPVOID lpParam) {
//    main2(nullptr);
//    return 0;
//}
//int main() {
//    auto h = CreateThread(nullptr, 1024 << 20, MyThreadFunction, nullptr, STACK_SIZE_PARAM_IS_A_RESERVATION, nullptr);
//    WaitForSingleObject(h, INFINITE);
//}


#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <string>
#include <vector>
#include<algorithm>
#include <iomanip>
using namespace std;
int n, l, r, k, t = 0, da = 0, d[10000];
char a[10000];
int main()
{
	cin >> n >> k >> a;
	l = 0;
	r = n - 1;
	vector<int>v;
	while (l < r)
	{
		l = 0;
		r = n - 1;
		if (da)
			d[da] = d[da - 1];
		while (l < r && a[l] == 'L')l++;
		while (l < r && a[r] == 'R')r--;
		if (l >= r)
			break;
		for (int i = l; i <= r; i++)
			if (i + 1 < n && a[i] == 'R' && a[i + 1] == 'L')
				d[da]++, v.push_back(i + 1), a[i] = 'L', a[i + 1] = 'R', i++;
		da++;
	}
	if (da > k || da == 0 || d[da - 1] < k)
		printf("-1");
	else
	{
		t = k - da;
		int p = 0, pp = 0;
		while (t > 0)
		{
			printf("1 %d\n", v[p]);
			p++;
			if (p == d[pp])
				t++, pp++;
			t--;
		}
		for (int i = pp; i < da; i++)
		{
			printf("%d ", d[i] - p);
			if (i)
			{
				for (; p < d[i]; p++)
					printf("%d ", v[p]);
			}
			else
			{
				for (; p < d[i]; p++)
					printf("%d ", v[p]);
			}
			cout << endl;
		}
	}
}


#include<iostream>
#include<queue>
#include<algorithm>
#include<vector>
#include<math.h>
#include<cstring>
#include<string>
#include<stack>
#include<map>
#include<set>
#include<cstdio>
#include<deque>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int INF = 1e9 * 2;
const ll LNF = 1e18;
const ll MOD = 998244353;
const int MAXN = 200'004;

vector<vector<int>> v;//크기가 최소경우
int main() {
	ios::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	int n, k;
	string s;
	cin >> n >> k >> s;
	int mcou = 0;//최대경우
	while (1) {
		vector<int> tv;
		for (int i = 0; i < n - 1; i++) {
			if (s[i] == 'R' && s[i + 1] == 'L')
				tv.push_back(i + 1);
		}
		if (tv.size() == 0)break;
		v.push_back(tv);
		mcou += tv.size();
		for (int a : tv)
			swap(s[a], s[a - 1]);
	}
	if (k<v.size() || k>mcou) {
		cout << -1;
		return 0;
	}
	int gap = k - v.size();
	for (int i = 0; i < v.size(); i++) {
		if (gap && v[i].size() > 1) {
			int time = min(gap, (int)v[i].size() - 1);//원래 1번하는걸 time회 하는거니  tiem-1번 더하는거임
			for (int j = 0; j < time; j++) {
				cout <<"1 " << v[i][j] << '\n';
			}
			cout << v[i].size() - time << ' ';
			for (int j = time; j < v[i].size(); j++)
				cout << v[i][j] << ' ';
			cout << '\n';
			gap -= time;
		}
		else {
			cout << v[i].size() << ' ';
			for (auto j : v[i])
				cout << j << ' ';
			cout << "\n";
		}
	}
}


#include <bits/stdc++.h>
using namespace std;

vector<vector<int>> v;//크기가 최소경우
int main() {
	ios::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	ll n, k;
	string s;
	cin >> n >> k >> s;
	ll mcou=0;//최대경우
	while (1) {
		vector<int> tv;
		for (int i = 1; i <= n-1; i++) {
			if (s[i-1] == 'R' && s[i ] == 'L')
				tv.push_back(i);
		}
		if (tv.empty())break;
		v.push_back(tv);
		mcou += tv.size();
		for (int a : tv)
			swap(s[a - 1],s[a]);
	}
	if (k<v.size() || k>mcou) {
		cout << -1;
		return 0;
	}
	int gap = k - v.size();
	for (auto& vec: v) {
		if (gap && vec.size() > 1) {
			int time = min(gap, (int)vec.size() - 1);//원래 1번하는걸 time회 하는거니  tiem-1번 더하는거임
			for (int j = 0; j < time; j++) {
				cout << 1 << ' ' << vec[j] << '\n';
			}
			cout << vec.size() - time << ' ';
			for (int j = time; j < vec.size(); j++)
				cout << vec[j] << ' ';
			cout << '\n';
			gap -= time;
		}
		else {
			cout << vec.size() << ' ';
			for (auto j : vec)
				cout << j << ' ';
			cout << '\n';
		}
	}
}


#include<iostream>
#include<queue>
#include<algorithm>
#include<vector>
#include<math.h>
#include<cstring>
#include<string>
#include<stack>
#include<map>
#include<set>
#include<cstdio>
#include<deque>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int INF = 1e9 * 2;
const ll LNF = 1e18;
const ll MOD = 998244353;
const int MAXN = 200'004;

vector<vector<int>> v;//크기가 최소경우
int main() {
	ios::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	int n, k;
	string s;
	int mcou;//최대경우
	while (1) {
		vector<int> tv;
		for (int i = 0; i < n-1; i++) {
			if (s[i] == 'R' && s[i + 1] == 'L')
				tv.push_back(i);
		}
		if (tv.size() == 0)break;
		v.push_back(tv);
		mcou += tv.size();
		for (int a : tv)
			swap(s[a], s[a + 1]);
	}
	if (k<v.size() || k>mcou) {
		cout << -1;
		return 0;
	}
	int gap = k - v.size();
	for (int i = 0; i < v.size(); i++) {
		if (gap && v[i].size() > 1) {
			int time = min(gap, (int)v[i].size() - 1);//원래 1번하는걸 time회 하는거니  tiem-1번 더하는거임
			for (int j = 0; j < time; j++) {
				cout << 1 << ' ' << v[i][j] << '\n';
			}
			cout << v[i].size() - time << ' ';
			for (int j = time; j < v[i].size(); j++)
				cout << v[i][j] << ' ';
			cout << '\n';
			gap -= time;
		}
		else {
			cout << v[i].size() << ' ';
			for (auto j : v[i])
				cout << j << ' ';
			cout << "\n";
		}
	}
}


#include<iostream>
#include<queue>
#include<algorithm>
#include<vector>
#include<math.h>
#include<cstring>
#include<string>
#include<stack>
#include<map>
#include<set>
#include<cstdio>
#include<deque>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int INF = 1e9 * 2;
const ll LNF = 1e18;
const ll MOD = 998244353;
const int MAXN = 200'004;

vector<vector<int>> v;//크기가 최소경우
int main() {
	ios::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	ll n, k;
	string s;
	cin >> n >> k >> s;
	ll mcou=0;//최대경우
	while (1) {
		vector<int> tv;
		for (int i = 1; i <= n-1; i++) {
			if (s[i-1] == 'R' && s[i ] == 'L')
				tv.push_back(i);
		}
		if (tv.empty())break;
		v.push_back(tv);
		mcou += tv.size();
		for (int a : tv)
			swap(s[a - 1],s[a]);
	}
	if (k<v.size() || k>mcou) {
		cout << -1;
		return 0;
	}
	int gap = k - v.size();
	for (auto& vec: v) {
		if (gap && vec.size() > 1) {
			int time = min(gap, (int)vec.size() - 1);//원래 1번하는걸 time회 하는거니  tiem-1번 더하는거임
			for (int j = 0; j < time; j++) {
				cout << 1 << ' ' << vec[j] << '\n';
			}
			cout << vec.size() - time << ' ';
			for (int j = time; j < vec.size(); j++)
				cout << vec[j] << ' ';
			cout << '\n';
			gap -= time;
		}
		else {
			cout << vec.size() << ' ';
			for (auto j : vec)
				cout << j << ' ';
			cout << '\n';
		}
	}
}


#include<iostream>
#include<queue>
#include<algorithm>
#include<vector>
#include<math.h>
#include<cstring>
#include<string>
#include<stack>
#include<map>
#include<set>
#include<cstdio>
#include<deque>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int INF = 1e9 * 2;
const ll LNF = 1e18;
const ll MOD = 998244353;
const int MAXN = 200'004;

ll n, k;
string s;
vector<vector<int>> v;//크기가 최소경우
int main() {
	ios::sync_with_stdio(0);
	cin.tie(0), cout.tie(0);

	cin >> n >> k >> s;
	ll mcou=0;//최대경우
	while (1) {
		vector<int> tv;
		for (int i = 1; i <= n-1; i++) {
			if (s[i-1] == 'R' && s[i] == 'L')
				tv.push_back(i);
		}
		if (tv.empty())break;
		v.push_back(tv);
		mcou += tv.size();
		for (int a : tv)
			swap(s[a - 1],s[a]);
	}
	if (k<v.size() || k>mcou) {
		cout << -1;
		return 0;
	}
	int gap = k - v.size();

	//for (auto& vec: v) {
	//	if (gap && vec.size() > 1) {
	//		int time = min(gap, (int)vec.size() - 1);//원래 1번하는걸 time회 하는거니  tiem-1번 더하는거임
	//		for (int j = 0; j < time; j++) {
	//			cout << 1 << ' ' << vec[j] << '\n';
	//		}
	//		cout << vec.size() - time << ' ';
	//		for (int j = time; j < vec.size(); j++)
	//			cout << vec[j] << ' ';
	//		cout << '\n';
	//		gap -= time;
	//	}
	//	else {
	//		cout << vec.size() << ' ';
	//		for (auto j : vec)
	//			cout << j << ' ';
	//		cout << '\n';
	//	}
	//}
	for (auto& vec : v)
	{
		if (gap && vec.size() > 1)
		{
			int tmp = min(gap, (int)vec.size() - 1);
			for (int i = 0; i < tmp; i++)
			{
				cout << "1 " << vec[i] << '\n';
			}

			cout << vec.size() - tmp << ' ';
			for (int i = tmp; i < vec.size(); i++)
				cout << vec[i] << ' ';
			cout << '\n';

			gap -= tmp;
		}
		else
		{
			cout << vec.size() << ' ';
			for (auto i : vec)
				cout << i << ' ';
			cout << '\n';
		}
	}
}


#include<iostream>
#include<queue>
#include<algorithm>
#include<vector>
#include<math.h>
#include<cstring>
#include<string>
#include<stack>
#include<map>
#include<set>
#include<cstdio>
#include<deque>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int INF = 1e9 * 2;
const ll LNF = 1e18;
const ll MOD = 998244353;
const int MAXN = 200'004;

ll n, k;
string s;
vector<vector<int>> v;//크기가 최소경우
int main() {
	ios::sync_with_stdio(0);
	cin.tie(0), cout.tie(0);

	cin >> n >> k >> s;
	ll mcou=0;//최대경우
	while (1) {
		vector<int> tv;
		for (int i = 1; i <= n-1; i++) {
			if (s[i-1] == 'R' && s[i] == 'L')
				tv.push_back(i);
		}
		if (tv.empty())break;
		v.push_back(tv);
		mcou += tv.size();
		for (int a : tv)
			swap(s[a - 1],s[a]);
	}
	if (k<v.size() || k>mcou) {
		cout << -1;
		return 0;
	}
	int gap = k - v.size();

	//for (auto& vec: v) {
	//	if (gap && vec.size() > 1) {
	//		int time = min(gap, (int)vec.size() - 1);//원래 1번하는걸 time회 하는거니  tiem-1번 더하는거임
	//		for (int j = 0; j < time; j++) {
	//			cout << 1 << ' ' << vec[j] << '\n';
	//		}
	//		cout << vec.size() - time << ' ';
	//		for (int j = time; j < vec.size(); j++)
	//			cout << vec[j] << ' ';
	//		cout << '\n';
	//		gap -= time;
	//	}
	//	else {
	//		cout << vec.size() << ' ';
	//		for (auto j : vec)
	//			cout << j << ' ';
	//		cout << '\n';
	//	}
	//}
	for (auto& vec : v)
	{
		if (gap && vec.size() > 1)
		{
			int tmp = min(gap, (int)vec.size() - 1);
			for (int i = 0; i < tmp; i++)
			{
				cout << "1 " << vec[i] << '\n';
			}

			cout << vec.size() - tmp << ' ';
			for (int i = tmp; i < vec.size(); i++)
				cout << vec[i] << ' ';
			cout << '\n';

			sub -= tmp;
		}
		else
		{
			cout << vec.size() << ' ';
			for (auto i : vec)
				cout << i << ' ';
			cout << '\n';
		}
	}
}


#include<iostream>
#include<queue>
#include<algorithm>
#include<vector>
#include<math.h>
#include<cstring>
#include<string>
#include<stack>
#include<map>
#include<set>
#include<cstdio>
#include<deque>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int INF = 1e9 * 2;
const ll LNF = 1e18;
const ll MOD = 998244353;
const int MAXN = 200'004;

ll n, k;
string s;
vector<vector<int>> v;//크기가 최소경우
int main() {
	ios::sync_with_stdio(0);
	cin.tie(0), cout.tie(0);

	cin >> n >> k >> s;
	ll mcou=0;//최대경우
	while (1) {
		vector<int> tv;
		for (int i = 1; i <= n-1; i++) {
			if (s[i-1] == 'R' && s[i] == 'L')
				tv.push_back(i);
		}
		if (tv.empty())break;
		v.push_back(tv);
		mcou += tv.size();
		for (int a : tv)
			swap(s[a - 1],s[a]);
	}
	if (k<v.size() || k>mcou) {
		cout << -1;
		return 0;
	}
	int gap = k - v.size();

	for (auto& vec: v) {
		if (gap && vec.size() > 1) {
			int time = min(gap, (int)vec.size() - 1);//원래 1번하는걸 time회 하는거니  tiem-1번 더하는거임
			for (int j = 0; j < time; j++) {
				cout << "1 "<< vec[j] << '\n';
			}
			cout << vec.size() - time << ' ';
			for (int j = time; j < vec.size(); j++)
				cout << vec[j] << ' ';
			cout << '\n';
			gap -= time;
		}
		else {
			cout << vec.size() << ' ';
			for (auto j : vec)
				cout << j << ' ';
			cout << '\n';
		}
	}

}


#include<iostream>
#include<queue>
#include<algorithm>
#include<vector>
#include<math.h>
#include<cstring>
#include<string>
#include<stack>
#include<map>
#include<set>
#include<cstdio>
#include<deque>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int INF = 1e9 * 2;
const ll LNF = 1e18;
const ll MOD = 998244353;
const int MAXN = 200'004;

vector<vector<int>> v;//크기가 최소경우
int main() {
	ios::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	ll n, k;
	string s;
	cin >> n >> k >> s;
	ll mcou=0;//최대경우
	while (1) {
		vector<int> tv;
		for (int i = 0; i < n-1; i++) {
			if (s[i] == 'R' && s[i + 1] == 'L')
				tv.push_back(i+1);
		}
		if (tv.size() == 0)break;
		v.push_back(tv);
		mcou += tv.size();
		for (int a : tv)
			swap(s[a], s[a - 1]);
	}
	if (k<v.size() || k>mcou) {
		cout << -1;
		return 0;
	}
	int gap = k - v.size();
	for (int i = 0; i < v.size(); i++) {
		if (gap && v[i].size() > 1) {
			int time = min(gap, (int)v[i].size() - 1);//원래 1번하는걸 time회 하는거니  tiem-1번 더하는거임
			for (int j = 0; j < time; j++) {
				cout << 1 << ' ' << v[i][j] << '\n';
			}
			cout << v[i].size() - time << ' ';
			for (int j = time; j < v[i].size(); j++)
				cout << v[i][j] << ' ';
			cout << '\n';
			gap -= time;
		}
		else {
			cout << v[i].size() << ' ';
			for (auto j : v[i])
				cout << j << ' ';
			cout << "\n";
		}
	}
}


#include<iostream>
#include<queue>
#include<algorithm>
#include<vector>
#include<math.h>
#include<cstring>
#include<string>
#include<stack>
#include<map>
#include<set>
#include<cstdio>
#include<deque>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int INF = 1e9 * 2;
const ll LNF = 1e18;
const ll MOD = 998244353;
const int MAXN = 200'004;

ll n, k;
string s;
vector <vector <int> > ans;

int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0), cout.tie(0);

	cin >> n >> k;
	cin >> s;

	ll cnt = 0;
	while (true)
	{
		vector <int> res;
		for (int i = 1; i < s.size(); i++)
		{
			if (s[i - 1] == 'R' && s[i] == 'L')
				res.push_back(i);
		}

		if (res.empty()) break;

		ans.push_back(res);
		cnt += res.size();

		for (int i : res) swap(s[i - 1], s[i]);
	}

	if (k < ans.size() || k > cnt)
	{
		cout << -1;
		return 0;
	}

	int sub = k - ans.size();
	for (auto& vec : ans)
	{
		if (sub && vec.size() > 1)
		{
			int tmp = min(sub, (int)vec.size() - 1);
			for (int i = 0; i < tmp; i++)
			{
				cout << "1 " << vec[i] << '\n';
			}

			cout << vec.size() - tmp << ' ';
			for (int i = tmp; i < vec.size(); i++)
				cout << vec[i] << ' ';
			cout << '\n';

			sub -= tmp;
		}
		else
		{
			cout << vec.size() << ' ';
			for (auto i : vec)
				cout << i << ' ';
			cout << '\n';
		}
	}
}


#include<iostream>
#include<queue>
#include<algorithm>
#include<vector>
#include<math.h>
#include<cstring>
#include<string>
#include<stack>
#include<map>
#include<set>
#include<cstdio>
#include<deque>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int INF = 1e9 * 2;
const ll LNF = 1e18;
const ll MOD = 998244353;
const int MAXN = 200'004;

vector<vector<int>> v;//크기가 최소경우
int main() {
	ios::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	ll n, k;
	string s;
	cin >> n >> k >> s;
	ll mcou=0;//최대경우
	while (1) {
		vector<int> tv;
		for (int i = 1; i <= n-1; i++) {
			if (s[i-1] == 'R' && s[i ] == 'L')
				tv.push_back(i);
		}
		if (tv.size() == 0)break;
		v.push_back(tv);
		mcou += tv.size();
		for (int a : tv)
			swap(s[a], s[a - 1]);
	}
	if (k<v.size() || k>mcou) {
		cout << -1;
		return 0;
	}
	int gap = k - v.size();
	for (auto& vec: v) {
		if (gap && vec.size() > 1) {
			int time = min(gap, (int)vec.size() - 1);//원래 1번하는걸 time회 하는거니  tiem-1번 더하는거임
			for (int j = 0; j < time; j++) {
				cout << 1 << ' ' << vec[j] << '\n';
			}
			cout << vec.size() - time << ' ';
			for (int j = time; j < vec.size(); j++)
				cout << vec[j] << ' ';
			cout << '\n';
			gap -= time;
		}
		else {
			cout << vec.size() << ' ';
			for (auto j : vec)
				cout << j << ' ';
			cout << "\n";
		}
	}
}


#include<iostream>
#include<queue>
#include<algorithm>
#include<vector>
#include<math.h>
#include<cstring>
#include<string>
#include<stack>
#include<map>
#include<set>
#include<cstdio>
#include<deque>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int INF = 1e9 * 2;
const ll LNF = 1e18;
const ll MOD = 998244353;
const int MAXN = 200'004;

vector<vector<int>> v;//
int main() {
	ios::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	int n, k;
	string s;
	cin >> n >> k >> s;
	int mcou = 0;//최대경우
	while (1) {
		vector<int> tv;
		for (int i = 0; i < n - 1; i++) {
			if (s[i] == 'R' && s[i + 1] == 'L')
				tv.push_back(i + 1);
		}
		if (tv.size() == 0)break;
		v.push_back(tv);
		mcou += tv.size();
		for (int a : tv)
			swap(s[a], s[a - 1]);
	}
	if (k<v.size() || k>mcou) {
		cout << -1;
		return 0;
	}
	int gap = k - v.size();
	for (int i = 0; i < v.size(); i++) {
		if (gap && v[i].size() > 1) {
			int time = min(gap, (int)v[i].size() - 1);//원래 1번하는걸 time회 하는거니  tiem-1번 더하는거임
			for (int j = 0; j < time; j++) {
				cout <<"1 " << v[i][j] << '\n';
			}
			cout << v[i].size() - time << ' ';
			for (int j = time; j < v[i].size(); j++)
				cout << v[i][j] << ' ';
			cout << '\n';
			gap -= time;
		}
		else {
			cout << v[i].size() << ' ';
			for (auto j : v[i])
				cout << j << ' ';
			cout << "\n";
		}
	}
}


#include<iostream>
#include<queue>
#include<algorithm>
#include<vector>
#include<math.h>
#include<cstring>
#include<string>
#include<stack>
#include<map>
#include<set>
#include<cstdio>
#include<deque>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int INF = 1e9 * 2;
const ll LNF = 1e18;
const ll MOD = 998244353;
const int MAXN = 200'004;

vector<vector<int>> v;//크기가 최소경우
int main() {
	ios::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	int n, k;
	string s;
	cin >> n >> k >> s;
	int mcou=0;//최대경우
	while (1) {
		vector<int> tv;
		for (int i = 0; i < n-1; i++) {
			if (s[i] == 'R' && s[i + 1] == 'L')
				tv.push_back(i+1);
		}
		if (tv.size() == 0)break;
		v.push_back(tv);
		mcou += tv.size();
		for (int a : tv)
			swap(s[a], s[a - 1]);
	}
	if (k<v.size() || k>mcou) {
		cout << -1;
		return 0;
	}
	int gap = k - v.size();
	for (int i = 0; i < v.size(); i++) {
		if (gap && v[i].size() > 1) {
			int time = min(gap, (int)v[i].size() - 1);//원래 1번하는걸 time회 하는거니  tiem-1번 더하는거임
			for (int j = 0; j < time; j++) {
				cout << 1 << ' ' << v[i][j] << '\n';
			}
			cout << v[i].size() - time << ' ';
			for (int j = time; j < v[i].size(); j++)
				cout << v[i][j] << ' ';
			cout << '\n';
			gap -= time;
		}
		else {
			cout << v[i].size() << ' ';
			for (auto j : v[i])
				cout << j << ' ';
			cout << "\n";
		}
	}
}


#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<queue>
#include<cmath>
#include<stack>
#include<chrono>
#include<random>
#include<cerrno>
#include<cfenv>

typedef long long ll;
typedef double long dl;
using namespace std;

const ll mod = 1000000007;
const dl pi = std::acos(-1);

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	int n, k;
	cin >> n >> k;
	vector<char>s(n + 1);
	for (int i = 1; i <= n; i += 1) {
		cin >> s[i];
	}
	deque<vector<int>>simulation;
	int minx = 0, maxx = 0;
	while (true) {
		vector<int>alpha;
		for (int i = 2; i <= n; i += 1) {
			if (s[i] == 'L' && s[i - 1] == 'R') {
				maxx += 1;
				alpha.push_back(i - 1);
			}
		}
		for (int x : alpha) {
			swap(s[x], s[x + 1]);
		}
		if (alpha.empty()) {
			break;
		}
		minx += 1;
		simulation.push_back(alpha);
	}
	if (minx > k || k > maxx) {
		cout << -1 << "\n";
		return 0;
	}
	int extra = k - minx;
	while (extra) {
		cout << "1 " << simulation.front().back() << "\n";
		simulation.front().pop_back();
		if (simulation.front().empty()) {
			simulation.pop_front();
			continue;
		}
		extra -= 1;
	}
	for (auto x : simulation) {
		cout << x.size() << " ";
		for (int y : x) {
			cout << y << " ";
		}
		cout << "\n";
	}
}


#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <algorithm>
#include <queue>
#include <cstring>
#include <set>
#include <map>
using namespace std;
typedef long long LL;
const int inf = 0x3f3f3f3f;
const int maxn = 1e7 + 10;
vector <int> vt[maxn];
bool isok(const string &s) {
	for(int i = 0; i < s.length() - 1; i++) {
		if(s[i] == 'R' && s[i + 1] == 'L') {
			return false;
		}
	}
	return true;
}
char s[3010];
int main()
{
	int n, k;
	scanf("%d%d", &n, &k);
	for(int i = 0; i <= n * n; i++) {
		vt[i].clear();
	}
	scanf("%s", s);
	int minn = 1, maxx = 0;
	while(!isok(s)) {
		for(int i = 0; i < n - 1; i++) {
			if(s[i] == 'R' && s[i + 1] == 'L') {
				vt[minn].push_back(i);
				s[i] = 'L', s[i + 1] = 'R';
				i++;
			}
		}
		maxx += vt[minn++].size();
	}
	if(k < minn - 1 || k > maxx || minn == 1) {
		printf("-1\n");
	}
	else{
		int i = 1, j;
		while(1) {
			if(vt[i].size() == 0) break;
			if(maxx - vt[i].size() >= (k - 1)) {
				int res = vt[i].size();
				printf("%d ", res);
				for(j = 0; j < res; j++) {
					printf("%d ", vt[i][j] + 1);
				}
				printf("\n");
				maxx -= vt[i].size();
				k--;
				i++;
			}
			else{
				int tmp = maxx - (k - 1);
				printf("%d ", tmp);
				for(j = 0; j < tmp; j++) {
					printf("%d ",vt[i][j] + 1);
				}
				printf("\n");
				k--;
				j = tmp;
				while(k--) {
					printf("1 %d\n", vt[i][j] + 1);
					j++;
					if(j >= vt[i].size()) {
						j = 0;
						i++;
					}
				}
				break;
			}
		}
	}

	return 0;
}


#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <algorithm>
#include <queue>
#include <cstring>
#include <set>
#include <map>
using namespace std;
typedef long long LL;
const int inf = 0x3f3f3f3f;
const int maxn = 1e7 + 10;
vector <int> vt[maxn];
struct node{
	int x, k;
};
int main()
{
	int n, k;
	cin >> n >> k;
	for(int i = 0; i <= n * n; i++) {
		vt[i].clear();
	}
	string s;
	cin >> s;
	int minn = 0, maxx = 0;
	queue <node> q;
	for(int i = 0; i < n - 1; i++) {
		if(s[i] == 'R' && s[i + 1] == 'L') {
			q.push({i, 1});
			s[i] = 'L', s[i + 1] = 'R';
		}
	}
	while(!q.empty()) {
		node now = q.front();
		cout << now.x + 1 << endl;
		vt[now.k].push_back(now.x);
		q.pop();
		minn = max(minn, now.k);
		if(s[now.x + 2] == 'L' && now.x + 2 < n) {
			q.push({now.x + 1, now.k + 1});
			s[now.x + 1] = 'L', s[now.x + 2] = 'R';
		}
	}

	for(int i = 1; i <= minn; i++) {
		maxx += vt[i].size();
	}
	if(k < minn || k > maxx || minn == 0) {
		cout << -1 << endl;
	}
	else{
		int tmp = k;
		int i = 1;
		while(1) {
			if(i > minn) break;
			if(maxx - vt[i].size() >= tmp - 1) {
				cout << vt[i].size() << " ";
				for(int j = 0; j < vt[i].size(); j++) {
					cout << vt[i][j] + 1 << " ";
				}
				cout << endl;
				tmp--;
				maxx -= vt[i].size();
				i++;
			}
			else{
				cout << maxx - (tmp - 1) << " ";
				for(int j = 0; j < maxx - (tmp - 1); j++) {
					cout << vt[i][j] + 1 << " ";
				}
				cout << endl;
				int j = maxx - (tmp - 1);
				tmp--;
				while(tmp--) {
					cout << 1 << " " << vt[i][j] + 1 << endl;
					j++;
					if(j >= vt[i].size()){
						j = 0;
						i++;
					}
				}
				break;
			}
		}
	}
	return 0;
}


#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <algorithm>
#include <queue>
#include <cstring>
#include <set>
#include <map>
using namespace std;
typedef long long LL;
const int inf = 0x3f3f3f3f;
const int maxn = 1e7 + 10;
vector <int> vt[maxn];
struct node{
	int x, k;
};
int main()
{
	int n, k;
	cin >> n >> k;
	for(int i = 0; i <= n * n; i++) {
		vt[i].clear();
	}
	string s;
	cin >> s;
	int minn = 0, maxx = 0;
	queue <node> q;
	for(int i = 0; i < n - 1; i++) {
		if(s[i] == 'R' && s[i + 1] == 'L') {
			q.push({i, 1});
			s[i] = 'L', s[i + 1] = 'R';
		}
	}
	while(!q.empty()) {
		node now = q.front();
		vt[now.k].push_back(now.x);
		q.pop();
		minn = max(minn, now.k);
		if(s[now.x + 2] == 'L' && now.x + 2 < n) {
			q.push({now.x + 1, now.k + 1});
			s[now.x + 1] = 'L', s[now.x + 2] = 'R';
		}
	}

	for(int i = 1; i <= minn; i++) {
		maxx += vt[i].size();
	}
	if(k < minn || k > maxx || minn == 0) {
		cout << -1 << endl;
	}
	else{
		int tmp = k;
		int i = 1;
		while(1) {
			if(i > minn) break;
			if(maxx - vt[i].size() >= tmp - 1) {
				cout << vt[i].size() << " ";
				for(int j = 0; j < vt[i].size(); j++) {
					cout << vt[i][j] + 1 << " ";
				}
				cout << endl;
				tmp--;
				maxx -= vt[i].size();
				i++;
			}
			else{
				cout << maxx - (tmp - 1) << " ";
				for(int j = 0; j < maxx - (tmp - 1); j++) {
					cout << vt[i][j] + 1 << " ";
				}
				cout << endl;
				int j = maxx - (tmp - 1);
				tmp--;
				while(tmp--) {
					cout << 1 << " " << vt[i][j] + 1 << endl;
					j++;
					if(j >= vt[i].size()){
						j = 0;
						i++;
					}
				}
				break;
			}
		}
	}
	return 0;
}


#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <algorithm>
#include <queue>
#include <cstring>
#include <set>
#include <map>
using namespace std;
typedef long long LL;
const int inf = 0x3f3f3f3f;
const int maxn = 1e7 + 10;
vector <int> vt[maxn];
struct node{
	int x, k;
};
int main()
{
	int n, k;
	cin >> n >> k;
	for(int i = 0; i <= n * n; i++) {
		vt[i].clear();
	}
	string s;
	cin >> s;
	int minn = 0, maxx = 0;
	queue <node> q;
	for(int i = 0; i < n - 1; i++) {
		if(s[i] == 'R' && s[i + 1] == 'L') {
			q.push({i, 1});
			s[i] = 'L', s[i + 1] = 'R';
		}
	}
	while(!q.empty()) {
		node now = q.front();
		vt[now.k].push_back(now.x);
		q.pop();
		minn = max(minn, now.k);
		if(s[now.x + 2] == 'L' && now.x + 2 < n) {
			q.push({now.x + 1, now.k + 1});
			s[now.x + 1] = 'L', s[now.x + 2] = 'R';
		}
		if(s[now.x - 1] == 'R' && now.x - 1 >= 0) {
			q.push({now.x - 1, now.k + 1});
			s[now.x - 1] = 'L', s[now.x] = 'R';
		}
	}

	for(int i = 1; i <= minn; i++) {
		maxx += vt[i].size();
	}
	if(k < minn || k > maxx || minn == 0) {
		cout << -1 << endl;
	}
	else{
		int tmp = k;
		int i = 1;
		while(1) {
			if(i > minn) break;
			if(maxx - vt[i].size() >= tmp - 1) {
				cout << vt[i].size() << " ";
				for(int j = 0; j < vt[i].size(); j++) {
					cout << vt[i][j] + 1 << " ";
				}
				cout << endl;
				tmp--;
				maxx -= vt[i].size();
				i++;
			}
			else{
				cout << maxx - (tmp - 1) << " ";
				for(int j = 0; j < maxx - (tmp - 1); j++) {
					cout << vt[i][j] + 1 << " ";
				}
				cout << endl;
				int j = maxx - (tmp - 1);
				tmp--;
				while(tmp--) {
					cout << 1 << " " << vt[i][j] + 1 << endl;
					j++;
					if(j >= vt[i].size()){
						j = 0;
						i++;
					}
				}
				break;
			}
		}
	}
	return 0;
}


#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <algorithm>
#include <queue>
#include <cstring>
#include <set>
#include <map>
using namespace std;
typedef long long LL;
const int inf = 0x3f3f3f3f;
const int maxn = 1e7 + 10;
vector <int> vt[maxn];
bool isok(const string &s) {
	for(int i = 0; i < s.length() - 1; i++) {
		if(s[i] == 'R' && s[i + 1] == 'L') {
			return false;
		}
	}
	return true;
}

int main()
{
	int n, k;
	cin >> n >> k;
	for(int i = 0; i <= n * n; i++) {
		vt[i].clear();
	}
	string s;
	cin >> s;
	int minn = 1, maxx = 0;
	while(!isok(s)) {
		for(int i = 0; i < n - 1; i++) {
			if(s[i] == 'R' && s[i + 1] == 'L') {
				vt[minn].push_back(i);
				s[i] = 'L', s[i + 1] = 'R';
			}
		}
		maxx += vt[minn++].size();
	}
	if(k < minn - 1 || k > maxx || minn == 1) {
		cout << -1 << endl;
	}
	else{
		int i = 1, j;
		while(1) {
			if(vt[i].size() == 0) break;
			if(maxx - vt[i].size() >= (k - 1)) {
				cout << vt[i].size() << " ";
				for(j = 0; j < vt[i].size(); j++) {
					cout << vt[i][j] + 1 << " ";
				}
				cout << endl;
				maxx -= vt[i].size();
				k--;
				i++;
			}
			else{
				int tmp = maxx - (k - 1);
				cout << tmp << " ";
				for(j = 0; j < tmp; j++) {
					cout << vt[i][j] + 1 << " ";
				}
				cout << endl;
				k--;
				j = tmp;
				while(k--) {
					cout << 1 << " " << vt[i][j] + 1 << endl;
					j++;
					if(j >= vt[i].size()) {
						j = 0;
						i++;
					}
				}
				break;
			}
		}
	}

	return 0;
}


#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <algorithm>
#include <queue>
#include <cstring>
#include <set>
#include <map>
using namespace std;
typedef long long LL;
const int inf = 0x3f3f3f3f;
const int maxn = 1e7 + 10;
vector <int> vt[maxn];
bool isok(const string &s) {
	for(int i = 0; i < s.length() - 1; i++) {
		if(s[i] == 'R' && s[i + 1] == 'L') {
			return false;
		}
	}
	return true;
}

int main()
{
	int n, k;
	cin >> n >> k;
	for(int i = 0; i <= n * n; i++) {
		vt[i].clear();
	}
	string s;
	cin >> s;
	int minn = 1, maxx = 0;
	while(!isok(s)) {
		for(int i = 0; i < n - 1; i++) {
			if(s[i] == 'R' && s[i + 1] == 'L') {
				vt[minn].push_back(i);
				s[i] = 'L', s[i + 1] = 'R';
				i++;
			}
		}
		maxx += vt[minn++].size();
	}
	if(k < minn - 1 || k > maxx || minn == 1) {
		cout << -1 << endl;
	}
	else{
		int i = 1, j;
		while(1) {
			if(vt[i].size() == 0) break;
			if(maxx - vt[i].size() >= (k - 1)) {
				cout << vt[i].size() << " ";
				for(j = 0; j < vt[i].size(); j++) {
					cout << vt[i][j] + 1 << " ";
				}
				cout << endl;
				maxx -= vt[i].size();
				k--;
				i++;
			}
			else{
				int tmp = maxx - (k - 1);
				cout << tmp << " ";
				for(j = 0; j < tmp; j++) {
					cout << vt[i][j] + 1 << " ";
				}
				cout << endl;
				k--;
				j = tmp;
				while(k--) {
					cout << 1 << " " << vt[i][j] + 1 << endl;
					j++;
					if(j >= vt[i].size()) {
						j = 0;
						i++;
					}
				}
				break;
			}
		}
	}

	return 0;
}


#include"stdio.h"
#include"string.h"
#include"stack"
#include"map"
#include"math.h"
#include"iostream"
#include"vector"
#include"queue"
#include"algorithm"
using namespace std;
#define OK printf("\n");
#define Debug printf("this_ok\n");
#define inf 1e9
#define INF 1e18
typedef long long ll;
#define scanll(a,b) scanf("%lld%lld",&a,&b);
#define scanl(a) scanf("%lld",&a);
#define printl(a,b) if(b == 0) printf("%lld ",a); else printf("%lld\n",a);
#define print_int(a,b) if(b == 0) printf("%d ",a); else printf("%d\n",a);
typedef pair<int,int> PII;

inline int read(){
    int s = 0, w = 1; char ch = getchar();
    while(ch < '0' || ch > '9')   { if(ch == '-') w = -1; ch = getchar(); }
    while(ch >= '0' && ch <= '9') { s = (s << 3) + (s << 1) + (ch ^ 48); ch = getchar(); }
    return s * w;
}
const ll mod = 998244353;
const int N = 300100;
int n,m,len,k;
char str[N];
vector<int> G[3010];
int main()
{
   n = read(); k = read();
   scanf("%s",str + 1);
   int cnt = 1;
   int sum = 0;
   while(1){
      int mark = 0;
      for(int i = 1; i < n; i ++){
        if(str[i] == 'R' && str[i + 1] == 'L') {
            G[cnt].push_back(i);
            swap(str[i],str[i + 1]);
            i ++; mark = 1;
        }
      }
      if(mark == 0) {
        break;
      }
      sum += G[cnt].size();
   //   printf("cnt = %d G = %d\n",cnt,G[cnt].size());
      cnt ++;
   }
  // printf("sum = %d\n",sum);
   if(k > sum || k < cnt - 1) {
      printf("-1\n"); return 0;
   } else {

       cnt --;
       int id = 1; int c = 0;
       while(id <= cnt) {
           if(k == cnt) {
              while(id <= cnt){
                        printf("%d",G[id].size());
                        for(int j = 0; j < G[id].size(); j ++)
                            printf(" %d",G[id][j]); OK
                        id ++;
                    } return 0;
           }
           for(int i = 0; i < G[id].size(); i ++){
              printf("1 %d\n",G[id][i]); c ++;
              if(G[id].size() - 1 != i){
                 if(c + 1 + cnt - id == k) {
                    printf("%d",G[id].size() - (i + 1));
                    for(int j = i + 1; j < G[id].size(); j ++)
                       printf(" %d",G[id][j]); OK
                    id ++;
                    while(id <= cnt){
                        printf("%d",G[id].size());
                        for(int j = 0; j < G[id].size(); j ++)
                            printf(" %d",G[id][j]); OK
                        id ++;
                    } return 0;
                 }
              } else if(c + cnt - id == k){
                   id ++;
                    while(id <= cnt){
                        printf("%d",G[id].size());
                        for(int j = 0; j < G[id].size(); j ++)
                            printf(" %d",G[id][j]); OK
                        id ++;
                    } return 0;
              }
           }
           id ++;
       }
   }
}


#include<iostream>
#include<vector>
#include<string>
#include<algorithm>

using lli = long long int;

using namespace std;

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);

	int n, k;
	cin >> n >> k;

	string s;
	vector<int> A;
	cin >> s;
	for (auto i : s) {
		A.push_back(i == 'L' ? 0 : 1);
	}

	int zeros = 0;
	int ones = 0;

	int initsum = 0;

	for (int i = 0; i < n; i++) {
		if (A[i] == 0){
			zeros++;
			initsum += i;
		}
	}

	int lastsum = (zeros * (zeros - 1)) / 2;

	if (k > initsum - lastsum) {
		cout << -1 << endl;
		return 0;
	}

	vector<vector<int>> it;

	it.resize(1);
	for (int i = 0; i < n - 1; i++) {
		if (A[i] == 1 && A[i + 1] == 0) it[0].push_back(i);
	}

	for (int pass = 0; pass < it.size(); pass++) {
		if (it[pass].size() == 0) {
			it.resize(pass);
			break;
		}
		sort(it[pass].begin(), it[pass].end());
		it[pass].erase(unique(it[pass].begin(), it[pass].end()), it[pass].end());
		it.resize(pass + 2);
		for (auto i : it[pass]) {
			A[i] = 0;
			A[i + 1] = 1;

			if (i >= 1 && A[i - 1] == 1) {
				it[pass + 1].push_back(i - 1);
			}
			if (i < n - 2 && A[i + 2] == 0) {
				 it[pass + 1].push_back(i + 1);
			}
		}

	}
	int predict = it.size();

	if (k < predict) {
		cout << -1 << endl;
		return 0;
	}

	for (int pass = 0; pass < it.size(); pass++) {
		int preprinted = 0;
		while (k - predict > 0 && preprinted + 1 < it[pass].size()) {
			cout << 1 << ' ' << it[pass][preprinted] + 1 << '\n';
			preprinted += 1;
			predict += 1;
		}

		string line;
		line+=to_string(it[pass].size() - preprinted) +' ';

		for (int i = preprinted; i < it[pass].size(); i++) {
			line+=to_string(it[pass][i] + 1) + ' ';
		}
		cout << line<<'\n';

	}

}


#include<iostream>
#include<vector>
#include<string>
#include<algorithm>

using lli = long long int;

using namespace std;

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);

	int n, k;
	cin >> n >> k;

	string s;
	vector<int> A;
	cin >> s;
	for (auto i : s) {
		A.push_back(i == 'L' ? 0 : 1);
	}

	int zeros = 0;
	int ones = 0;

	int initsum = 0;

	for (int i = 0; i < n; i++) {
		if (A[i] == 0){
			zeros++;
			initsum += i;
		}
	}

	int lastsum = (zeros * (zeros - 1)) / 2;

	if (k > initsum - lastsum) {
		cout << -1 << endl;
		return 0;
	}

	vector<vector<int>> it;

	it.resize(1);
	for (int i = 0; i < n - 1; i++) {
		if (A[i] == 1 && A[i + 1] == 0) it[0].push_back(i);
	}

	for (int pass = 0; pass < it.size(); pass++) {
		if (it[pass].size() == 0) {
			it.resize(pass);
			break;
		}
		sort(it[pass].begin(), it[pass].end());
		it[pass].erase(unique(it[pass].begin(), it[pass].end()), it[pass].end());
		it.resize(pass + 2);
		for (auto i : it[pass]) {
			A[i] = 0;
			A[i + 1] = 1;

			if (i >= 1 && A[i - 1] == 1) {
				it[pass + 1].push_back(i - 1);
			}
			if (i < n - 2 && A[i + 2] == 0) {
				it[pass + 1].push_back(i + 1);
			}
		}

	}
	int predict = it.size();

	if (k < predict) {
		cout << -1 << endl;
		return 0;
	}

	for (int pass = 0; pass < it.size(); pass++) {
		int preprinted = 0;
		while (k - predict > 0 && preprinted + 1 < it[pass].size()) {
			cout << 1 << ' ' << it[pass][preprinted] + 1 << '\n';
			preprinted += 1;
			predict += 1;
		}
		cout << it[pass].size() - preprinted << ' ';

		for (int i = preprinted; i < it[pass].size(); i++) {
			cout << it[pass][i] + 1 << ' ';
		}
		cout << '\n';

	}

}


#include<iostream>
#include<vector>
#include<string>
#include<algorithm>

using lli = long long int;

using namespace std;

int main() {
	int n, k;
	cin >> n >> k;

	string s;
	vector<int> A;
	cin >> s;
	for (auto i : s) {
		A.push_back(i == 'L' ? 0 : 1);
	}

	int zeros = 0;
	int ones = 0;

	lli initsum = 0;

	for (int i = 0; i < n;i++) {
		if (A[i] == 0) zeros++;
		if (A[i] == 1) ones++;

		if (A[i] == 0) {
			initsum += i;
		}
	}

	lli lastsum = ((lli)zeros * (zeros -1)) / 2;

	if (k > initsum - lastsum) {
		cout << -1 << endl;
		return 0;
	}

	vector<vector<int>> it;

	it.resize(1);
	for (int i = 0; i < n; i++) {
		if (A[i] == 1 && A[i+1] == 0) it[0].push_back(i);
	}

	for (int pass = 0; pass <= it.size(); pass++) {
		if (it[pass].size() == 0) {
			it.resize(pass);
			break;
		}

		sort(it[pass].begin(), it[pass].end());
		it[pass].erase(unique(it[pass].begin(), it[pass].end()),it[pass].end());
		it.resize(pass + 2);

		for (auto i : it[pass]) {
			A[i] = 0;
			A[i + 1] = 1;

			if (i >= 1 && A[i - 1] == 1) {
				it[pass + 1].push_back(i - 1);
			}
			if (i<n-2 && A[i + 2] == 0) {
				it[pass + 1].push_back(i + 1);
			}
		}
	}
	int predict = it.size();

	if (k < it.size()) {
		cout << -1 << endl;
		return 0;
	}

	for (int pass = 0; pass < it.size(); pass++) {
		int preprinted = 0;
		while (k - predict > 0 && preprinted + 1 < it[pass].size()) {
			cout << 1 << ' ' << it[pass][preprinted]+1 << '\n';
			preprinted += 1;
			predict += 1;
		}
		cout << it[pass].size() - preprinted << ' ';

		for (int i = preprinted; i < it[pass].size(); i++) {
			cout << it[pass][i]+1 << ' ';
		}
		cout << '\n';

	}

}