#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;

	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;
		}

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

		}

		it.resize(pass + 2);
		for (int i = 0; i < n - 1; i++) {
			if (A[i] == 1 && A[i + 1] == 0) it[pass + 1].push_back(i);
		}
	}
	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;
		}

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

		}

		it.resize(pass + 2);
		for (int i = 0; i < n - 1; i++) {
			if(A[i]==1 && A[i+1]==0) it[pass + 1].push_back(i);
		}
	}
	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() {
	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 "+to_string(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() {
	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() {
	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) {
				if (it[pass + 1].size()>0 && *it[pass + i].rbegin() != i - 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);
			}
			*/
		}
		for (int i = 0; i < n - 1; i++) {
			if(A[i]==1 && A[i+1]==0) it[pass + 1].push_back(i);
		}
	}
	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';

	}

}


#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';

	}

}


#include<cstdio>
#include<cstring>
#include<cmath>
#include<iostream>
#include<algorithm>
#include<stack>
#include<queue>
#include<string>
#include<vector>
#include<map>
#include<set>
#define fi first
#define se second
#define INIT() std::ios::sync_with_stdio(false)
using namespace std;
typedef long long ll;
const int MAX_N=3000+5;
const int INF=0x7fffffff;
const int inf=100000;
const double EPS=1e-6;
int a[MAX_N];
vector<vector<int> >ans;
int main (void)
{
    int n,k;
    cin>>n>>k;
    int i;
    string s;
    cin>>s;
    for(i=0;i<n;i++)
    {
        if(s[i]=='R')
            a[i]=1;
        else
            a[i]=0;
    }
    int sum=0;
    while(1)
    {
        vector<int>now;
        for(i=0;i<n-1;i++)
        {
            //cout<<a[i]<<' ';
            if(a[i]&&(!a[i+1]))
            {
                now.push_back(i+1);
                swap(a[i],a[i+1]);
                i++;
            }
        }
        //cout<<now.size()<<endl;
        if(!now.size())
            break;
        ans.push_back(now);
        sum+=now.size();
    }
    //cout<<sum<<' '<<ans.size()<<endl;
    if(sum<k||ans.size()>k)
        cout<<-1<<endl;
    else
    {
        int num=k-ans.size();
        for(auto now:ans)
        {
            while(num>0&&now.size()>1)
            {
                printf("1 %d\n",now.back());
                num--;
                now.pop_back();
            }
            printf("%d",now.size());
            for(auto i:now)
            {
                cout<<' '<<i;
            }
            cout<<endl;
        }
    }

}


#pragma warning( disable : 4996)
#define _USE_MATH_DEFINES
#pragma comment(linker, "/STACK:666000000")

#define bublic public

#include <algorithm>
#include <assert.h>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <limits.h>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <time.h>
#include <vector>
#include <stack>

#define nextLine() {for(int c=getchar(); c!='\n' && c!=EOF; c=getchar());}
#define sqr(a) ((a)*(a))
#define has(mask,i) (((mask) & (1<<(i))) == 0 ? false : true)
#define set_true(mask, i) (mask|(1<<(i)))
#define set_false(mask, i) (~((~mask)|(1<<(i))))

#define Equal(a, b) (fabsl(a-b) < 1e-9)
#define Less(a, b) (a < b && !Equal(a, b))
#define Greater(a, b) (a > b && !Equal(a, b))

using namespace std;

#ifdef SCHULLZ
#define TASK "file"
#define eprintf(...) fprintf(stdout, __VA_ARGS__)
#define parr(a,n,m) for(int i=0;i<n;i++){for(int j=0;j<m;j++)cout<<a[i][j]<<" ";puts("");}puts("");
#define log(x) cout << #x << " = " << x << endl
#else
#define TASK "file"
#define eprintf(...)
#define parr(a,n,m)
#define log(x)
#endif

#define pb(_o_) push_back(_o_)

typedef long long LL;
typedef unsigned long long ULL;
typedef long double ldb;

typedef pair<int,int> pii;
typedef pair<pii,int> tiii;
typedef pair<pii,pii> fiiii;
#define aaa first.first
#define bbb first.second
#define ccc second.first
#define ddd second.second
#define mp(x, y) make_pair(x, y)
#define mpp(x, y, z) make_pair(mp(x, y), z)
#define mppp(x, y, z, a) make_pair(mp(x, y), mp(z, a))

#define sci(a) (1 == scanf("%d", &a))
#define scii(a,b) (2 == scanf("%d%d", &a, &b))
#define sciii(a,b,c) (3 == scanf("%d%d%d", &a, &b, &c))
#define sciiii(a,b,c,d) (4 == scanf("%d%d%d%d", &a, &b, &c, &d))
#define sciiiii(a,b,c,d,e) (5 == scanf("%d%d%d%d%d", &a, &b, &c, &d, &e))

#define scin(a) (1 == scanf("%d\n", &a))
#define sciin(a,b) (2 == scanf("%d%d\n", &a, &b))
#define sciiin(a,b,c) (3 == scanf("%d%d%d\n", &a, &b, &c))
#define sciiiin(a,b,c,d) (4 == scanf("%d%d%d%d\n", &a, &b, &c, &d))
#define sciiiiin(a,b,c,d,e) (5 == scanf("%d%d%d%d%d\n", &a, &b, &c, &d, &e))

#define FORN(i,n) for(int i = 0; i < (int)(n); i++)
#define FORR(i,n) for(int i = n - 1; i >= 0; i--)
#define FORS(it,a) for(auto it = (a).begin(); it != (a).end(); it++)
#define fill(a,v) memset(a,v,sizeof(a))
#define all(A) A.begin(),A.end()

typedef vector<int> vi;
typedef vector<vi> vvi;

#ifdef SCHULLZ
typedef vector<int> vc;
typedef vector<vc> vvc;
#else
typedef vector<char> vc;
typedef vector<char> vvc;
#endif

const int INF = (1 << 30) - 1;
const ldb EPS = 1e-9;

void ML(const bool v)
{
	if (v)
		return;
	int *ass;
	for (;;)
	{
		ass = new int[2500000];
		for (int i = 0; i < 2500000; i++)
			ass[i] = rand();
	}
}

void TL(const bool v)
{
	if (v)
		return;
	for (;;)
		cout << rand() % (rand() % 1000 + 1) << endl;
}

void PE(const bool v)
{
	if (v)
		return;
	for (int i = 0; i < 10000; i++)
		printf("%c", rand() % 256);
	exit(0);
}

int n, m;
string s;
vi a;

bool LoAd()
{
	if (!scii(n, m))
		return false;
	cin >> s;
	return true;
}

vvi res;

void SoLvE()
{
	res.clear();
	a.resize(n);
	FORN(i, n)
		a[i] = (s[i] == 'L' ? 0 : 1);
	int steps = 0;
	for (;;)
	{
		bool ok = false;
		vi t;
		for (int i = 1; i < n; i++)
		{
			if (a[i - 1] == 1 && a[i] == 0)
			{
				swap(a[i - 1], a[i]);
				t.push_back(i);
				steps++;
				i++;
			}
		}
		if (t.empty())
			break;
		res.push_back(t);
	}
	if (steps < m || res.size() > m)
	{
		puts("-1");
		return;
	}

	for (int i = 0; i < res.size(); i++)
	{
		int rowsleft = res.size() - i;
		int j0 = 0;
		while (rowsleft != m && j0 < res[i].size())
		{
			printf("1 %d\n", res[i][j0]);
			j0++;
			m--;
		}
		if (j0 < res[i].size())
		{
			printf("%d", (int)res[i].size() - j0);
			for (int j = j0; j < res[i].size(); j++)
			{
				printf(" %d", res[i][j]);
			}
			m--;
			puts("");
		}
	}
}

int main()
{
	srand((int)time(NULL));
#ifdef SCHULLZ
	freopen(TASK".in", "r", stdin);   freopen(TASK".out", "w", stdout);
	for (int i = 0; LoAd(); i++)
	{
		SoLvE();
		puts("");
	}
#else
	LoAd();
	SoLvE();
#endif
	return 0;
}


#pragma warning( disable : 4996)
#define _USE_MATH_DEFINES
#pragma comment(linker, "/STACK:666000000")

#define bublic public

#include <algorithm>
#include <assert.h>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <limits.h>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <time.h>
#include <vector>
#include <stack>

#define nextLine() {for(int c=getchar(); c!='\n' && c!=EOF; c=getchar());}
#define sqr(a) ((a)*(a))
#define has(mask,i) (((mask) & (1<<(i))) == 0 ? false : true)
#define set_true(mask, i) (mask|(1<<(i)))
#define set_false(mask, i) (~((~mask)|(1<<(i))))

#define Equal(a, b) (fabsl(a-b) < 1e-9)
#define Less(a, b) (a < b && !Equal(a, b))
#define Greater(a, b) (a > b && !Equal(a, b))

using namespace std;

#ifdef SCHULLZ
#define TASK "file"
#define eprintf(...) fprintf(stdout, __VA_ARGS__)
#define parr(a,n,m) for(int i=0;i<n;i++){for(int j=0;j<m;j++)cout<<a[i][j]<<" ";puts("");}puts("");
#define log(x) cout << #x << " = " << x << endl
#else
#define TASK "file"
#define eprintf(...)
#define parr(a,n,m)
#define log(x)
#endif

#define pb(_o_) push_back(_o_)

typedef long long LL;
typedef unsigned long long ULL;
typedef long double ldb;

typedef pair<int,int> pii;
typedef pair<pii,int> tiii;
typedef pair<pii,pii> fiiii;
#define aaa first.first
#define bbb first.second
#define ccc second.first
#define ddd second.second
#define mp(x, y) make_pair(x, y)
#define mpp(x, y, z) make_pair(mp(x, y), z)
#define mppp(x, y, z, a) make_pair(mp(x, y), mp(z, a))

#define sci(a) (1 == scanf("%d", &a))
#define scii(a,b) (2 == scanf("%d%d", &a, &b))
#define sciii(a,b,c) (3 == scanf("%d%d%d", &a, &b, &c))
#define sciiii(a,b,c,d) (4 == scanf("%d%d%d%d", &a, &b, &c, &d))
#define sciiiii(a,b,c,d,e) (5 == scanf("%d%d%d%d%d", &a, &b, &c, &d, &e))

#define scin(a) (1 == scanf("%d\n", &a))
#define sciin(a,b) (2 == scanf("%d%d\n", &a, &b))
#define sciiin(a,b,c) (3 == scanf("%d%d%d\n", &a, &b, &c))
#define sciiiin(a,b,c,d) (4 == scanf("%d%d%d%d\n", &a, &b, &c, &d))
#define sciiiiin(a,b,c,d,e) (5 == scanf("%d%d%d%d%d\n", &a, &b, &c, &d, &e))

#define FORN(i,n) for(int i = 0; i < (int)(n); i++)
#define FORR(i,n) for(int i = n - 1; i >= 0; i--)
#define FORS(it,a) for(auto it = (a).begin(); it != (a).end(); it++)
#define fill(a,v) memset(a,v,sizeof(a))
#define all(A) A.begin(),A.end()

typedef vector<int> vi;
typedef vector<vi> vvi;

#ifdef SCHULLZ
typedef vector<int> vc;
typedef vector<vc> vvc;
#else
typedef vector<char> vc;
typedef vector<char> vvc;
#endif

const int INF = (1 << 30) - 1;
const ldb EPS = 1e-9;

void ML(const bool v)
{
	if (v)
		return;
	int *ass;
	for (;;)
	{
		ass = new int[2500000];
		for (int i = 0; i < 2500000; i++)
			ass[i] = rand();
	}
}

void TL(const bool v)
{
	if (v)
		return;
	for (;;)
		cout << rand() % (rand() % 1000 + 1) << endl;
}

void PE(const bool v)
{
	if (v)
		return;
	for (int i = 0; i < 10000; i++)
		printf("%c", rand() % 256);
	exit(0);
}

int n, m;
string s;
vi a;

bool LoAd()
{
	if (!scii(n, m))
		return false;
	cin >> s;
	return true;
}

vvi res;

void SoLvE()
{
	res.clear();
	a.resize(n);
	FORN(i, n)
		a[i] = (s[i] == 'L' ? 0 : 1);
	int steps = 0;
	for (;;)
	{
		bool ok = false;
		vi t;
		for (int i = 1; i < n; i++)
		{
			if (a[i - 1] == 1 && a[i] == 0)
			{
				swap(a[i - 1], a[i]);
				t.push_back(i);
				steps++;
				i++;
			}
		}
		if (t.empty())
			break;
		res.push_back(t);
	}
	if (steps < m)
	{
		puts("-1");
		return;
	}

	for (int i = 0; i < res.size(); i++)
	{
		int rowsleft = res.size() - i;
		int j0 = 0;
		while (rowsleft != m && j0 < res[i].size())
		{
			printf("1 %d\n", res[i][j0]);
			j0++;
			m--;
		}
		if (j0 < res[i].size())
		{
			printf("%d", (int)res[i].size() - j0);
			for (int j = j0; j < res[i].size(); j++)
			{
				printf(" %d", res[i][j]);
			}
			m--;
			puts("");
		}
	}
}

int main()
{
	srand((int)time(NULL));
#ifdef SCHULLZ
	freopen(TASK".in", "r", stdin);   freopen(TASK".out", "w", stdout);
	for (int i = 0; LoAd(); i++)
	{
		SoLvE();
		puts("");
	}
#else
	LoAd();
	SoLvE();
#endif
	return 0;
}


#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("avx,avx2")
#include<stdio.h>
#include<algorithm>
#include<vector>
#include<deque>
#include<assert.h>
using namespace std;
using lld = long long int;
using pii = pair<int, int>;
#define INF 100000009
#define M 30001
int n, m;
char xx[3009];
int a[3009];
int vl;
vector<int> v[6009];
pii stack[2][3009];
int sl[2];
int vs[6009];
int vi[6009];
int main() {
	int i, j, k, l;
	int t = 1, tv = 0;
	//scanf("%d", &t);
	while (t--) {
		scanf("%d %d", &n, &m);
		scanf("%s", xx);
		a[0] = 0;
		sl[0] = 0;
		lld area = 0;
		lld ls = 0;
		lld rs = 0;
		int last_ls = 0;
		int cur = 0;
		int nxt = 1;
		for (i = 0; i < n; i++) {
			if (xx[i] == 'R') {
				rs++;
				last_ls = 0;
				a[i + 1] = a[i] + 1;
			}
			else {
				area += rs;
				if (last_ls == 0) {
					stack[0][sl[0]++] = pii(ls, i);
				}
				a[i + 1] = a[i] - 1;
				ls++;
				last_ls++;
			}
		}
		if (m > area) {
			printf("-1\n");
			continue;
		}
		//insert list
		vl = 0;
		while (sl[cur] > 0) {
			sl[nxt] = 0;
			for (i = 0; i < sl[cur]; i++) {
				v[vl].push_back(stack[cur][i].second);
				if (sl[nxt] == 0 || stack[nxt][sl[nxt] - 1].first != stack[cur][i].first)
				{
					if (stack[cur][i].first < stack[cur][i].second - 1) {
						stack[nxt][sl[nxt]++] = pii(stack[cur][i].first, stack[cur][i].second - 1);
					}
				}
				if (stack[cur][i].first + 1 < ls) {
					stack[nxt][sl[nxt]++] = pii(stack[cur][i].first + 1, stack[cur][i].second + 1);
				}
			}
			vl++;
			cur ^= 1;
			nxt ^= 1;
		}
		/*
		printf("%d\n", vl);
		for (i = 0; i < vl; i++) {
			for (j = 0; j < v[i].size(); j++) {
				printf("%d ", v[i][j]);
			}
			printf("\n");
		}
		*/
		if (m < vl) {
			printf("-1\n");
			continue;
		}
		vi[vl - 1] = 0;
		vs[vl - 1] = v[vl - 1].size();
		for (i = vl-2; i >= 0; i--) {
			vi[i] = 0;
			vs[i] = vs[i + 1] = v[i].size();
		}
		int cvi = 0;
		while (m > 0) {
			if (vl - cvi == m) {
				printf("%d", v[cvi].size() - vi[cvi]);
				for (i = vi[cvi]; i < v[cvi].size(); i++) {
					printf(" %d", v[cvi][i]);
				}
				printf("\n");
				cvi++;
				m--;
			}
			else {
				printf("1 %d\n", v[cvi][vi[cvi]]);
				vi[cvi]++;
				m--;
				if (vi[cvi] == v[cvi].size())cvi++;
			}
		}
	}
}


#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("avx,avx2")
#include<stdio.h>
#include<algorithm>
#include<vector>
#include<deque>
#include<assert.h>
using namespace std;
using lld = long long int;
using pii = pair<int, int>;
#define INF 100000009
#define M 30001
int n, m;
char xx[3009];
int a[3009];
int vl;
vector<int> v[6009];
pii stack[2][3009];
int sl[2];
int vs[6009];
int vi[6009];
int main() {
	int i, j, k, l;
	int t = 1, tv = 0;
	//scanf("%d", &t);
	while (t--) {
		scanf("%d %d", &n, &m);
		scanf("%s", xx);
		a[0] = 0;
		sl[0] = 0;
		lld area = 0;
		lld ls = 0;
		lld rs = 0;
		int last_ls = 0;
		int cur = 0;
		int nxt = 1;
		for (i = 0; i < n; i++) {
			if (xx[i] == 'R') {
				rs++;
				last_ls = 0;
				a[i + 1] = a[i] + 1;
			}
			else {
				area += rs;
				if (last_ls == 0 && ls != i) {
					stack[0][sl[0]++] = pii(ls, i);
				}
				a[i + 1] = a[i] - 1;
				ls++;
				last_ls++;
			}
		}
		if (m > area) {
			printf("-1\n");
			continue;
		}
		//insert list
		vl = 0;
		while (sl[cur] > 0) {
			sl[nxt] = 0;
			for (i = 0; i < sl[cur]; i++) {
				v[vl].push_back(stack[cur][i].second);
				if (sl[nxt] == 0 || (sl[nxt] > 0 && (stack[nxt][sl[nxt] - 1].first != stack[cur][i].first) && (stack[nxt][sl[nxt]-1].second - stack[nxt][sl[nxt]-1].first != stack[cur][i].second - stack[cur][i].first - 1)))
				{
					if (stack[cur][i].first < stack[cur][i].second - 1) {
						stack[nxt][sl[nxt]++] = pii(stack[cur][i].first, stack[cur][i].second - 1);
					}
				}
				if ((sl[nxt] == 0 && stack[cur][i].first + 1 < ls) || (sl[nxt] > 0 && (stack[nxt][sl[nxt] - 1].second - stack[nxt][sl[nxt] - 1].first != stack[cur][i].second - stack[cur][i].first) && stack[cur][i].first + 1 < ls)) {
					stack[nxt][sl[nxt]++] = pii(stack[cur][i].first + 1, stack[cur][i].second + 1);
				}
			}
			vl++;
			cur ^= 1;
			nxt ^= 1;
		}
		/*
		printf("%d\n", vl);
		for (i = 0; i < vl; i++) {
			for (j = 0; j < v[i].size(); j++) {
				printf("%d ", v[i][j]);
			}
			printf("\n");
		}
		*/
		if (m < vl) {
			printf("-1\n");
			continue;
		}
		vi[vl - 1] = 0;
		vs[vl - 1] = v[vl - 1].size();
		for (i = vl-2; i >= 0; i--) {
			vi[i] = 0;
			vs[i] = vs[i + 1] = v[i].size();
		}
		int cvi = 0;
		while (m > 0) {
			if (vl - cvi == m) {
				printf("%d", v[cvi].size() - vi[cvi]);
				for (i = vi[cvi]; i < v[cvi].size(); i++) {
					printf(" %d", v[cvi][i]);
				}
				printf("\n");
				cvi++;
				m--;
			}
			else {
				printf("1 %d\n", v[cvi][vi[cvi]]);
				vi[cvi]++;
				m--;
				if (vi[cvi] == v[cvi].size())cvi++;
			}
		}
	}
}


#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("avx,avx2")
#include<stdio.h>
#include<algorithm>
#include<vector>
#include<deque>
#include<assert.h>
using namespace std;
using lld = long long int;
using pii = pair<int, int>;
#define INF 100000009
#define M 30001
int n, m;
char xx[3009];
int a[3009];
int vl;
vector<int> v[6009];
pii stack[2][3009];
int sl[2];
int vs[6009];
int vi[6009];
int main() {
	int i, j, k, l;
	int t = 1, tv = 0;
	//scanf("%d", &t);
	while (t--) {
		scanf("%d %d", &n, &m);
		scanf("%s", xx);
		a[0] = 0;
		sl[0] = 0;
		lld area = 0;
		lld ls = 0;
		lld rs = 0;
		int last_ls = 0;
		int cur = 0;
		int nxt = 1;
		for (i = 0; i < n; i++) {
			if (xx[i] == 'R') {
				rs++;
				last_ls = 0;
				a[i + 1] = a[i] + 1;
			}
			else {
				area += rs;
				if (last_ls == 0 && ls != i) {
					stack[0][sl[0]++] = pii(ls, i);
				}
				a[i + 1] = a[i] - 1;
				ls++;
				last_ls++;
			}
		}
		if (m > area) {
			printf("-1\n");
			continue;
		}
		//insert list
		vl = 0;
		while (sl[cur] > 0) {
			sl[nxt] = 0;
			for (i = 0; i < sl[cur]; i++) {
				v[vl].push_back(stack[cur][i].second);
				if (sl[nxt] == 0 || ((stack[nxt][sl[nxt] - 1].first != stack[cur][i].first) && (stack[nxt][sl[nxt]-1].second - stack[nxt][sl[nxt]-1].first != stack[cur][i].second - stack[cur][i].first - 1)))
				{
					if (stack[cur][i].first < stack[cur][i].second - 1) {
						stack[nxt][sl[nxt]++] = pii(stack[cur][i].first, stack[cur][i].second - 1);
					}
				}
				if ((sl[nxt] == 0 && stack[cur][i].first + 1 < ls) || (sl[nxt] > 0 && (stack[nxt][sl[nxt] - 1].second - stack[nxt][sl[nxt] - 1].first != stack[cur][i].second - stack[cur][i].first) && stack[cur][i].first + 1 < ls)) {
					stack[nxt][sl[nxt]++] = pii(stack[cur][i].first + 1, stack[cur][i].second + 1);
				}
			}
			vl++;
			cur ^= 1;
			nxt ^= 1;
		}
		/*
		printf("%d\n", vl);
		for (i = 0; i < vl; i++) {
			for (j = 0; j < v[i].size(); j++) {
				printf("%d ", v[i][j]);
			}
			printf("\n");
		}
		*/
		if (m < vl) {
			printf("-1\n");
			continue;
		}
		vi[vl - 1] = 0;
		vs[vl - 1] = v[vl - 1].size();
		for (i = vl-2; i >= 0; i--) {
			vi[i] = 0;
			vs[i] = vs[i + 1] = v[i].size();
		}
		int cvi = 0;
		while (m > 0) {
			if (vl - cvi == m) {
				printf("%d", v[cvi].size() - vi[cvi]);
				for (i = vi[cvi]; i < v[cvi].size(); i++) {
					printf(" %d", v[cvi][i]);
				}
				printf("\n");
				cvi++;
				m--;
			}
			else {
				printf("1 %d\n", v[cvi][vi[cvi]]);
				vi[cvi]++;
				m--;
				if (vi[cvi] == v[cvi].size())cvi++;
			}
		}
	}
}


#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("avx,avx2")
#include<stdio.h>
#include<algorithm>
#include<vector>
#include<deque>
#include<assert.h>
using namespace std;
using lld = long long int;
using pii = pair<int, int>;
#define INF 100000009
#define M 30001
int n, m;
char xx[3009];
int a[3009];
int vl;
vector<int> v[3000009];
pii stack[2][3000009];
int sl[2];
int vs[3000009];
int vi[3000009];
int main() {
	int i, j, k, l;
	int t = 1, tv = 0;
	//scanf("%d", &t);
	while (t--) {
		scanf("%d %d", &n, &m);
		scanf("%s", xx);
		a[0] = 0;
		sl[0] = 0;
		lld area = 0;
		lld ls = 0;
		lld rs = 0;
		int last_ls = 0;
		int cur = 0;
		int nxt = 1;
		for (i = 0; i < n; i++) {
			if (xx[i] == 'R') {
				rs++;
				last_ls = 0;
				a[i + 1] = a[i] + 1;
			}
			else {
				area += rs;
				if (last_ls == 0 && ls != i) {
					stack[0][sl[0]++] = pii(ls, i);
				}
				a[i + 1] = a[i] - 1;
				ls++;
				last_ls++;
			}
		}
		if (m > area) {
			printf("-1\n");
			continue;
		}
		//insert list
		vl = 0;
		while (sl[cur] > 0) {
			sl[nxt] = 0;
			for (i = 0; i < sl[cur]; i++) {
				v[vl].push_back(stack[cur][i].second);
				if (sl[nxt] == 0 || (sl[nxt] > 0 && (stack[nxt][sl[nxt] - 1].first != stack[cur][i].first) && (stack[nxt][sl[nxt]-1].second - stack[nxt][sl[nxt]-1].first != stack[cur][i].second - stack[cur][i].first - 1)))
				{
					if (stack[cur][i].first < stack[cur][i].second - 1) {
						stack[nxt][sl[nxt]++] = pii(stack[cur][i].first, stack[cur][i].second - 1);
					}
				}
//				if ((sl[nxt] == 0 && stack[cur][i].first + 1 < ls) || (sl[nxt] > 0 && (stack[nxt][sl[nxt] - 1].second - stack[nxt][sl[nxt] - 1].first != stack[cur][i].second - stack[cur][i].first) && stack[cur][i].first + 1 < ls)) {
				if(stack[cur][i].first + 1 < ls) {
					stack[nxt][sl[nxt]++] = pii(stack[cur][i].first + 1, stack[cur][i].second + 1);
				}
			}
			vl++;
			cur ^= 1;
			nxt ^= 1;
		}
		/*
		printf("%d\n", vl);
		for (i = 0; i < vl; i++) {
			for (j = 0; j < v[i].size(); j++) {
				printf("%d ", v[i][j]);
			}
			printf("\n");
		}
		*/
		if (m < vl) {
			printf("-1\n");
			continue;
		}
		vi[vl - 1] = 0;
		vs[vl - 1] = v[vl - 1].size();
		for (i = vl-2; i >= 0; i--) {
			vi[i] = 0;
			vs[i] = vs[i + 1] = v[i].size();
		}
		int cvi = 0;
		while (m > 0) {
			if (vl - cvi == m) {
				printf("%d", v[cvi].size() - vi[cvi]);
				for (i = vi[cvi]; i < v[cvi].size(); i++) {
					printf(" %d", v[cvi][i]);
				}
				printf("\n");
				cvi++;
				m--;
			}
			else {
				printf("1 %d\n", v[cvi][vi[cvi]]);
				vi[cvi]++;
				m--;
				if (vi[cvi] == v[cvi].size())cvi++;
			}
		}
	}
}


#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("avx,avx2")
#include<stdio.h>
#include<algorithm>
#include<vector>
#include<deque>
#include<assert.h>
using namespace std;
using lld = long long int;
using pii = pair<int, int>;
#define INF 100000009
#define M 30001
int n, m;
char xx[3009];
int a[3009];
int vl;
vector<int> v[3000009];
pii stack[2][3009];
int sl[2];
int vs[3000009];
int vi[3000009];
int main() {
	int i, j, k, l;
	int t = 1, tv = 0;
	//scanf("%d", &t);
	while (t--) {
		scanf("%d %d", &n, &m);
		scanf("%s", xx);
		a[0] = 0;
		sl[0] = 0;
		lld area = 0;
		lld ls = 0;
		lld rs = 0;
		int last_ls = 0;
		int cur = 0;
		int nxt = 1;
		for (i = 0; i < n; i++) {
			if (xx[i] == 'R') {
				rs++;
				last_ls = 0;
				a[i + 1] = a[i] + 1;
			}
			else {
				area += rs;
				if (last_ls == 0 && ls != i) {
					stack[0][sl[0]++] = pii(ls, i);
				}
				a[i + 1] = a[i] - 1;
				ls++;
				last_ls++;
			}
		}
		if (m > area) {
			printf("-1\n");
			continue;
		}
		//insert list
		vl = 0;
		while (sl[cur] > 0) {
			sl[nxt] = 0;
			for (i = 0; i < sl[cur]; i++) {
				v[vl].push_back(stack[cur][i].second);
				if (sl[nxt] == 0 || (sl[nxt] > 0 && (stack[nxt][sl[nxt] - 1].first != stack[cur][i].first) && (stack[nxt][sl[nxt]-1].second - stack[nxt][sl[nxt]-1].first != stack[cur][i].second - stack[cur][i].first - 1)))
				{
					if (stack[cur][i].first < stack[cur][i].second - 1) {
						stack[nxt][sl[nxt]++] = pii(stack[cur][i].first, stack[cur][i].second - 1);
					}
				}
//				if ((sl[nxt] == 0 && stack[cur][i].first + 1 < ls) || (sl[nxt] > 0 && (stack[nxt][sl[nxt] - 1].second - stack[nxt][sl[nxt] - 1].first != stack[cur][i].second - stack[cur][i].first) && stack[cur][i].first + 1 < ls)) {
				if(stack[cur][i].first + 1 < ls) {
					stack[nxt][sl[nxt]++] = pii(stack[cur][i].first + 1, stack[cur][i].second + 1);
				}
			}
			vl++;
			cur ^= 1;
			nxt ^= 1;
		}
		/*
		printf("%d\n", vl);
		for (i = 0; i < vl; i++) {
			for (j = 0; j < v[i].size(); j++) {
				printf("%d ", v[i][j]);
			}
			printf("\n");
		}
		*/
		if (m < vl) {
			printf("-1\n");
			continue;
		}
		vi[vl - 1] = 0;
		vs[vl - 1] = v[vl - 1].size();
		for (i = vl-2; i >= 0; i--) {
			vi[i] = 0;
			vs[i] = vs[i + 1] = v[i].size();
		}
		int cvi = 0;
		while (m > 0) {
			if (vl - cvi == m) {
				printf("%d", v[cvi].size() - vi[cvi]);
				for (i = vi[cvi]; i < v[cvi].size(); i++) {
					printf(" %d", v[cvi][i]);
				}
				printf("\n");
				cvi++;
				m--;
			}
			else {
				printf("1 %d\n", v[cvi][vi[cvi]]);
				vi[cvi]++;
				m--;
				if (vi[cvi] == v[cvi].size())cvi++;
			}
		}
	}
}


#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("avx,avx2")
#include<stdio.h>
#include<algorithm>
#include<vector>
#include<deque>
#include<assert.h>
using namespace std;
using lld = long long int;
using pii = pair<int, int>;
#define INF 100000009
#define M 30001
int n, m;
char xx[3009];
int a[3009];
int vl;
vector<int> v[6009];
pii stack[2][3009];
int sl[2];
int vs[6009];
int vi[6009];
int main() {
	int i, j, k, l;
	int t = 1, tv = 0;
	//scanf("%d", &t);
	while (t--) {
		scanf("%d %d", &n, &m);
		scanf("%s", xx);
		a[0] = 0;
		sl[0] = 0;
		lld area = 0;
		lld ls = 0;
		lld rs = 0;
		int last_ls = 0;
		int cur = 0;
		int nxt = 1;
		for (i = 0; i < n; i++) {
			if (xx[i] == 'R') {
				rs++;
				last_ls = 0;
				a[i + 1] = a[i] + 1;
			}
			else {
				area += rs;
				if (last_ls == 0 && ls != i) {
					stack[0][sl[0]++] = pii(ls, i);
				}
				a[i + 1] = a[i] - 1;
				ls++;
				last_ls++;
			}
		}
		if (m > area) {
			printf("-1\n");
			continue;
		}
		//insert list
		vl = 0;
		while (sl[cur] > 0) {
			sl[nxt] = 0;
			for (i = 0; i < sl[cur]; i++) {
				v[vl].push_back(stack[cur][i].second);
				if (sl[nxt] == 0 || stack[nxt][sl[nxt] - 1].first != stack[cur][i].first)
				{
					if (stack[cur][i].first < stack[cur][i].second - 1) {
						stack[nxt][sl[nxt]++] = pii(stack[cur][i].first, stack[cur][i].second - 1);
					}
				}
				if (stack[cur][i].first + 1 < ls) {
					stack[nxt][sl[nxt]++] = pii(stack[cur][i].first + 1, stack[cur][i].second + 1);
				}
			}
			vl++;
			cur ^= 1;
			nxt ^= 1;
		}
		/*
		printf("%d\n", vl);
		for (i = 0; i < vl; i++) {
			for (j = 0; j < v[i].size(); j++) {
				printf("%d ", v[i][j]);
			}
			printf("\n");
		}
		*/
		if (m < vl) {
			printf("-1\n");
			continue;
		}
		vi[vl - 1] = 0;
		vs[vl - 1] = v[vl - 1].size();
		for (i = vl-2; i >= 0; i--) {
			vi[i] = 0;
			vs[i] = vs[i + 1] = v[i].size();
		}
		int cvi = 0;
		while (m > 0) {
			if (vl - cvi == m) {
				printf("%d", v[cvi].size() - vi[cvi]);
				for (i = vi[cvi]; i < v[cvi].size(); i++) {
					printf(" %d", v[cvi][i]);
				}
				printf("\n");
				cvi++;
				m--;
			}
			else {
				printf("1 %d\n", v[cvi][vi[cvi]]);
				vi[cvi]++;
				m--;
				if (vi[cvi] == v[cvi].size())cvi++;
			}
		}
	}
}


#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("avx,avx2")
#include<stdio.h>
#include<algorithm>
#include<vector>
#include<deque>
#include<assert.h>
using namespace std;
using lld = long long int;
using pii = pair<int, int>;
#define INF 100000009
#define M 30001
int n, m;
char xx[3009];
int a[3009];
int vl;
vector<int> v[3000009];
pii stack[2][3000009];
int sl[2];
int vs[3000009];
int vi[3000009];
int main() {
	int i, j, k, l;
	int t = 1, tv = 0;
	//scanf("%d", &t);
	while (t--) {
		scanf("%d %d", &n, &m);
		scanf("%s", xx);
		a[0] = 0;
		sl[0] = 0;
		lld area = 0;
		lld ls = 0;
		lld rs = 0;
		int last_ls = 0;
		int cur = 0;
		int nxt = 1;
		for (i = 0; i < n; i++) {
			if (xx[i] == 'R') {
				rs++;
				last_ls = 0;
				a[i + 1] = a[i] + 1;
			}
			else {
				area += rs;
				if (last_ls == 0 && ls != i) {
					stack[0][sl[0]++] = pii(ls, i);
				}
				a[i + 1] = a[i] - 1;
				ls++;
				last_ls++;
			}
		}
		if (m > area) {
			printf("-1\n");
			continue;
		}
		//insert list
		vl = 0;
		while (sl[cur] > 0) {
			sl[nxt] = 0;
			for (i = 0; i < sl[cur]; i++) {
				//printf("%d,%d ", stack[cur][i].first, stack[cur][i].second);
				v[vl].push_back(stack[cur][i].second);
				if (sl[nxt] == 0) {
					if (stack[cur][i].first < stack[cur][i].second - 1) {
						stack[nxt][sl[nxt]++] = pii(stack[cur][i].first, stack[cur][i].second - 1);
					}
				}
				else if (stack[nxt][sl[nxt] - 1].second - stack[nxt][sl[nxt] - 1].first == stack[cur][i].second - stack[cur][i].first - 1) {
					//skip
				}
				else if (stack[nxt][sl[nxt] - 1].first == stack[cur][i].first) {
					if (stack[cur][i].first < stack[cur][i].second - 1) {
						sl[nxt]--;
						stack[nxt][sl[nxt]++] = pii(stack[cur][i].first, stack[cur][i].second - 1);
					}
				}
				else {
					if (stack[cur][i].first < stack[cur][i].second - 1) {
						stack[nxt][sl[nxt]++] = pii(stack[cur][i].first, stack[cur][i].second - 1);
					}
				}
//				if ((sl[nxt] == 0 && stack[cur][i].first + 1 < ls) || (sl[nxt] > 0 && (stack[nxt][sl[nxt] - 1].second - stack[nxt][sl[nxt] - 1].first != stack[cur][i].second - stack[cur][i].first) && stack[cur][i].first + 1 < ls)) {
				if(stack[cur][i].first + 1 < ls) {
					stack[nxt][sl[nxt]++] = pii(stack[cur][i].first + 1, stack[cur][i].second + 1);
				}
			}
			//printf("\n");
			vl++;
			cur ^= 1;
			nxt ^= 1;
		}
		/*
		printf("%d\n", vl);
		for (i = 0; i < vl; i++) {
			for (j = 0; j < v[i].size(); j++) {
				printf("%d ", v[i][j]);
			}
			printf("\n");
		}
		*/
		if (m < vl) {
			printf("-1\n");
			continue;
		}
		vi[vl - 1] = 0;
		vs[vl - 1] = v[vl - 1].size();
		for (i = vl-2; i >= 0; i--) {
			vi[i] = 0;
			vs[i] = vs[i + 1] = v[i].size();
		}
		int cvi = 0;
		while (m > 0) {
			if (vl - cvi == m) {
				printf("%d", v[cvi].size() - vi[cvi]);
				for (i = vi[cvi]; i < v[cvi].size(); i++) {
					printf(" %d", v[cvi][i]);
				}
				printf("\n");
				cvi++;
				m--;
			}
			else {
				printf("1 %d\n", v[cvi][vi[cvi]]);
				vi[cvi]++;
				m--;
				if (vi[cvi] == v[cvi].size())cvi++;
			}
		}
	}
}


#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("avx,avx2")
#include<stdio.h>
#include<algorithm>
#include<vector>
#include<deque>
#include<assert.h>
using namespace std;
using lld = long long int;
using pii = pair<int, int>;
#define INF 100000009
#define M 30001
int n, m;
char xx[3009];
int a[3009];
int vl;
vector<int> v[3000009];
pii stack[2][3009];
int sl[2];
int vs[3000009];
int vi[3000009];
int main() {
	int i, j, k, l;
	int t = 1, tv = 0;
	//scanf("%d", &t);
	while (t--) {
		scanf("%d %d", &n, &m);
		scanf("%s", xx);
		a[0] = 0;
		sl[0] = 0;
		lld area = 0;
		lld ls = 0;
		lld rs = 0;
		int last_ls = 0;
		int cur = 0;
		int nxt = 1;
		for (i = 0; i < n; i++) {
			if (xx[i] == 'R') {
				rs++;
				last_ls = 0;
				a[i + 1] = a[i] + 1;
			}
			else {
				area += rs;
				if (last_ls == 0 && ls != i) {
					stack[0][sl[0]++] = pii(ls, i);
				}
				a[i + 1] = a[i] - 1;
				ls++;
				last_ls++;
			}
		}
		if (m > area) {
			printf("-1\n");
			continue;
		}
		//insert list
		vl = 0;
		while (sl[cur] > 0) {
			sl[nxt] = 0;
			for (i = 0; i < sl[cur]; i++) {
				v[vl].push_back(stack[cur][i].second);
				if (sl[nxt] == 0 || (sl[nxt] > 0 && (stack[nxt][sl[nxt] - 1].first != stack[cur][i].first) && (stack[nxt][sl[nxt]-1].second - stack[nxt][sl[nxt]-1].first != stack[cur][i].second - stack[cur][i].first - 1)))
				{
					if (stack[cur][i].first < stack[cur][i].second - 1) {
						stack[nxt][sl[nxt]++] = pii(stack[cur][i].first, stack[cur][i].second - 1);
					}
				}
				if ((sl[nxt] == 0 && stack[cur][i].first + 1 < ls) || (sl[nxt] > 0 && (stack[nxt][sl[nxt] - 1].second - stack[nxt][sl[nxt] - 1].first != stack[cur][i].second - stack[cur][i].first) && stack[cur][i].first + 1 < ls)) {
					stack[nxt][sl[nxt]++] = pii(stack[cur][i].first + 1, stack[cur][i].second + 1);
				}
			}
			vl++;
			cur ^= 1;
			nxt ^= 1;
		}
		/*
		printf("%d\n", vl);
		for (i = 0; i < vl; i++) {
			for (j = 0; j < v[i].size(); j++) {
				printf("%d ", v[i][j]);
			}
			printf("\n");
		}
		*/
		if (m < vl) {
			printf("-1\n");
			continue;
		}
		vi[vl - 1] = 0;
		vs[vl - 1] = v[vl - 1].size();
		for (i = vl-2; i >= 0; i--) {
			vi[i] = 0;
			vs[i] = vs[i + 1] = v[i].size();
		}
		int cvi = 0;
		while (m > 0) {
			if (vl - cvi == m) {
				printf("%d", v[cvi].size() - vi[cvi]);
				for (i = vi[cvi]; i < v[cvi].size(); i++) {
					printf(" %d", v[cvi][i]);
				}
				printf("\n");
				cvi++;
				m--;
			}
			else {
				printf("1 %d\n", v[cvi][vi[cvi]]);
				vi[cvi]++;
				m--;
				if (vi[cvi] == v[cvi].size())cvi++;
			}
		}
	}
}


#include "vector"
#include "set"
#include "map"
#include "unordered_map"
#include "string"
#include "iostream"
#include "algorithm"
#include "queue"

using namespace std;

#define ll long long
#define INF 2e9
#define MOD 998244353

typedef vector<int> vi;
typedef pair<int, int> pii;

template<typename T>
ostream& operator<<(ostream& os, const vector<T>& v) {
    bool first = true;
    for (const auto& x : v) {
        if (!first) {
            os << " ";
        }
        first = false;
        os << x;
    }
    return os;
}

template<typename T>
istream& operator>>(istream& is, vector<T>& v) {
    for (auto& elem : v) {
        is >> elem;
    }
    return is;
}

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

    string s;
    cin >> s;
    string g = s;

    vi a;
    int mi = 0;
    int ma = 0;
    while (true) {
        int j =0;
        for (int i=0; i<n-1; i++) {
            if (s[i] == 'R' && s[i+1] == 'L') {
                s[i] = 'L';
                s[i+1] = 'R';
                j++;
                i++;
            }
        }
        if (j) {
            a.push_back(j);
            mi++;
            ma += j;
        } else {
            break;
        }
    }

    if (k > ma || k < mi) {
        cout << -1;
    } else {
        s = g;
        for (int j=0; j<a.size(); j++) {
            ma -= a[j];
            mi--;
            int cur;
            if (k - a[j] >= mi) {
                cur = a[j];
            } else {
                cur = k - mi;
            }
            //cout << "cur=" << cur << endl;

            vi b;
            for (int i=0; i<n-1; i++) {
                if (s[i] == 'R' && s[i+1] == 'L') {
                    s[i] = 'L';
                    s[i+1] = 'R';
                    b.push_back(i+1);
                    i++;
                }
            }
            //cout << b << endl;

            for (int ii = 0; ii < cur-1; ii++) {
                cout << 1 << ' ' << b[ii] << endl;
            }

            cout << a[j] - cur + 1 << ' ';
            for (int ii = cur-1; ii < a[j]; ii++) {
                cout << b[ii] << ' ';
            }
            cout << endl;

            k -= cur;
        }
    }
}

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

    if (0) {
        int tests;
        cin >> tests;
        while (tests--) {
            solve();
            cout << endl;
        }
    } else {
        solve();
        cout << endl;
    }

    return 0;
}


#include "vector"
#include "set"
#include "map"
#include "unordered_map"
#include "string"
#include "iostream"
#include "algorithm"
#include "queue"

using namespace std;

#define ll long long
#define INF 2e9
#define MOD 998244353

typedef vector<int> vi;
typedef pair<int, int> pii;

template<typename T>
ostream& operator<<(ostream& os, const vector<T>& v) {
    bool first = true;
    for (const auto& x : v) {
        if (!first) {
            os << " ";
        }
        first = false;
        os << x;
    }
    return os;
}

template<typename T>
istream& operator>>(istream& is, vector<T>& v) {
    for (auto& elem : v) {
        is >> elem;
    }
    return is;
}

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

    string s;
    cin >> s;
    string g = s;

    vi a;
    int mi = 0;
    int ma = 0;
    while (true) {
        int j =0;
        for (int i=0; i<n-1; i++) {
            if (s[i] == 'R' && s[i+1] == 'L') {
                s[i] = 'L';
                s[i+1] = 'R';
                j++;
                i++;
            }
        }
        if (j) {
            a.push_back(j);
            mi++;
            ma += j;
        } else {
            break;
        }
    }

    if (k > ma || k < mi) {
        cout << -1;
    } else {
        s = g;
        for (int j=0; j<a.size(); j++) {
            ma -= a[j];
            mi--;
            int cur;
            if (k - a[j] >= mi) {
                cur = a[j];
            } else {
                cur = k - mi;
            }
            //cout << "cur=" << cur << endl;

            vi b;
            for (int i=0; i<n-1; i++) {
                if (s[i] == 'R' && s[i+1] == 'L') {
                    s[i] = 'L';
                    s[i+1] = 'R';
                    b.push_back(i+1);
                    i++;
                }
            }
            //cout << b << endl;

            for (int ii = 0; ii < cur-1; ii++) {
                printf("1 %d\n", b[ii]);
            }

            printf("%d\n", a[j] - cur + 1);
            for (int ii = cur-1; ii < a[j]; ii++) {
                printf("%d ", b[ii]);
            }
            printf("\n");

            k -= cur;
        }
    }
}

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

    if (0) {
        int tests;
        cin >> tests;
        while (tests--) {
            solve();
            cout << endl;
        }
    } else {
        solve();
        cout << endl;
    }

    return 0;
}


#include <algorithm>
#include <cassert>
#include <cstring>
#include <cmath>
#include <iomanip>
#include <istream>
#include <map>
#include <numeric>
#include <ostream>
#include <queue>
#include <tuple>
#include <set>
#include <sstream>
#include <stack>
#include <unordered_set>
#include <unordered_map>
#include <utility>
#include <vector>

#define rep(i,n) for((i)=0;(i)<(n);(i)++)

#define PB push_back

#define SZ(a) (a).size()

#pragma comment(linker, "/stack:16777216")
using namespace std;
// Powered by caide (code generator, tester, and library code inliner)

#include <fstream>
#include <iostream>

int main() {

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

{
        int n, k, i;
        const int NMAX = 3e3+10;
        char s[NMAX];
        scanf("%d %d", &n, &k);
        //in >> n >> k;
        scanf("%s", &s);
        //rep(i, n) in >> s[i];

        vector<vector<int> > hist(k, vector<int>());
        int all_possible = 0;
        int sz = 0;
        while (1) {
            vector<int> step;
            rep(i, n - 1) if (s[i] == 'R' && s[i + 1] == 'L') {
                step.PB(i);
                ++i;
                all_possible++;
            }
            //if (sz == 200) for(;;);

            if (step.empty()) break;
            hist[sz++] = step;
            if (sz >= k)
            {
                // out << -1 << endl;
                puts("-1");
                return 0;
            }
            for (auto el : step) swap(s[el], s[el + 1]);
        }
        if (all_possible < k)
        {
            //out << -1 << endl;
            puts("-1");
            return 0;
        }

        int source = sz - 1;
        hist.resize(k);
        for (i = k; i-- > 0;)
        {
            if (hist[source].empty()) --source;
            if (!hist[i].empty()) break;
            hist[i].PB(hist[source].back());
            hist[source].pop_back();
        }
        rep(i, k)
        {
            //out << SZ(hist[i]) << " ";
            printf("%d ", SZ(hist[i]));
            for (auto el : hist[i]) printf("%d ", el + 1); // out << el+1 << " ";
            // out << endl;
            puts("");
        }

    }

    return 0;
}


#include <algorithm>
#include <cassert>
#include <cstring>
#include <cmath>
#include <iomanip>
#include <istream>
#include <map>
#include <numeric>
#include <ostream>
#include <queue>
#include <tuple>
#include <set>
#include <sstream>
#include <stack>
#include <unordered_set>
#include <unordered_map>
#include <utility>
#include <vector>

#define rep(i,n) for((i)=0;(i)<(n);(i)++)

#define PB push_back

#define SZ(a) (a).size()

#pragma comment(linker, "/stack:16777216")
using namespace std;
// Powered by caide (code generator, tester, and library code inliner)

class Solution {
public:
    void solve(std::istream& in, std::ostream& out) {
        int n, k, i;
        const int NMAX = 3e3+1;
        char s[NMAX];
        scanf("%d %d", &n, &k);
        //in >> n >> k;
        scanf("%s", &s);
        //rep(i, n) in >> s[i];

        vector<vector<int> > hist(k, vector<int>());
        int all_possible = 0;
        int sz = 0;
        while (1) {
            vector<int> step;
            rep(i, n - 1) if (s[i] == 'R' && s[i + 1] == 'L') {
                step.PB(i);
                ++i;
                all_possible++;
            }
            if (step.empty()) break;
            hist[sz++] = step;
            if (sz > k)
            {
                // out << -1 << endl;
                puts("-1");
                return;
            }
            for (auto el : step) swap(s[el], s[el + 1]);
        }
        if (all_possible < k)
        {
            //out << -1 << endl;
            puts("-1");
            return;
        }

        int source = sz - 1;
        hist.resize(k);
        for (i = k; i-- > 0;)
        {
            if (hist[source].empty()) --source;
            if (!hist[i].empty()) break;
            hist[i].PB(hist[source].back());
            hist[source].pop_back();
        }
        rep(i, k)
        {
            //out << SZ(hist[i]) << " ";
            printf("%d ", SZ(hist[i]));
            for (auto el : hist[i]) printf("%d ", el + 1); // out << el+1 << " ";
            // out << endl;
            puts("");
        }

    }
};

void solve(std::istream& in, std::ostream& out)
{
    out << std::setprecision(12);
    Solution solution;
    solution.solve(in, out);
}

#include <fstream>
#include <iostream>

int main() {

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

    istream& in = cin;

    ostream& out = cout;

    solve(in, out);
    return 0;
}


#include <algorithm>
#include <cassert>
#include <cstring>
#include <cmath>
#include <iomanip>
#include <istream>
#include <map>
#include <numeric>
#include <ostream>
#include <queue>
#include <tuple>
#include <set>
#include <sstream>
#include <stack>
#include <unordered_set>
#include <unordered_map>
#include <utility>
#include <vector>

#define rep(i,n) for((i)=0;(i)<(n);(i)++)

#define PB push_back

#define SZ(a) (a).size()

#pragma comment(linker, "/stack:16777216")
using namespace std;
// Powered by caide (code generator, tester, and library code inliner)

class Solution {
public:
    void solve(std::istream& in, std::ostream& out) {
        int n, k, i;
        const int NMAX = 3e3+1;
        char s[NMAX];
        scanf("%d %d", &n, &k);
        //in >> n >> k;
        scanf("%s", &s);
        //rep(i, n) in >> s[i];

        vector<vector<int> > hist(k, vector<int>());
        int all_possible = 0;
        int sz = 0;
        while (1) {
            vector<int> step;
            rep(i, n - 1) if (s[i] == 'R' && s[i + 1] == 'L') {
                step.PB(i);
                ++i;
                all_possible++;
            }
            if (step.empty()) break;
            hist[sz++] = step;
            if (sz >= k)
            {
                // out << -1 << endl;
                puts("-1");
                return;
            }
            for (auto el : step) swap(s[el], s[el + 1]);
        }
        if (all_possible < k)
        {
            //out << -1 << endl;
            puts("-1");
            return;
        }

        int source = sz - 1;
        hist.resize(k);
        for (i = k; i-- > 0;)
        {
            if (hist[source].empty()) --source;
            if (!hist[i].empty()) break;
            hist[i].PB(hist[source].back());
            hist[source].pop_back();
        }
        rep(i, k)
        {
            //out << SZ(hist[i]) << " ";
            printf("%d ", SZ(hist[i]));
            for (auto el : hist[i]) printf("%d ", el + 1); // out << el+1 << " ";
            // out << endl;
            puts("");
        }

    }
};

void solve(std::istream& in, std::ostream& out)
{
    out << std::setprecision(12);
    Solution solution;
    solution.solve(in, out);
}

#include <fstream>
#include <iostream>

int main() {

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

    istream& in = cin;

    ostream& out = cout;

    solve(in, out);
    return 0;
}


#include <algorithm>
#include <cassert>
#include <cstring>
#include <cmath>
#include <iomanip>
#include <istream>
#include <map>
#include <numeric>
#include <ostream>
#include <queue>
#include <tuple>
#include <set>
#include <sstream>
#include <stack>
#include <unordered_set>
#include <unordered_map>
#include <utility>
#include <vector>

#define rep(i,n) for((i)=0;(i)<(n);(i)++)

#define PB push_back

#define SZ(a) (a).size()

#pragma comment(linker, "/stack:16777216")
using namespace std;
// Powered by caide (code generator, tester, and library code inliner)

class Solution {
public:
    void solve(std::istream& in, std::ostream& out) {
        int n, k, i;
        const int NMAX = 3e3+1;
        char s[NMAX];
        in >> n >> k;
        rep(i, n) in >> s[i];

        vector<vector<int> > hist;
        int all_possible = 0;
        while (1) {
            vector<int> step;
            rep(i, n - 1) if (s[i] == 'R' && s[i + 1] == 'L') {
                step.PB(i);
                ++i;
                all_possible++;
            }
            if (step.empty()) break;
            hist.PB(step);
            if (hist.size() > k)
            {
                out << -1 << endl;
                return;
            }
            for (auto el : step) swap(s[el], s[el + 1]);
        }
        if (all_possible < k)
        {
            out << -1 << endl;
            return;
        }

        int source = hist.size() - 1;
        hist.resize(k);
        for (i = k; i-- > 0;)
        {
            if (hist[source].empty()) --source;
            if (!hist[i].empty()) break;
            hist[i].PB(hist[source].back());
            hist[source].pop_back();
        }
        rep(i, k)
        {
            out << SZ(hist[i]) << " ";
            for (auto el : hist[i]) out << el+1 << " ";
            out << endl;
        }

    }
};

void solve(std::istream& in, std::ostream& out)
{
    out << std::setprecision(12);
    Solution solution;
    solution.solve(in, out);
}

#include <fstream>
#include <iostream>

int main() {

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

    istream& in = cin;

    ostream& out = cout;

    solve(in, out);
    return 0;
}


#include <algorithm>
#include <cassert>
#include <cstring>
#include <cmath>
#include <iomanip>
#include <istream>
#include <map>
#include <numeric>
#include <ostream>
#include <queue>
#include <tuple>
#include <set>
#include <sstream>
#include <stack>
#include <unordered_set>
#include <unordered_map>
#include <utility>
#include <vector>

#define rep(i,n) for((i)=0;(i)<(n);(i)++)

#define PB push_back

#define SZ(a) (a).size()

#pragma comment(linker, "/stack:16777216")
using namespace std;
// Powered by caide (code generator, tester, and library code inliner)

#include <fstream>
#include <iostream>

int main() {

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

{
        int n, k, i;
        const int NMAX = 3e3+10;
        char s[NMAX];
        scanf("%d %d", &n, &k);
        //in >> n >> k;
        scanf("%s", &s);
        //rep(i, n) in >> s[i];

        vector<vector<int> > hist(k, vector<int>());
        int all_possible = 0;
        int sz = 0;
        while (1) {
            vector<int> step;
            rep(i, n - 1) if (s[i] == 'R' && s[i + 1] == 'L') {
                step.PB(i);
                ++i;
                all_possible++;
            }
            //if (sz == 200) for(;;);

            if (step.empty()) break;
            if (sz >= k)
            {
                // out << -1 << endl;
                puts("-1");
                return 0;
            }
            hist[sz++] = step;

            for (auto el : step) swap(s[el], s[el + 1]);
        }
        if (all_possible < k)
        {
            //out << -1 << endl;
            puts("-1");
            return 0;
        }

        int source = sz - 1;
        hist.resize(k);
        for (i = k; i-- > 0;)
        {
            if (hist[source].empty()) --source;
            if (!hist[i].empty()) break;
            hist[i].PB(hist[source].back());
            hist[source].pop_back();
        }
        rep(i, k)
        {
            //out << SZ(hist[i]) << " ";
            printf("%d ", SZ(hist[i]));
            for (auto el : hist[i]) printf("%d ", el + 1); // out << el+1 << " ";
            // out << endl;
            puts("");
        }

    }

    return 0;
}


#include <algorithm>
#include <cassert>
#include <cstring>
#include <cmath>
#include <iomanip>
#include <istream>
#include <map>
#include <numeric>
#include <ostream>
#include <queue>
#include <tuple>
#include <set>
#include <sstream>
#include <stack>
#include <unordered_set>
#include <unordered_map>
#include <utility>
#include <vector>

#define rep(i,n) for((i)=0;(i)<(n);(i)++)

#define PB push_back

#define SZ(a) (a).size()

#pragma comment(linker, "/stack:16777216")
using namespace std;
// Powered by caide (code generator, tester, and library code inliner)

class Solution {
public:
    void solve(std::istream& in, std::ostream& out) {
        int n, k, i;
        const int NMAX = 3e3+1;
        char s[NMAX];
        in >> n >> k;
        rep(i, n) in >> s[i];

        vector<vector<int> > hist(k, vector<int>());
        int all_possible = 0;
        int sz = 0;
        while (1) {
            vector<int> step;
            rep(i, n - 1) if (s[i] == 'R' && s[i + 1] == 'L') {
                step.PB(i);
                ++i;
                all_possible++;
            }
            if (step.empty()) break;
            hist[sz++] = step;
            if (sz > k)
            {
                out << -1 << endl;
                return;
            }
            for (auto el : step) swap(s[el], s[el + 1]);
        }
        if (all_possible < k)
        {
            out << -1 << endl;
            return;
        }

        int source = sz - 1;
        hist.resize(k);
        for (i = k; i-- > 0;)
        {
            if (hist[source].empty()) --source;
            if (!hist[i].empty()) break;
            hist[i].PB(hist[source].back());
            hist[source].pop_back();
        }
        rep(i, k)
        {
            out << SZ(hist[i]) << " ";
            for (auto el : hist[i]) out << el+1 << " ";
            out << endl;
        }

    }
};

void solve(std::istream& in, std::ostream& out)
{
    out << std::setprecision(12);
    Solution solution;
    solution.solve(in, out);
}

#include <fstream>
#include <iostream>

int main() {

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

    istream& in = cin;

    ostream& out = cout;

    solve(in, out);
    return 0;
}


#include <stdio.h>
#include <vector>
#include <set>
#include <queue>
#include <limits.h>
#include <algorithm>
#include <math.h>
#include <string.h>
#include <string>

#define MAX 3001

using namespace std;

typedef pair<int, int> pii;
typedef set<int> si;
typedef set<pii> spii;
typedef si::iterator sit;
typedef spii::iterator spiit;
typedef vector<int> vi;
typedef vector<pii> vpii;
typedef vi::iterator vit;
typedef vpii::iterator vpiit;
typedef long long lol;
typedef vector<lol> vlol;
typedef vlol::iterator vlolt;

typedef pair<lol, bool> plolb;
typedef pair<plolb, int> pplolbi;
typedef set<pplolbi> spplolbi;
typedef spplolbi::iterator spplolbit;

int main()
{
  int n, k;
  scanf("%d %d", &n, &k);
  string s(MAX, '\0');
  scanf("%s", s.c_str());
  char dir[MAX] = {};
  for (int i = 0; i < n; i++) {
    dir[i] = s[i];
  }

  vector<vector<int>> turns;
  queue<int> to_check;
  queue<int> new_to_check;
  int total_moves = 0, old_total_moves = 0;
  int min_steps = 0;

  for (int i = 0; i < n - 1; i++) {
    if (dir[i] == 'R' && dir[i + 1] == 'L') {
      to_check.push(i);
    }
  }

  for (int i = 0; i < n * n; i++) {
    vector<int> turn;
    while (!to_check.empty()) {
      int pos = to_check.front();
      to_check.pop();
      if (dir[pos] == 'R' && dir[pos + 1] == 'L') {
        turn.push_back(pos);
        total_moves++;
        dir[pos] = 'L';
        dir[pos + 1] = 'R';
        if (pos > 0 && dir[pos - 1] == 'R') {
          new_to_check.push(pos - 1);
        }
        if (pos < n - 2 && dir[pos + 2] == 'L') {
          new_to_check.push(pos + 1);
        }
      }
    }
    while (!new_to_check.empty()) {
      to_check.push(new_to_check.front());
      new_to_check.pop();
    }

    turns.push_back(turn);
    //printf("%s\n", dir);
    if (total_moves == old_total_moves) {
      min_steps = i;
      break;
    }
    old_total_moves = total_moves;
  }

  //printf("%d\n", total_moves);
  //printf("%d\n", min_steps);
  //HAVE THE MOVES SO SORT OUT THE OUTPUT
  if (total_moves < k || k < min_steps) {
    printf("-1");
  } else {
    //we can do this
    int deficit = k - min_steps;
    for (int i = 0; i < min_steps; i++) {
      int singletons = min(deficit, (int)(turns[i].size()) - 1);
      deficit = deficit - singletons;
      for (int j = 0; j < singletons; j++) {
        printf("1 %d\n", turns[i][j]+1);
      }
      printf("%d ", (turns[i].size() - singletons));
      for (int j = singletons; j < turns[i].size(); j++) {
        printf("%d ", turns[i][j]+1);
      }
      printf("\n");
    }
  }
}


let i = '';
let lines;
process.stdin.on('data', (c) => (i += c));
process.stdin.on('end', () => {
  const { EOL } = require('os');
  lines = i.split(EOL); /*your input text, split by lines*/
  main();
});

function solve(n, k, a) {
  let count = 0;
  let steps = [];
  while (1) {
    let step = [];
    for (let i = 0; i < a.length - 1; ++i) {
      if (a[i] === 'R' && a[i + 1] === 'L') {
        a[i] = 'L'; a[i + 1] = 'R';
        step.push(i + 1);
        ++i;
        ++count;
      }
    }
    if (step.length === 0) break;
    steps.push(step);
  }
  if (k < steps.length || k > count) {
    console.log(-1);
    return;
  }
  for (let i in steps) {
    while (steps[i].length > 1 && k > steps.length - i) {
      console.log('1 ' + steps[i].pop());
      --k;
    }
    console.log(steps[i].length + ' ' + steps[i].join(' '));
    --k;
  }
}

function main() {
  let currentLine = 0;
  const readLine = (_) => lines[currentLine++].split(' ').map((val) => parseInt(val));

  const [n, k] = readLine();
  const a = lines[currentLine++].split('');
  solve(n, k, a);
}


let i = '';
let lines;
process.stdin.on('data', (c) => (i += c));
process.stdin.on('end', () => {
  const { EOL } = require('os');
  lines = i.split(EOL); /*your input text, split by lines*/
  main();
});

function solve(n, k, a) {
  let count = 0;
  let steps = [];
  while (1) {
    let step = [];
    for (let i = 0; i < a.length - 1; ++i) {
      if (a[i] === 'R' && a[i + 1] === 'L') {
        a[i] = 'L'; a[i + 1] = 'R';
        step.push(i + 1);
        ++i;
        ++count;
      }
    }
    if (step.length === 0) break;
    steps.push(step);
  }
  if (k < steps.length || k > count) {
    console.log(-1);
    return;
  }
  for (let i in steps) {
    while (steps[i].length > 1 && k > steps.length - i) {
      console.log('1 ' + steps[i].pop());
      --k;
    }
    process.stdout.write(steps[i].length.toString());
    while(steps[i].length > 0) {
      process.stdout.write(' ' +steps[i].pop());
    }
    console.log('');
  }
}

function main() {
  let currentLine = 0;
  const readLine = (_) => lines[currentLine++].split(' ').map((val) => parseInt(val));

  const [n, k] = readLine();
  const a = lines[currentLine++].split('');
  solve(n, k, a);
}


let i = '';
let lines;
process.stdin.on('data', (c) => (i += c));
process.stdin.on('end', () => {
  const { EOL } = require('os');
  lines = i.split(EOL); /*your input text, split by lines*/
  main();
});

function solve(n, k, a) {
  let count = 0;
  let steps = [];
  while (1) {
    let step = [];
    for (let i = 0; i < a.length - 1; ++i) {
      if (a[i] === 'R' && a[i + 1] === 'L') {
        a[i] = 'L'; a[i + 1] = 'R';
        step.push(i + 1);
        ++i;
        ++count;
      }
    }
    if (step.length === 0) break;
    steps.push(step);
  }
  if (k < steps.length || k > count) {
    console.log(-1);
    return;
  }
  let result = [];
  for (let i in steps) {
    while (steps[i].length > 1 && k > steps.length - i) {
      result.push('1 ' + steps[i].pop());
      --k;
    }
    result.push(steps[i].length + ' ' + steps[i].join(' '));
    --k;
  }
  console.log(result.join('\n'));
}

function main() {
  let currentLine = 0;
  const readLine = (_) => lines[currentLine++].split(' ').map((val) => parseInt(val));

  const [n, k] = readLine();
  const a = lines[currentLine++].split('');
  solve(n, k, a);
}


let i = '';
let lines;
process.stdin.on('data', (c) => (i += c));
process.stdin.on('end', () => {
  const { EOL } = require('os');
  lines = i.split(EOL); /*your input text, split by lines*/
  main();
});

function solve(n, k, a) {
  let count = 0;
  let steps = [];
  while (1) {
    let step = [];
    for (let i = 0; i < a.length - 1; ++i) {
      if (a[i] === 'R' && a[i + 1] === 'L') {
        a[i] = 'L'; a[i + 1] = 'R';
        step.push(i + 1);
        ++i;
        ++count;
      }
    }
    if (step.length === 0) break;
    steps.push(step);
  }
  if (k < steps.length || k > count) {
    console.log(-1);
    return;
  }
  for (let i in steps) {
    while (steps[i].length > 1 || k < steps.length - i) {
      console.log('1 ' + steps[i].pop());
      --k;
    }
    console.log(steps[i].length + ' ' + steps[i].join(' '));
  }
}

function main() {
  let currentLine = 0;
  const readLine = (_) => lines[currentLine++].split(' ').map((val) => parseInt(val));

  const [n, k] = readLine();
  const a = lines[currentLine++].split('');
  solve(n, k, a);
}


let i = '';
let lines;
process.stdin.on('data', (c) => (i += c));
process.stdin.on('end', () => {
  const { EOL } = require('os');
  lines = i.split(EOL); /*your input text, split by lines*/
  main();
});

function solve(n, k, a) {
  let count = 0;
  let steps = [];
  while (1) {
    let step = [];
    for (let i = 0; i < a.length - 1; ++i) {
      if (a[i] === 'R' && a[i + 1] === 'L') {
        a[i] = 'L'; a[i + 1] = 'R';
        step.push(i + 1);
        ++i;
        ++count;
      }
    }
    if (step.length === 0) break;
    steps.push(step);
  }
  if (k < steps.length || k > count) {
    console.log(-1);
    return;
  }
  for (let i in steps) {
    while (steps[i].length > 1 && k > steps.length - i) {
      console.log('1 ' + steps[i].pop());
      --k;
    }
    process.stdout.write(steps[i].length.toString());
    while(steps[i].length > 0) {
      process.stdout.write(' ' +steps[i].pop());
    }
    console.log('');
    --k;
  }
}

function main() {
  let currentLine = 0;
  const readLine = (_) => lines[currentLine++].split(' ').map((val) => parseInt(val));

  const [n, k] = readLine();
  const a = lines[currentLine++].split('');
  solve(n, k, a);
}


let i = '';
let lines;
process.stdin.on('data', (c) => (i += c));
process.stdin.on('end', () => {
  const { EOL } = require('os');
  lines = i.split(EOL); /*your input text, split by lines*/
  main();
});

function solve(n, k, a) {
  let count = 0;
  let steps = [];
  while (1) {
    let step = [];
    for (let i = 0; i < a.length - 1; ++i) {
      if (a[i] === 'R' && a[i + 1] === 'L') {
        a[i] = 'L'; a[i + 1] = 'R';
        step.push(i + 1);
        ++i;
        ++count;
      }
    }
    if (step.length === 0) break;
    steps.push(step);
  }
  if (k < steps.length || k > count) {
    console.log(-1);
    return;
  }
  for (let i in steps) {
    while (steps[i].length > 1 && k < steps.length - i) {
      console.log('1 ' + steps[i].pop());
      --k;
    }
    console.log(steps[i].length + ' ' + steps[i].join(' '));
  }
}

function main() {
  let currentLine = 0;
  const readLine = (_) => lines[currentLine++].split(' ').map((val) => parseInt(val));

  const [n, k] = readLine();
  const a = lines[currentLine++].split('');
  solve(n, k, a);
}


let i = '';
let lines;
process.stdin.on('data', (c) => (i += c));
process.stdin.on('end', () => {
  const { EOL } = require('os');
  lines = i.split(EOL); /*your input text, split by lines*/
  main();
});

function solve(n, k, a) {
  let count = 0;
  let steps = [];
  while (1) {
    let step = [];
    for (let i = 0; i < a.length - 1; ++i) {
      if (a[i] === 'R' && a[i + 1] === 'L') {
        a[i] = 'L'; a[i + 1] = 'R';
        step.push(i + 1);
        ++i;
        ++count;
      }
    }
    if (step.length === 0) break;
    steps.push(step);
  }
  if (k < steps.length || k > count) {
    console.log(-1);
    return;
  }
  for (let i in steps) {
    while (steps[i].length > 1 && k < steps.length - i) {
      console.log('1 ' + steps[i].pop());
      --k;
    }
    process.stdout.write(steps[i].length.toString());
    while(steps[i].length > 0) {
      process.stdout.write(' ' +steps[i].pop());
    }
    console.log('');
  }
}

function main() {
  let currentLine = 0;
  const readLine = (_) => lines[currentLine++].split(' ').map((val) => parseInt(val));

  const [n, k] = readLine();
  const a = lines[currentLine++].split('');
  solve(n, k, a);
}


using System;
using System.Linq;
using System.Collections.Generic;
using System.Diagnostics;
using Debug = System.Diagnostics.Trace;
using SB = System.Text.StringBuilder;
using static System.Math;

using Number = System.Int64;
using static System.Numerics.BigInteger;
namespace Program {
	public class Solver {
		Random rnd = new Random(0);
		public void Solve() {
			var n = ri;
			var k = ri;
			var a = rs.Select(x => x == 'L' ? 0 : 1).ToArray();
			var inv = 0;
			for (int i = 0; i < n; i++)
				for (int j = i + 1; j < n; j++) if (a[i] > a[j]) inv++;
			Debug.WriteLine(inv);
			if (k > inv) {
				Console.WriteLine(-1);
				return;
			}
			var s = new SortedSet<int>();
			for (int i = 0; i + 1 < n; i++) if (a[i] > a[i + 1]) s.Add(i);
			var ans = new List<List<int>>();
			for (int rem = k; rem > 0; rem--) {
				var cnt = s.Count;
				var next = inv - Max(inv - cnt, rem - 1);
				var res = new List<int>();
				// Debug.WriteLine(a.AsJoinedString());
				// Debug.WriteLine(s.AsJoinedString());
				foreach (var x in s) {
					res.Add(x + 1);
					Swap(ref a[x], ref a[x + 1]);
					inv--;
					if (res.Count == next) break;
				}
				ans.Add(res);
				foreach (var x in res) {
					s.Remove(x - 1);
					if (x + 1 < n && a[x] > a[x + 1]) s.Add(x);
				}

			}
			Debug.WriteLine(a.AsJoinedString());
			if (inv != 0) Console.WriteLine(-1);
			else {
				foreach (var x in ans) {
					Console.WriteLine("{0} {1}", x.Count, x.AsJoinedString());
				}
			}
		}
		const long INF = 1L << 60;
		static int[] dx = { -1, 0, 1, 0 };
		static int[] dy = { 0, 1, 0, -1 };
		int ri { get { return sc.Integer(); } }
		long rl { get { return sc.Long(); } }
		double rd { get { return sc.Double(); } }
		string rs { get { return sc.Scan(); } }
		public IO.StreamScanner sc = new IO.StreamScanner(Console.OpenStandardInput());
		static T[] Enumerate<T>(int n, Func<int, T> f) {
			var a = new T[n]; for (int i = 0; i < a.Length; ++i) a[i] = f(i); return a;
		}
		static T[][] Enumerate<T>(int n, int m, Func<int, int, T> f) {
			return Enumerate(n, x => Enumerate(m, y => f(x, y)));
		}
		static public void Swap<T>(ref T a, ref T b) { var tmp = a; a = b; b = tmp; }
	}
}

#region main
static class Ex {
	static public string AsString(this IEnumerable<char> ie) { return new string(ie.ToArray()); }
	static public string AsJoinedString<T>(this IEnumerable<T> ie, string st = " ") {
		return string.Join(st, ie);
	}
	static public void Main() {
		Console.SetOut(new Program.IO.Printer(Console.OpenStandardOutput()) { AutoFlush = false });
		var solver = new Program.Solver();
		//*
		var t = new System.Threading.Thread(solver.Solve, 200000000);
		t.Start();
		t.Join();
		//*/
		// solver.Solve();
		Console.Out.Flush();
	}
}
#endregion
#region Ex
namespace Program.IO {
	using System.IO;
	using System.Text;
	using System.Globalization;

	public class Printer : StreamWriter {
		public override IFormatProvider FormatProvider { get { return CultureInfo.InvariantCulture; } }
		public Printer(Stream stream) : base(stream, new UTF8Encoding(false, true)) { }
	}

	public class StreamScanner {
		public StreamScanner(Stream stream) { str = stream; }

		public readonly Stream str;
		private readonly byte[] buf = new byte[1024];
		private int len, ptr;
		public bool isEof = false;
		public bool IsEndOfStream { get { return isEof; } }

		private byte read() {
			if (isEof) return 0;
			if (ptr >= len) {
				ptr = 0;
				if ((len = str.Read(buf, 0, 1024)) <= 0) {
					isEof = true;
					return 0;
				}
			}
			return buf[ptr++];
		}

		public char Char() {
			byte b = 0;
			do b = read(); while ((b < 33 || 126 < b) && !isEof);
			return (char)b;
		}
		public string Scan() {
			var sb = new StringBuilder();
			for (var b = Char(); b >= 33 && b <= 126; b = (char)read()) sb.Append(b);
			return sb.ToString();
		}
		public string ScanLine() {
			var sb = new StringBuilder();
			for (var b = Char(); b != '\n' && b != 0; b = (char)read()) if (b != '\r') sb.Append(b);
			return sb.ToString();
		}
		public long Long() { return isEof ? long.MinValue : long.Parse(Scan()); }
		public int Integer() { return isEof ? int.MinValue : int.Parse(Scan()); }
		public double Double() { return isEof ? double.NaN : double.Parse(Scan(), CultureInfo.InvariantCulture); }
	}
}

#endregion


using System;
using System.Linq;
using System.Collections.Generic;
using System.Diagnostics;
using Debug = System.Diagnostics.Trace;
using SB = System.Text.StringBuilder;
using static System.Math;

using Number = System.Int64;
using static System.Numerics.BigInteger;
namespace Program {
	public class Solver {
		Random rnd = new Random(0);
		public void Solve() {
			var n = ri;
			var k = ri;
			var a = rs.Select(x => x == 'L' ? 0 : 1).ToArray();
			var inv = 0;
			for (int i = 0; i < n; i++)
				for (int j = i + 1; j < n; j++) if (a[i] > a[j]) inv++;
			Debug.WriteLine(inv);
			if (k > inv) {
				Console.WriteLine(-1);
				return;
			}
			var s = new SortedSet<int>();
			for (int i = 0; i + 1 < n; i++) if (a[i] > a[i + 1]) s.Add(i);
			var ans = new List<List<int>>();
			for (int rem = k; rem > 0; rem--) {
				var cnt = s.Count;
				var next = inv - Max(inv - cnt, rem - 1);
				var res = new List<int>();
				Debug.WriteLine(a.AsJoinedString());
				Debug.WriteLine(s.AsJoinedString());
				foreach (var x in s) {
					res.Add(x + 1);
					Swap(ref a[x], ref a[x + 1]);
					inv--;
					if (res.Count == next) break;
				}
				ans.Add(res);
				foreach (var x in res) {
					s.Remove(x - 1);
					if (x - 2 >= 0 && a[x - 2] > a[x - 1]) s.Add(x - 2);
					if (x + 1 < n && a[x] > a[x + 1]) s.Add(x);
				}

			}
			Debug.WriteLine(a.AsJoinedString());
			if (inv != 0) Console.WriteLine(-1);
			else {
				foreach (var x in ans) {
					Console.WriteLine("{0} {1}", x.Count, x.AsJoinedString());
				}
			}
		}
		const long INF = 1L << 60;
		static int[] dx = { -1, 0, 1, 0 };
		static int[] dy = { 0, 1, 0, -1 };
		int ri { get { return sc.Integer(); } }
		long rl { get { return sc.Long(); } }
		double rd { get { return sc.Double(); } }
		string rs { get { return sc.Scan(); } }
		public IO.StreamScanner sc = new IO.StreamScanner(Console.OpenStandardInput());
		static T[] Enumerate<T>(int n, Func<int, T> f) {
			var a = new T[n]; for (int i = 0; i < a.Length; ++i) a[i] = f(i); return a;
		}
		static T[][] Enumerate<T>(int n, int m, Func<int, int, T> f) {
			return Enumerate(n, x => Enumerate(m, y => f(x, y)));
		}
		static public void Swap<T>(ref T a, ref T b) { var tmp = a; a = b; b = tmp; }
	}
}

#region main
static class Ex {
	static public string AsString(this IEnumerable<char> ie) { return new string(ie.ToArray()); }
	static public string AsJoinedString<T>(this IEnumerable<T> ie, string st = " ") {
		return string.Join(st, ie);
	}
	static public void Main() {
		Console.SetOut(new Program.IO.Printer(Console.OpenStandardOutput()) { AutoFlush = false });
		var solver = new Program.Solver();
		//*
		var t = new System.Threading.Thread(solver.Solve, 200000000);
		t.Start();
		t.Join();
		//*/
		// solver.Solve();
		Console.Out.Flush();
	}
}
#endregion
#region Ex
namespace Program.IO {
	using System.IO;
	using System.Text;
	using System.Globalization;

	public class Printer : StreamWriter {
		public override IFormatProvider FormatProvider { get { return CultureInfo.InvariantCulture; } }
		public Printer(Stream stream) : base(stream, new UTF8Encoding(false, true)) { }
	}

	public class StreamScanner {
		public StreamScanner(Stream stream) { str = stream; }

		public readonly Stream str;
		private readonly byte[] buf = new byte[1024];
		private int len, ptr;
		public bool isEof = false;
		public bool IsEndOfStream { get { return isEof; } }

		private byte read() {
			if (isEof) return 0;
			if (ptr >= len) {
				ptr = 0;
				if ((len = str.Read(buf, 0, 1024)) <= 0) {
					isEof = true;
					return 0;
				}
			}
			return buf[ptr++];
		}

		public char Char() {
			byte b = 0;
			do b = read(); while ((b < 33 || 126 < b) && !isEof);
			return (char)b;
		}
		public string Scan() {
			var sb = new StringBuilder();
			for (var b = Char(); b >= 33 && b <= 126; b = (char)read()) sb.Append(b);
			return sb.ToString();
		}
		public string ScanLine() {
			var sb = new StringBuilder();
			for (var b = Char(); b != '\n' && b != 0; b = (char)read()) if (b != '\r') sb.Append(b);
			return sb.ToString();
		}
		public long Long() { return isEof ? long.MinValue : long.Parse(Scan()); }
		public int Integer() { return isEof ? int.MinValue : int.Parse(Scan()); }
		public double Double() { return isEof ? double.NaN : double.Parse(Scan(), CultureInfo.InvariantCulture); }
	}
}

#endregion


using System;
using System.Linq;
using System.Collections.Generic;
using System.Diagnostics;
using Debug = System.Diagnostics.Trace;
using SB = System.Text.StringBuilder;
using static System.Math;

using Number = System.Int64;
using static System.Numerics.BigInteger;
namespace Program {
	public class Solver {
		Random rnd = new Random(0);
		public void Solve() {
			var n = ri;
			var k = ri;
			var a = rs.Select(x => x == 'L' ? 0 : 1).ToArray();
			var inv = 0;
			for (int i = 0; i < n; i++)
				for (int j = i + 1; j < n; j++) if (a[i] > a[j]) inv++;
			Debug.WriteLine(inv);
			if (k > inv) {
				Console.WriteLine(-1);
				return;
			}
			var s = new SortedSet<int>();
			for (int i = 0; i + 1 < n; i++) if (a[i] > a[i + 1]) s.Add(i);
			var ans = new int[k][];
			for (int rem = k; rem > 0; rem--) {
				var cnt = s.Count;
				var next = inv - Max(inv - cnt, rem - 1);
				var res = new int[next];
				var ptr = 0;
				Debug.WriteLine(a.AsJoinedString());
				Debug.WriteLine(s.AsJoinedString());
				foreach (var x in s) {
					res[ptr] = x + 1;
					ptr++;
					Swap(ref a[x], ref a[x + 1]);
					inv--;
					if (ptr == next) break;
				}
				ans[k - rem] = res;
				foreach (var x in res) {
					s.Remove(x - 1);
					if (x - 2 >= 0 && a[x - 2] > a[x - 1]) s.Add(x - 2);
					if (x + 1 < n && a[x] > a[x + 1]) s.Add(x);
				}

			}
			Debug.WriteLine(a.AsJoinedString());
			if (inv != 0) Console.WriteLine(-1);
			else {
				foreach (var x in ans) {
					Console.WriteLine("{0} {1}", x.Length, x.AsJoinedString());
				}
			}
		}
		const long INF = 1L << 60;
		static int[] dx = { -1, 0, 1, 0 };
		static int[] dy = { 0, 1, 0, -1 };
		int ri { get { return sc.Integer(); } }
		long rl { get { return sc.Long(); } }
		double rd { get { return sc.Double(); } }
		string rs { get { return sc.Scan(); } }
		public IO.StreamScanner sc = new IO.StreamScanner(Console.OpenStandardInput());
		static T[] Enumerate<T>(int n, Func<int, T> f) {
			var a = new T[n]; for (int i = 0; i < a.Length; ++i) a[i] = f(i); return a;
		}
		static T[][] Enumerate<T>(int n, int m, Func<int, int, T> f) {
			return Enumerate(n, x => Enumerate(m, y => f(x, y)));
		}
		static public void Swap<T>(ref T a, ref T b) { var tmp = a; a = b; b = tmp; }
	}
}

#region main
static class Ex {
	static public string AsString(this IEnumerable<char> ie) { return new string(ie.ToArray()); }
	static public string AsJoinedString<T>(this IEnumerable<T> ie, string st = " ") {
		return string.Join(st, ie);
	}
	static public void Main() {
		Console.SetOut(new Program.IO.Printer(Console.OpenStandardOutput()) { AutoFlush = false });
		var solver = new Program.Solver();
		//*
		// var t = new System.Threading.Thread(solver.Solve, 200000000);
		// t.Start();
		// t.Join();
		//*/
		solver.Solve();
		Console.Out.Flush();
	}
}
#endregion
#region Ex
namespace Program.IO {
	using System.IO;
	using System.Text;
	using System.Globalization;

	public class Printer : StreamWriter {
		public override IFormatProvider FormatProvider { get { return CultureInfo.InvariantCulture; } }
		public Printer(Stream stream) : base(stream, new UTF8Encoding(false, true)) { }
	}

	public class StreamScanner {
		public StreamScanner(Stream stream) { str = stream; }

		public readonly Stream str;
		private readonly byte[] buf = new byte[1024];
		private int len, ptr;
		public bool isEof = false;
		public bool IsEndOfStream { get { return isEof; } }

		private byte read() {
			if (isEof) return 0;
			if (ptr >= len) {
				ptr = 0;
				if ((len = str.Read(buf, 0, 1024)) <= 0) {
					isEof = true;
					return 0;
				}
			}
			return buf[ptr++];
		}

		public char Char() {
			byte b = 0;
			do b = read(); while ((b < 33 || 126 < b) && !isEof);
			return (char)b;
		}
		public string Scan() {
			var sb = new StringBuilder();
			for (var b = Char(); b >= 33 && b <= 126; b = (char)read()) sb.Append(b);
			return sb.ToString();
		}
		public string ScanLine() {
			var sb = new StringBuilder();
			for (var b = Char(); b != '\n' && b != 0; b = (char)read()) if (b != '\r') sb.Append(b);
			return sb.ToString();
		}
		public long Long() { return isEof ? long.MinValue : long.Parse(Scan()); }
		public int Integer() { return isEof ? int.MinValue : int.Parse(Scan()); }
		public double Double() { return isEof ? double.NaN : double.Parse(Scan(), CultureInfo.InvariantCulture); }
	}
}

#endregion


using System;
using System.Linq;
using System.Collections.Generic;
using System.Diagnostics;
using Debug = System.Diagnostics.Trace;
using SB = System.Text.StringBuilder;
using static System.Math;

using Number = System.Int64;
using static System.Numerics.BigInteger;
namespace Program {
	public class Solver {
		Random rnd = new Random(0);
		public void Solve() {
			var n = ri;
			var k = ri;
			var a = rs.Select(x => x == 'L' ? 0 : 1).ToArray();
			var inv = 0;
			for (int i = 0; i < n; i++)
				for (int j = i + 1; j < n; j++) if (a[i] > a[j]) inv++;
			Debug.WriteLine(inv);
			if (k > inv) {
				Console.WriteLine(-1);
				return;
			}
			var s = new SortedSet<int>();
			for (int i = 0; i + 1 < n; i++) if (a[i] > a[i + 1]) s.Add(i);
			var ans = new List<List<int>>();
			for (int rem = k; rem > 0; rem--) {
				var cnt = s.Count;
				var next = inv - Max(inv - cnt, rem - 1);
				var res = new List<int>();
				Debug.WriteLine(a.AsJoinedString());
				Debug.WriteLine(s.AsJoinedString());
				foreach (var x in s) {
					res.Add(x + 1);
					Swap(ref a[x], ref a[x + 1]);
					inv--;
					if (res.Count == next) break;
				}
				ans.Add(res);
				foreach (var x in res) {
					s.Remove(x - 1);
					if (x - 2 >= 0 && a[x - 2] > a[x - 1]) s.Add(x - 2);
					if (x + 1 < n && a[x] > a[x + 1]) s.Add(x);
				}

			}
			Debug.WriteLine(a.AsJoinedString());
			if (inv != 0) Console.WriteLine(-1);
			else {
				foreach (var x in ans) {
					Console.WriteLine("{0} {1}", x.Count, x.AsJoinedString());
				}
			}
		}
		const long INF = 1L << 60;
		static int[] dx = { -1, 0, 1, 0 };
		static int[] dy = { 0, 1, 0, -1 };
		int ri { get { return sc.Integer(); } }
		long rl { get { return sc.Long(); } }
		double rd { get { return sc.Double(); } }
		string rs { get { return sc.Scan(); } }
		public IO.StreamScanner sc = new IO.StreamScanner(Console.OpenStandardInput());
		static T[] Enumerate<T>(int n, Func<int, T> f) {
			var a = new T[n]; for (int i = 0; i < a.Length; ++i) a[i] = f(i); return a;
		}
		static T[][] Enumerate<T>(int n, int m, Func<int, int, T> f) {
			return Enumerate(n, x => Enumerate(m, y => f(x, y)));
		}
		static public void Swap<T>(ref T a, ref T b) { var tmp = a; a = b; b = tmp; }
	}
}

#region main
static class Ex {
	static public string AsString(this IEnumerable<char> ie) { return new string(ie.ToArray()); }
	static public string AsJoinedString<T>(this IEnumerable<T> ie, string st = " ") {
		return string.Join(st, ie);
	}
	static public void Main() {
		Console.SetOut(new Program.IO.Printer(Console.OpenStandardOutput()) { AutoFlush = false });
		var solver = new Program.Solver();
		//*
		// var t = new System.Threading.Thread(solver.Solve, 200000000);
		// t.Start();
		// t.Join();
		//*/
		solver.Solve();
		Console.Out.Flush();
	}
}
#endregion
#region Ex
namespace Program.IO {
	using System.IO;
	using System.Text;
	using System.Globalization;

	public class Printer : StreamWriter {
		public override IFormatProvider FormatProvider { get { return CultureInfo.InvariantCulture; } }
		public Printer(Stream stream) : base(stream, new UTF8Encoding(false, true)) { }
	}

	public class StreamScanner {
		public StreamScanner(Stream stream) { str = stream; }

		public readonly Stream str;
		private readonly byte[] buf = new byte[1024];
		private int len, ptr;
		public bool isEof = false;
		public bool IsEndOfStream { get { return isEof; } }

		private byte read() {
			if (isEof) return 0;
			if (ptr >= len) {
				ptr = 0;
				if ((len = str.Read(buf, 0, 1024)) <= 0) {
					isEof = true;
					return 0;
				}
			}
			return buf[ptr++];
		}

		public char Char() {
			byte b = 0;
			do b = read(); while ((b < 33 || 126 < b) && !isEof);
			return (char)b;
		}
		public string Scan() {
			var sb = new StringBuilder();
			for (var b = Char(); b >= 33 && b <= 126; b = (char)read()) sb.Append(b);
			return sb.ToString();
		}
		public string ScanLine() {
			var sb = new StringBuilder();
			for (var b = Char(); b != '\n' && b != 0; b = (char)read()) if (b != '\r') sb.Append(b);
			return sb.ToString();
		}
		public long Long() { return isEof ? long.MinValue : long.Parse(Scan()); }
		public int Integer() { return isEof ? int.MinValue : int.Parse(Scan()); }
		public double Double() { return isEof ? double.NaN : double.Parse(Scan(), CultureInfo.InvariantCulture); }
	}
}

#endregion


using System;
using System.Collections.Generic;
class Program
{
	static void Main(string[] args)
	{
		string[] str = Console.ReadLine().Split();
		string S = Console.ReadLine();
		int N = int.Parse(str[0]);
		int K = int.Parse(str[1]);
		int max = 0;
		int min = 0;
		int[]A = new int[N];
		int LC = 0;
		int RC = 0;
		int RMC = 0;
		var list = new List<int[]>();
		for(var i=0;i<N;i++){
			if(S.Substring(i,1)=="L"){
				A[i] = 1;
				LC++;
				max += RC;
				min = Math.Max(RMC,min);
				list.Add(new int[3]{i,RMC,0});
			} else {
				RC++;
				RMC++;
			}
		}
		if(K > max || K < min){
			Console.Write("-1");
		} else {
                int maxa = 0;
                for(var i=list.Count-1;i>=0;i--){
                maxa = Math.Max(list[i][1],maxa);
              	list[i][2] = maxa;
                //Console.WriteLine(list[i][0]+" "+list[i][1]+" "+list[i][2]);
		    }
          	bool flag2 = false;
          	int t = 0;
            for(var i=0;i<K;i++){
                for(var j=0;j<list.Count;j++){
                    int ta = 0;
                    if(j<list.Count-1){
                        ta = list[j+1][2];
                    }
                    if(list[j][1] >= 1 && i+Math.Max(list[j][1],ta)==K){
                        flag2 = true;
                        break;
                    }
                    if(list[j][1]>=1){
                       	Console.WriteLine("1 "+(list[j][0]));
                       	t++;
                        list[j][0]--;
                        list[j][1]--;
                        break;
                    }
                }
              	if(flag2==true){
                  break;
                }
            }
            for(var i=t;i<K;i++){
                var list2 = new List<int>();
                for(var j=0;j<list.Count;j++){
                    if(list[j][1]>=1){
                        list2.Add(list[j][0]);
                    }
                    list[j][0]--;
                    list[j][1]--;
                }
                Console.Write(list2.Count);
                for(var j=0;j<list2.Count;j++){
                    Console.Write(" "+list2[j]);
                }
                Console.WriteLine();
		    }
		}
	}
}


using System;
using System.Collections.Generic;
class Program
{
	static void Main(string[] args)
	{
		string[] str = Console.ReadLine().Split();
		string S = Console.ReadLine();
		int N = int.Parse(str[0]);
		int K = int.Parse(str[1]);
		int max = 0;
		int min = 0;
		int[]A = new int[N];
		int LC = 0;
		int RC = 0;
		int RMC = 0;
		var list = new List<int[]>();
		for(var i=0;i<N;i++){
			if(S.Substring(i,1)=="L"){
				A[i] = 1;
				LC++;
				max += RC;
				min = Math.Max(RMC,min);
				list.Add(new int[3]{i,RMC,0});
				//if(LC>=2){
				//    RC = 0;
				//	RMC = 0;
				//}
			} else {
				RC++;
				RMC++;
			}
		}
		if(K > max || K < min){
			Console.Write("-1");
		} else {
          int maxa = 0;
		    for(var i=list.Count-1;i>=0;i--){
              maxa = Math.Max(list[i][1],maxa);
              	list[i][2] = maxa;
		        //Console.WriteLine(list[i][0]+" "+list[i][1]+" "+list[i][2]);
		    }
          	bool flag2 = false;
          	int t = 0;
            for(var i=0;i<K-min;i++){
                for(var j=0;j<list.Count;j++){
                    if(list[j][1]>=1){
                       	Console.WriteLine("1 "+(list[j][0]));
                       	t++;
                        list[j][0]--;
                        list[j][1]--;
						if((list[j][1] >= 1 && i-list[j][2]==0) || (list[j][1]==0 && (j==list.Count-1 || i-list[j+1][2]==0))){
						    min = list[j][2];
							flag2 = true;
 						}
                        break;
                    }
                    if(j==list.Count-1){
                        j = -1;
                    }
                }
              	if(flag2==true){
                  break;
                }
            }
            for(var i=t;i<K;i++){
                var list2 = new List<int>();
		        for(var j=0;j<list.Count;j++){
		            if(list[j][1]>=1){
		                list2.Add(list[j][0]);
		            }
		            list[j][0]--;
		            list[j][1]--;
		        }
                Console.Write(list2.Count);
                for(var j=0;j<list2.Count;j++){
                    Console.Write(" "+list2[j]);
                }
                Console.WriteLine();
		    }
		}
	}
}


using System;
using System.Collections.Generic;
class Program
{
	static void Main(string[] args)
	{
		string[] str = Console.ReadLine().Split();
		string S = Console.ReadLine();
		int N = int.Parse(str[0]);
		int K = int.Parse(str[1]);
		var list = new List<int[]>();
		int RC = 0;
		int sum = 0;
		for(var i=N-1;i>=0;i--){
            if(S.Substring(i,1)=="R"){
                RC++;
                list.Add(new int[2]{i,N-RC});
                sum += N-RC-i;
            }
		}
		//for(var i=0;i<list.Count;i++){
        //    Console.WriteLine(list[i][0]+" "+list[i][1]);
		//}
		if(K > sum){
            Console.Write("-1");
		} else {
		    var ans = new List<List<int>>();
            while(true){
                var list2 = new List<int>();
                var mr = 99999;
                for(var i=0;i<list.Count;i++){
                    if(list[i][0]<list[i][1] && list[i][0] < mr - 1){
                        list2.Add(list[i][0]+1);
                        sum--;
                        mr = list[i][0];
                        list[i][0]++;
                        if(sum < K){
                            break;
                        }
                    } else {
                        mr = list[i][0];
                    }
                }
                if(list2.Count>0){
                    ans.Add(list2);
                    K--;
                }
                if(K==0 && sum > 0){
                    Console.Write("-1");
                    break;
                } else if(K==0 && sum == 0){
                    for(var i=0;i<ans.Count;i++){
                        Console.Write(ans[i].Count);
                        for(var j=ans[i].Count-1;j>=0;j--){
                            Console.Write(" "+ans[i][j]);
                        }
                        Console.WriteLine();
                    }
                    break;
                }
            }
		}
	}
}


using System;
using System.Collections.Generic;
class Program
{
	static void Main(string[] args)
	{
		string[] str = Console.ReadLine().Split();
		string S = Console.ReadLine();
		int N = int.Parse(str[0]);
		int K = int.Parse(str[1]);
		int max = 0;
		int min = 0;
		int[]A = new int[N];
		int LC = 0;
		int RC = 0;
		int RMC = 0;
		var list = new List<int[]>();
		for(var i=0;i<N;i++){
			if(S.Substring(i,1)=="L"){
				A[i] = 1;
				LC++;
				max += RC;
				min = Math.Max(RMC,min);
				list.Add(new int[3]{i,RMC,0});
				//if(LC>=2){
				//    RC = 0;
				//	RMC = 0;
				//}
			} else {
				RC++;
				RMC++;
			}
		}
		if(K > max || K < min){
			Console.Write("-1");
		} else {
          int maxa = 0;
		    for(var i=list.Count-1;i>=0;i--){
              maxa = Math.Max(list[i][1],maxa);
              	list[i][2] = maxa;
		        //Console.WriteLine(list[i][0]+" "+list[i][1]+" "+list[i][2]);
		    }
          	bool flag2 = false;
          	int t = 0;
            for(var i=0;i<K-min;i++){
                for(var j=0;j<list.Count;j++){
                    if(list[j][1]>=1){
                       	Console.WriteLine("1 "+(list[j][0]));
                       	t++;
                        list[j][0]--;
                        list[j][1]--;
						if((list[j][1] >= 1 && i-list[i][2]==0) || (list[j][1]==0 && i-list[i][2]==1)){
						    min = list[i][2];
							flag2 = true;
 						}
                        break;
                    }
                    if(j==list.Count-1){
                        j = -1;
                    }
                }
              	if(flag2==true){
                  break;
                }
            }
            for(var i=t;i<K;i++){
                var list2 = new List<int>();
		        for(var j=0;j<list.Count;j++){
		            if(list[j][1]>=1){
		                list2.Add(list[j][0]);
		            }
		            list[j][0]--;
		            list[j][1]--;
		        }
                Console.Write(list2.Count);
                for(var j=0;j<list2.Count;j++){
                    Console.Write(" "+list2[j]);
                }
                Console.WriteLine();
		    }
		}
	}
}


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

#define N 110

int a[N], l[N], r[N], sum[N], S[N], ans, n, m;

int main() {
	scanf("%d%d", &n, &m);
	for (int i = 1; i <= n; i ++) {
		scanf("%d", &a[i]);
		S[i] = S[i - 1] + a[i];
	}
	for (int i = 1; i <= m; i ++) {
		scanf("%d%d", &l[i], &r[i]);
		sum[i] = S[r[i]] - S[l[i] - 1];
	}
	sort (sum + 1, sum + m + 1);
	for (int i = m; i >= 1; i --) {
		if (sum[i] <= 0) break;
		else ans += sum[i];
	}
	printf("%d", ans);
}


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

int m, n, a[105], b, l, r, ans, i;

int main(){
	scanf("%d %d", &n, &m);
	for(i = 1; i <= n; i++){
		scanf("%d", &b);
		a[i] = a[i - 1] + b;
	}
	while(m--){
		scanf("%d %d", &l, &r);
		if(a[r] > a[l - 1]) ans += a[r] - a[l - 1];
	}
	cout << ans;
}


// 381_B_div2.cpp: ���������� ����� ����� ��� ����������� ����������.
//

#include "windows.h"
#include <conio.h>
#include <math.h>
#include <iostream>
#include <stdio.h>

using namespace std;

int main()
{
	int n = 0, m = 0, l = 0, r =0, sum = 0, res = 0;
	cin >> n >> m;
	int mas[1001];
	for(int i = 1; i <= n; i++)
		cin >> mas[i];
	for(int i = 0 ; i < m; i++){
		cin >> l >> r;
		sum = 0;
		for(int j = l; j <= r; j++){
			sum = sum + mas[j];
		}
		if(sum > 0)
			res += sum;
	}
	cout << res<< endl;
	//system("pause");
	return 0;
}


// 381_B_div2.cpp: ���������� ����� ����� ��� ����������� ����������.
//

#include "windows.h"
#include <conio.h>
#include <math.h>
#include <iostream>
#include <stdio.h>

using namespace std;

int main()
{
	int n = 0, m = 0, l = 0, r =0, sum = 0, res = 0;
	cin >> n >> m;
	int mas[1001];
	for(int i = 1; i <= n; i++)
		cin >> mas[i];
	for(int i = 0 ; i < m; i++){
		cin >> l >> r;
		sum = 0;
		for(int j = l; j <= r; j++){
			sum = sum + mas[j];
		}
		if(sum > 0)
			res += sum;
	}
	cout << res<< endl;
	system("pause");
	return 0;
}


#include<bits/stdc++.h>
#define lli long long int
#define min3(a,b,c) min(a,min(b,c))
using namespace std;

int main()
{
   lli n,a,b,c,d,r,x,y,z;
   cin>>n>>a>>b>>c;
   r=n%4;
   d=4-r;
   if(d==3)
   {
       x = 3*a;
       y = a+b;
       z=c;
       cout<<min3(x,y,z)<<endl;
   }
   else if(d==2)
   {
       x=2*a;
       y=b;
       z=2*c;
       cout<<min3(x,y,z)<<endl;
   }
   else if(d==1)
   {
       x=a;
       y=b+c;
       cout<<min(x,y)<<endl;
   }
   else
    cout<<0<<endl;
    return 0;
}


#include<bits/stdc++.h>
#define ll long long int
using namespace std;
#define MOD 1000000007
#define MAX 100005

int n, m, a[109], cnt[109], l[109], r[109];
ll result(int i)
{
    if(i>m)
    {
        ll ret=0;
        for(int j=1; j<=n; j++) ret+=(a[j]*cnt[j]*1ll);
        return ret;
    }
    else
    {
        ll ret=0;
        ret=result(i+1);
        for(int j=l[i]; j<=r[i]; j++) cnt[j]++;
        ret = max(ret, result(i+1));
        for(int j=l[i]; j<=r[i]; j++) cnt[j]--;
        return ret;
    }
}
int main()
{

    cin>>n>>m;
    for(int i=1; i<=n; i++) cin>>a[i];
    for(int i=1; i<=m; i++) cin>>l[i]>>r[i];

    cout<<result(1)<<endl;
    return 0;
}