#include <bits/stdc++.h>
using namespace std;
/* * * *   * * *   	* * * */
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, pair<ll, ll>> pll;
#define ms(a,v) memset(a,v,sizeof a)
/* * * *   * * *   	* * * */
/* *
 *
 * I love Ylva Eriksson
 *
 * */
int ts(char c) {return c == 'L' ? 0: 1;}
int main(){
	ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	int n, K; cin>>n>>K;
	string s; cin>>s;
	vector<pii> a;
	a.push_back({ts(s[0]), 1});
	for(int i=1; i<n; ++i){
		if(ts(s[i]) == a.back().first)  a.back().second++;
		else a.push_back({ts(s[i]), 1});
	}
	int m = a.size(), idx, last;
	if(a[m-1].first)  last = m-2, idx = a[m-2].second;
	else last = m-1, idx = 0;
	vector<int> turns;
	for(int i=m-2;i>=0; --i) {
		if(a[i].first){
			int sum = 0;
			for(int j = i+1; j<=last; ++j)  sum+=a[j].second;
			for(int j=0, plus = 0;j <sum; ++j, plus++)
				turns.push_back(n-idx-sum + plus);
			for(int j=0; j<a[i].second-1; ++j){
				for(int k=0; k<sum; k++)
					turns.push_back(turns[turns.size() - sum] - 1);
			}
			idx+=a[i].second;
			swap(a[i], a[last]);
			last--;
		}
	}
	//for(auto i: a) cout<<i.first<<" "<<i.second<<endl;
	//for(int i: turns) cout<<i<<endl;
	m = turns.size();
	if(m < K || m > K*(n/2)){ cout<<-1<<endl; return 0; }
	idx = 0;
	int tot = m/K, add = m%K;
	for(int i=0; i<K; ++i){
		cout<<min(n/2, tot + add)<<" ";
		for(int i=0; i<tot; ++i) cout<<turns[idx++]<<" ";
		for(int i = tot; i<n/2 && add > 0; ++i, add--) cout<<turns[idx++]<<" ";
		cout<<endl;
	}
	return 0;
}


#include<iostream>
#include<cstdio>
#include<string>
#include<ctime>
#include<cmath>
#include<cstring>
#include<algorithm>
#include<stack>
#include<climits>
#include<queue>
#include<map>
#include<set>
#include<sstream>
#include<unordered_map>
using namespace std;
const int N=1e6+100;
char s[N];
vector<int>ans[N];
int cnt=0,tot=0,n,k;
int main()
{
	scanf("%d%d",&n,&k);
	scanf("%s", s);
	bool flag;
	do
	{
		flag=false;
		cnt++;//���ٷ�����
		for(int i=0;i<n-1;i++)
			if(s[i]=='R'&&s[i+1]=='L')
			{
				swap(s[i],s[i+1]);
				ans[cnt].push_back(i+1);
				flag=true;
				i++;
				tot++;//�ܲ�����
			}
	}while(flag);
	cnt--;
	if(cnt>k||tot<k)
	{
		cout << -1 << endl;
		return 0;
	}
	for(int i=1;i<=cnt;i++)
	{
		while(k>(cnt-i+1)&&ans[i].size())//�������ж�ʣ�µķ����뻹��Ҫ����ĸ���k�Ĵ�С��ϵ
		{
			printf("%d %d\n",1,ans[i].back());
			ans[i].pop_back();
			k--;
		}
		if(ans[i].size())
		{
			printf("%d",ans[i].size());
			for(int j=0;j<ans[i].size();j++)
				printf(" %d",ans[i][j]);
			printf("\n");
			k--;
		}
	}

    return 0;
}


#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
const int maxn = 3e6 + 50;
vector<int> ans[maxn];
int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	int n,k;
	cin >> n >> k;
	string s;
	cin >> s;
	int maxcnt = 0,mincnt = 0;
	string t = s;
	int flag;
	do
	{
		flag = 0;
		mincnt++;
		for(int j = 0; j < n - 1; j++)
		{
			if(t[j] == 'R' && t[j+1] == 'L')
			{
				maxcnt++;//��������
				ans[mincnt].push_back(j+1);//����һ�ֿ��Է��ļ�¼
				swap(t[j],t[j+1]);
				flag = 1;
				j++;
			}
		}
	}while(flag);
	mincnt--;
	if(mincnt > k || k > maxcnt)
	{
		cout << -1 << endl;
		return 0;
	}
	for(int i = 1; i <= mincnt; i++)//�������е�����
	{
		while(k > mincnt - i+ 1 && ans[i].size())
		{//k�࣬��Ҫ���1���������ʱ��
			cout << 1 << " " << ans[i].back();
			ans[i].pop_back();
			k--;//ʱ��-1
		}
		if(ans[i].size())
		{
			cout << ans[i].size();
			for(int j = 0; j < ans[i].size(); j++)
			cout << " " << ans[i][j];
			cout << endl;
			k--;
		}
	}
	return 0;
}


#include <iostream>
#include <algorithm>
#include <string.h>
#include <map>
using namespace std;
const int maxn = 3e6 + 50;
int ans[maxn];
int z = 1;
int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	int n,k;
	cin >> n >> k;
	string s;
	cin >> s;
	int maxcnt = 0,mincnt = 0;
	string t = s;
	while(1)
	{
		int flag = 0;
		for(int j = 0; j < n - 1; j++)
		{
			if(t[j] == 'R' && t[j+1] == 'L')
			{
				maxcnt++;
				ans[z] = j + 1;
				z++;
				t[j] = 'L';
				t[j+1] = 'R';
				flag = 1;
			}
		}
		if(flag) mincnt++;//һ�ְ��ܷ��Ķ�����
		if(!flag) break;
	}
	if(mincnt <= k && k <= maxcnt)
	{
		cout << maxcnt - k + 1 << " ";
		int i;
		for(i = 1; i <= maxcnt - k + 1; i++)
		{
			if(i != maxcnt - k + 1)
				cout << ans[i] << " ";
			else
				cout << ans[i] << endl;
		}
		for(;i < z; i++)
		{
			cout << 1 << " " << ans[i] << endl;
		}
	}
	else
	{
		cout << -1 << endl;
	}
	return 0;
}


#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
const int maxn = 3e6 + 50;
vector<int> ans[maxn];
vector<int> a;
int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	int n,k;
	cin >> n >> k;
	string s;
	cin >> s;
	int maxcnt = 0,mincnt = 0;
	string t = s;
	int flag;
	do
	{
		flag = 0;
		mincnt++;
		for(int j = 0; j < n - 1; j++)
		{
			if(t[j] == 'R' && t[j+1] == 'L')
			{
				maxcnt++;
				ans[mincnt].push_back(j+1);
				a.push_back(j);
				flag = 1;
			}
		}
		int l = a.size();
		for(int i = 0; i < l; i++)
		{
			t[a[i]] = 'L';
			t[a[i]+1] = 'R';
		}
		a.clear();

	}while(flag);
	mincnt--;
	if(mincnt > k || k > maxcnt)
	{
		cout << -1 << endl;
		return 0;
	}
	for(int i = 1; i <= mincnt; i++)//�������е�����
	{
		while(k > mincnt - i +1 && ans[i].size())
		{
			cout << 1 << " " << ans[i].back();
			ans[i].pop_back();
			k--;
		}
		if(ans[i].size())
		{
			cout << ans[i].size();
			for(int j = 0; j < ans[i].size(); j++)
			cout << " " << ans[i][j];
			cout << endl;
			k--;
		}
	}
	return 0;
}


#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
const int maxn = 3e6 + 50;
vector<int> ans[maxn];
vector<int> a;
int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	int n,k;
	cin >> n >> k;
	string s;
	cin >> s;
	int maxcnt = 0,mincnt = 0;
	string t = s;
	int flag;
	do
	{
		flag = 0;
		mincnt++;
		for(int j = 0; j < n - 1; j++)
		{
			if(t[j] == 'R' && t[j+1] == 'L')
			{
				maxcnt++;
				ans[mincnt].push_back(j+1);
				a.push_back(j);
				flag = 1;
			}
		}
		int l = a.size();
		for(int i = 0; i < l; i++)
		{
			t[a[i]] = 'L';
			t[a[i]+1] = 'R';
		}
		a.clear();

	}while(flag);
	mincnt--;
	if(mincnt > k || k > maxcnt)
	{
		cout << -1 << endl;
		return 0;
	}
	for(int i = 1; i <= mincnt; i++)//�������е�����
	{
		while(k > mincnt - i +1 && ans[i].size())
		{
			cout << 1 << " " << ans[i].back() << endl;
			ans[i].pop_back();
			k--;
		}
		if(ans[i].size())
		{
			cout << ans[i].size();
			for(int j = 0; j < ans[i].size(); j++)
			cout << " " << ans[i][j];
			cout << endl;
			k--;
		}
	}
	return 0;
}


#include<iostream>
#include<algorithm>
#include <vector>
using namespace std;
const int N = 1e6 + 100;
vector<int>ans[N];
int cnt=0,tot=0,n,k;
int main()
{
	string s;
	scanf("%d%d",&n,&k);
	cin >> s;
	bool flag;
	do
	{
		flag=false;
		cnt++;//���ٷ�����
		for(int i=0;i<n-1;i++)
			if(s[i]=='R'&&s[i+1]=='L')
			{
				swap(s[i],s[i+1]);
				ans[cnt].push_back(i+1);
				flag=true;
				i++;
				tot++;//�ܲ�����
			}
	}while(flag);
	cnt--;
	if(cnt>k||tot<k)
	{
		cout << -1 << endl;
		return 0;
	}
	for(int i=1;i<=cnt;i++)
	{
		while(k>(cnt-i+1)&&ans[i].size())//�������ж�ʣ�µķ����뻹��Ҫ����ĸ���k�Ĵ�С��ϵ
		{
			printf("%d %d\n",1,ans[i].back());
			ans[i].pop_back();
			k--;
		}
		if(ans[i].size())
		{
			printf("%d",ans[i].size());
			for(int j=0;j<ans[i].size();j++)
				printf(" %d",ans[i][j]);
			printf("\n");
			k--;
		}
	}

    return 0;
}


#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
const int maxn = 3e6 + 50;
int ans[maxn];
int z = 0;
vector<int> a;
int num[maxn] = {0};
int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	int n,k;
	cin >> n >> k;
	string s;
	cin >> s;
	int maxcnt = 0,mincnt = 0;
	string t = s;
	while(1)
	{
		int flag = 0;
		for(int j = 0; j < n - 1; j++)
		{
			if(t[j] == 'R' && t[j+1] == 'L')
			{
				maxcnt++;//һ��Ҫ�����ٴ�
				num[mincnt]++;//��q�������Է����ٸ�
				ans[z] = j + 1;
				z++;
				a.push_back(j);
				flag = 1;
			}
		}
		int l = a.size();
		for(int i = 0; i < l; i++)
		{
			t[a[i]] = 'L';
			t[a[i]+1] = 'R';
		}
	//	cout << t << endl;
		a.clear();
		if(flag) mincnt++;//һ�ְ��ܷ��Ķ�����
		if(!flag) break;
	}
	if(mincnt > k || maxcnt < k)
	{
		cout << -1 << endl;
		return 0;
	}
	int quan = 0;//ǰ���������ȫ������
	int buquan = 0;
	int yi = 0;
	long long sum = 0;
	int i;
	for(i = 0; i < mincnt; i++)
	{
		sum += num[i];
		if(sum + mincnt - 1 - i >= maxcnt)
		{
			break;
		}
	}
	quan = i;
	sum -= num[i];
	//cout << quan << endl;
	yi = k - 1 - quan;
//	cout << yi << endl;
	buquan = maxcnt - sum - yi;
	//cout << buquan << endl;
	int j = 0;
	for(i = 0; i < quan; i++)
	{
		cout << num[i] << " ";
		int x = j;
		for(; j < x + num[i]; j++)
		{
			if(j != x + num[i] - 1)
			cout << ans[j] << " ";
			else cout << ans[j] << endl;
		}
	}
	cout << buquan << " ";
//	cout << j << endl;
	int x = j;
	for(;j < x + buquan; j++)
	{
		if(j != x + buquan - 1)
		cout << ans[j] << " ";
		else cout << ans[j] << endl;
	}
	i++;
	for(; i < k; i++)
	{
		cout << 1 <<" ";
		cout << ans[j] << endl;
		j++;
	}
	return 0;
}


#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
const int maxn = 3e6 + 50;
vector<int> ans[maxn];
int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	int n,k;
	cin >> n >> k;
	string s;
	cin >> s;
	int maxcnt = 0,mincnt = 0;
	string t = s;
	int flag;
	do
	{
		flag = 0;
		mincnt++;
		for(int j = 0; j < n - 1; j++)
		{
			if(t[j] == 'R' && t[j+1] == 'L')
			{
				maxcnt++;//��������
				ans[mincnt].push_back(j+1);//����һ�ֿ��Է��ļ�¼
				swap(t[j],t[j+1]);
				flag = 1;
			}
		}
	}while(flag);
	mincnt--;
	if(mincnt > k || k > maxcnt)
	{
		cout << -1 << endl;
		return 0;
	}
	for(int i = 1; i <= mincnt; i++)//�������е�����
	{
		while(k > mincnt - i+ 1 && ans[i].size())
		{//k�࣬��Ҫ���1���������ʱ��
			cout << 1 << " " << ans[i].back();
			ans[i].pop_back();
			k--;//ʱ��-1
		}
		if(ans[i].size())
		{
			cout << ans[i].size();
			for(int j = 0; j < ans[i].size(); j++)
			cout << " " << ans[i][j];
			cout << endl;
			k--;
		}
	}
	return 0;
}


#include<iostream>
#include<cstdio>
#include<string>
#include<ctime>
#include<cmath>
#include<cstring>
#include<algorithm>
#include<stack>
#include<climits>
#include<queue>
#include<map>
#include<set>
#include<sstream>
#include<unordered_map>
using namespace std;
const int N=1e6+100;
char s[N];
vector<int>ans[N];
int cnt=0,tot=0,n,k;
int main()
{
	scanf("%d%d",&n,&k);
	scanf("%s", s+1);
	bool flag;
	do
	{
		flag=false;
		cnt++;//���ٷ�����
		for(int i=1;i<n;i++)
			if(s[i]=='R'&&s[i+1]=='L')
			{
				swap(s[i],s[i+1]);
				ans[cnt].push_back(i);
				flag=true;
				i++;
				tot++;//�ܲ�����
			}
	}while(flag);
	cnt--;
	if(cnt>k||tot<k)
		return 0*puts("-1");
	for(int i=1;i<=cnt;i++)
	{
		while(k>(cnt-i+1)&&ans[i].size())//�������ж�ʣ�µķ����뻹��Ҫ����ĸ���k�Ĵ�С��ϵ
		{
			printf("%d %d\n",1,ans[i].back());
			ans[i].pop_back();
			k--;
		}
		if(ans[i].size())
		{
			printf("%d",ans[i].size());
			for(int j=0;j<ans[i].size();j++)
				printf(" %d",ans[i][j]);
			printf("\n");
			k--;
		}
	}

    return 0;
}


#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
const int maxn = 3e6 + 50;
vector<int> ans[maxn];
vector<int> a;
int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	int n,k;
	cin >> n >> k;
	string s;
	cin >> s;
	int maxcnt = 0,mincnt = 0;
	string t = s;
	while(1)
	{
		int flag = 0;
		for(int j = 0; j < n - 1; j++)
		{
			if(t[j] == 'R' && t[j+1] == 'L')
			{
				maxcnt++;//��������
				ans[mincnt].push_back(j+1);//����һ�ֿ��Է��ļ�¼
				a.push_back(j);
				flag = 1;
			}
		}
		int l = a.size();
		for(int i = 0; i < l; i++)
		{
			t[a[i]] = 'L';
			t[a[i]+1] = 'R';
		}
		a.clear();
		if(flag) mincnt++;//һ�ְ��ܷ��Ķ�����
		if(!flag) break;
	}
	if(mincnt > k || k > maxcnt)
	{
		cout << -1 << endl;
		return 0;
	}
	for(int i = 0; i < mincnt; i++)//�������е�����
	{
		while(k > mincnt - i  && ans[i].size())
		{
			cout << 1 << " " << ans[i].back();
			ans[i].pop_back();
			k--;
		}
		if(ans[i].size())
		{
			cout << ans[i].size();
			for(int j = 0; j < ans[i].size(); j++)
			cout << " " << ans[i][j];
			cout << endl;
			k--;
		}
	}
	return 0;
}


#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
const int maxn = 3e6 + 50;
vector<int> ans[maxn];
vector<int> a;
int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	int n,k;
	cin >> n >> k;
	string s;
	cin >> s;
	int maxcnt = 0,mincnt = 0;
	string t = s;
	int flag;
	do
	{
		flag = 0;
		mincnt++;
		for(int j = 0; j < n - 1; j++)
		{
			if(t[j] == 'R' && t[j+1] == 'L')
			{
				maxcnt++;//��������
				ans[mincnt].push_back(j+1);//����һ�ֿ��Է��ļ�¼
				a.push_back(j);
				flag = 1;
			}
		}
		int l = a.size();
		for(int i = 0; i < l; i++)
		{
			t[a[i]] = 'L';
			t[a[i]+1] = 'R';
		}
		a.clear();
	}while(flag);
	mincnt--;
	if(mincnt > k || k > maxcnt)
	{
		cout << -1 << endl;
		return 0;
	}
	for(int i = 1; i <= mincnt; i++)//�������е�����
	{
		while(k > mincnt - i+ 1 && ans[i].size())
		{//k�࣬��Ҫ���1���������ʱ��
			cout << 1 << " " << ans[i].back();
			ans[i].pop_back();
			k--;//ʱ��-1
		}
		if(ans[i].size())
		{
			cout << ans[i].size();
			for(int j = 0; j < ans[i].size(); j++)
			cout << " " << ans[i][j];
			cout << endl;
			k--;
		}
	}
	return 0;
}


#include <iostream>
#include <algorithm>
#include <string.h>
#include <map>
using namespace std;
const int maxn = 3e6 + 50;
int ans[maxn];
int z = 1;
int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	int n,k;
	cin >> n >> k;
	string s;
	cin >> s;
	int maxcnt = 0,mincnt = 0;
	string t = s;
	for(int i = 0; i < n - 1; i++)
	{
		int flag = 0;
		for(int j = 0; j < n - 1; j++)
		{
			if(t[j] == 'R' && t[j+1] == 'L')
			{
				maxcnt++;
				ans[z] = j + 1;
				z++;
				t[j] = 'L';
				t[j+1] = 'R';
				flag = 1;
			}
		}
		if(flag) mincnt++;
	}
	if(mincnt <= k && k <= maxcnt)
	{
		cout << maxcnt - k + 1 << " ";
		int i;
		for(i = 1; i <= maxcnt - k + 1; i++)
		{
			if(i != maxcnt - k + 1)
				cout << ans[i] << " ";
			else
				cout << ans[i] << endl;
		}
		for(;i < z; i++)
		{
			cout << 1 << " " << ans[i] << endl;
		}
	}
	else
	{
		cout << -1 << endl;
	}
	return 0;
}


#include<iostream>
#include<cstdio>
#include<string>
#include<ctime>
#include<cmath>
#include<cstring>
#include<algorithm>
#include<stack>
#include<climits>
#include<queue>
#include<map>
#include<set>
#include<sstream>
#include<unordered_map>
using namespace std;

typedef long long LL;

typedef unsigned long long ull;

const int inf=0x3f3f3f3f;

const int N=1e6+100;

char s[N];

vector<int>ans[N];

int cnt=0,tot=0,n,k;

int main()
{
#ifndef ONLINE_JUDGE
//	freopen("input.txt","r",stdin);
//	freopen("output.txt","w",stdout);
#endif
//	ios::sync_with_stdio(false);
	scanf("%d%d",&n,&k);
	scanf("%s",s+1);
	bool flag;
	do
	{
		flag=false;
		cnt++;//���ٷ�����
		for(int i=1;i<n;i++)
			if(s[i]=='R'&&s[i+1]=='L')
			{
				swap(s[i],s[i+1]);
				ans[cnt].push_back(i);
				flag=true;
				i++;
				tot++;//�ܲ�����
			}
	}while(flag);
	cnt--;
	if(cnt>k||tot<k)
		return 0*puts("-1");
	for(int i=1;i<=cnt;i++)
	{
		while(k>(cnt-i+1)&&ans[i].size())//�������ж�ʣ�µķ����뻹��Ҫ����ĸ���k�Ĵ�С��ϵ
		{
			printf("%d %d\n",1,ans[i].back());
			ans[i].pop_back();
			k--;
		}
		if(ans[i].size())
		{
			printf("%d",ans[i].size());
			for(int j=0;j<ans[i].size();j++)
				printf(" %d",ans[i][j]);
			puts("");
			k--;
		}
	}

    return 0;
}


#include <iostream>
#include <algorithm>
#include <string.h>
#include <map>
using namespace std;
const int maxn = 3e6 + 50;
int ans[maxn];
int z = 1;
vector<int> a;
int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	int n,k;
	cin >> n >> k;
	string s;
	cin >> s;
	int maxcnt = 0,mincnt = 0;
	string t = s;
	while(1)
	{
		int flag = 0;
		for(int j = 0; j < n - 1; j++)
		{
			if(t[j] == 'R' && t[j+1] == 'L')
			{
				maxcnt++;
				ans[z] = j + 1;
				z++;
				a.push_back(j);
				flag = 1;
			}
		}
		int l = a.size();
		for(int i = 0; i < l; i++)
		{
			t[a[i]] = 'L';
			t[a[i]+1] = 'R';
		}
		a.clear();
		if(flag) mincnt++;//һ�ְ��ܷ��Ķ�����
		if(!flag) break;
	}
	if(mincnt <= k && k <= maxcnt)
	{
		cout << maxcnt - k + 1 << " ";
		int i;
		for(i = 1; i <= maxcnt - k + 1; i++)
		{
			if(i != maxcnt - k + 1)
				cout << ans[i] << " ";
			else
				cout << ans[i] << endl;
		}
		for(;i < z; i++)
		{
			cout << 1 << " " << ans[i] << endl;
		}
	}
	else
	{
		cout << -1 << endl;
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll                      long long int
#define pb                      push_back
#define MOD                     1000000007
#define inf                     3e18
#define ld                      long double
//#define mp                      make_pair
#define vpll                    vector<pair<ll,ll>>
#define sll                     set<ll>
#define vll                     vector<ll>
#define vld                     vector<ld>
#define vvll                    vector<vector<ll>>
#define vvld                    vector<vector<ld>>
#define pll                     pair<ll,ll>
#define vvpll                   vector<vector<pair<ll,ll>>>
#define pqll                    priority_queue<ll>
#define mll                     map<ll,ll>
#define mlc                     map<ll,char>
#define um                      unordered_map
#define umll                    um<ll,ll>
#define umlc                    um<ll,char>
#define umcl                    um<char,ll>
#define all(x)                  x.begin(),x.end()
#define fi                      first
#define se                      second
#define test                    ll Testcases;cin>>Testcases;while(Testcases--)
#define fastIO                  ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define db(...)                 __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) { cerr << " "<< name << " : " << arg1 <<'\n'; }
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
    const char* comma = strchr(names + 1, ',');
    cerr.write(names, comma - names) << " : " << arg1 << " | "; __f(comma + 1, args...);
}

void inp_out()
{
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    freopen("debug.txt", "w", stderr);
    #endif
}

vvll ans(3000001);
int main()
{
	fastIO
	inp_out();
	ll n,k;
	cin>>n>>k;
	string s;
	cin>>s;
	ll pos=0,cnt=0;
	while(1)
	{
		ll flag=0;
		for(ll i=1;i<n;++i)
		{
			if((s[i-1]=='R')&&(s[i]=='L'))
			{
				flag=1;
				s[i]='R';
				s[i-1]='L';
				ans[pos].pb(i);
				++cnt;
				++i;
			}
		}
		if(flag==0)
		{
			break;
		}
		++pos;
		if(pos==n)
		{
			break;
		}
	}

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

	for(ll i=0;i<pos;++i)
	{
		ll sz=ans[i].size();
		--k;
		if((cnt-sz)>=k)
		{
			cout<<sz<<" ";
			for(ll j=0;j<sz;++j)
			{
				cout<<ans[i][j]<<" ";
			}
			cout<<"\n";
			cnt-=sz;
		}

		else
		{
			ll allowed=cnt-k;
			cout<<allowed<<" ";
			for(ll j=0;j<allowed;++j)
			{
				cout<<ans[i][j]<<" ";
			}
			cout<<"\n";

			for(ll j=allowed;j<sz;++j)
			{
				--k;
				cout<<1<<" "<<ans[i][j]<<"\n";
			}
			cnt-=sz;
		}
	}

	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll                      long long int
#define pb                      push_back
#define MOD                     1000000007
#define inf                     3e18
#define ld                      long double
//#define mp                      make_pair
#define vpll                    vector<pair<ll,ll>>
#define sll                     set<ll>
#define vll                     vector<ll>
#define vld                     vector<ld>
#define vvll                    vector<vector<ll>>
#define vvld                    vector<vector<ld>>
#define pll                     pair<ll,ll>
#define vvpll                   vector<vector<pair<ll,ll>>>
#define pqll                    priority_queue<ll>
#define mll                     map<ll,ll>
#define mlc                     map<ll,char>
#define um                      unordered_map
#define umll                    um<ll,ll>
#define umlc                    um<ll,char>
#define umcl                    um<char,ll>
#define all(x)                  x.begin(),x.end()
#define fi                      first
#define se                      second
#define test                    ll Testcases;cin>>Testcases;while(Testcases--)
#define fastIO                  ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define db(...)                 __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) { cerr << " "<< name << " : " << arg1 <<'\n'; }
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
    const char* comma = strchr(names + 1, ',');
    cerr.write(names, comma - names) << " : " << arg1 << " | "; __f(comma + 1, args...);
}

void inp_out()
{
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    freopen("debug.txt", "w", stderr);
    #endif
}

int main()
{
	fastIO
	inp_out();
	ll n,k;
	cin>>n>>k;
	string s;
	cin>>s;
	vvll ans(n+1);

	ll pos=0,cnt=0;
	while(1)
	{
		ll flag=0;
		for(ll i=1;i<n;++i)
		{
			if((s[i-1]=='R')&&(s[i]=='L'))
			{
				flag=1;
				s[i]='R';
				s[i-1]='L';
				ans[pos].pb(i);
				++cnt;
				++i;
			}
		}
		if(flag==0)
		{
			break;
		}
		++pos;
		if(pos==n)
		{
			break;
		}
	}

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

	ll i=-1;
	while((cnt>0)&&((ll)ans[++i].size()>0))
	{
		--k;
		if((cnt-(ll)ans[i].size())>=k)
		{
			cout<<ans[i].size()<<" ";
			for(ll j=0;j<(ll)ans[i].size();++j)
			{
				cout<<ans[i][j]<<" ";
			}
			cout<<"\n";
			cnt-=(ll)ans[i].size();
		}

		else
		{
			ll allowed=cnt-k;
			cout<<allowed<<" ";
			for(ll j=0;j<allowed;++j)
			{
				cout<<ans[i][j]<<" ";
			}
			cout<<"\n";

			for(ll j=allowed;j<(ll)ans[i].size();++j)
			{
				cout<<1<<" "<<ans[i][j]<<"\
				n";
			}
			cnt-=(ll)ans[i].size();
		}
	}

	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll                      long long int
#define pb                      push_back
#define MOD                     1000000007
#define inf                     3e18
#define ld                      long double
//#define mp                      make_pair
#define vpll                    vector<pair<ll,ll>>
#define sll                     set<ll>
#define vll                     vector<ll>
#define vld                     vector<ld>
#define vvll                    vector<vector<ll>>
#define vvld                    vector<vector<ld>>
#define pll                     pair<ll,ll>
#define vvpll                   vector<vector<pair<ll,ll>>>
#define pqll                    priority_queue<ll>
#define mll                     map<ll,ll>
#define mlc                     map<ll,char>
#define um                      unordered_map
#define umll                    um<ll,ll>
#define umlc                    um<ll,char>
#define umcl                    um<char,ll>
#define all(x)                  x.begin(),x.end()
#define fi                      first
#define se                      second
#define test                    ll Testcases;cin>>Testcases;while(Testcases--)
#define fastIO                  ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define db(...)                 __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) { cerr << " "<< name << " : " << arg1 <<'\n'; }
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
    const char* comma = strchr(names + 1, ',');
    cerr.write(names, comma - names) << " : " << arg1 << " | "; __f(comma + 1, args...);
}

void inp_out()
{
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    freopen("debug.txt", "w", stderr);
    #endif
}

int main()
{
	fastIO
	inp_out();
	ll n,k;
	cin>>n>>k;
	string s;
	cin>>s;
	vvll ans(n+1);

	ll pos=0,cnt=0;
	while(1)
	{
		ll flag=0;
		for(ll i=1;i<n;++i)
		{
			if((s[i-1]=='R')&&(s[i]=='L'))
			{
				flag=1;
				s[i]='R';
				s[i-1]='L';
				ans[pos].pb(i);
				++cnt;
				++i;
			}
		}
		if(flag==0)
		{
			break;
		}
		++pos;
		if(pos==n)
		{
			break;
		}
	}

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

	for(ll i=0;i<pos;++i)
	{
		ll sz=ans[i].size();
		--k;
		if((cnt-sz)>=k)
		{
			cout<<sz<<" ";
			for(ll j=0;j<sz;++j)
			{
				cout<<ans[i][j]<<" ";
			}
			cout<<"\n";
			cnt-=sz;
		}

		else
		{
			ll allowed=cnt-k;
			cout<<allowed<<" ";
			for(ll j=0;j<allowed;++j)
			{
				cout<<ans[i][j]<<" ";
			}
			cout<<"\n";

			for(ll j=allowed;j<sz;++j)
			{
				cout<<1<<" "<<ans[i][j]<<"\n";
			}
			cnt-=sz;
		}
	}

	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll                      long long int
#define pb                      push_back
#define MOD                     1000000007
#define inf                     3e18
#define ld                      long double
//#define mp                      make_pair
#define vpll                    vector<pair<ll,ll>>
#define sll                     set<ll>
#define vll                     vector<ll>
#define vld                     vector<ld>
#define vvll                    vector<vector<ll>>
#define vvld                    vector<vector<ld>>
#define pll                     pair<ll,ll>
#define vvpll                   vector<vector<pair<ll,ll>>>
#define pqll                    priority_queue<ll>
#define mll                     map<ll,ll>
#define mlc                     map<ll,char>
#define um                      unordered_map
#define umll                    um<ll,ll>
#define umlc                    um<ll,char>
#define umcl                    um<char,ll>
#define all(x)                  x.begin(),x.end()
#define fi                      first
#define se                      second
#define test                    ll Testcases;cin>>Testcases;while(Testcases--)
#define fastIO                  ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define db(...)                 __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) { cerr << " "<< name << " : " << arg1 <<'\n'; }
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
    const char* comma = strchr(names + 1, ',');
    cerr.write(names, comma - names) << " : " << arg1 << " | "; __f(comma + 1, args...);
}

void inp_out()
{
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    freopen("debug.txt", "w", stderr);
    #endif
}

vvll ans(3000001);
int main()
{
	fastIO
	inp_out();
	ll n,k;
	cin>>n>>k;
	string s;
	cin>>s;
	ll pos=0,cnt=0;
	while(1)
	{
	//	db(s);
		ll flag=0;
		for(ll i=1;i<n;++i)
		{
			if((s[i-1]=='R')&&(s[i]=='L'))
			{
				flag=1;
				s[i]='R';
				s[i-1]='L';
				ans[pos].pb(i);
				++cnt;
				++i;
			}
		}
		if(flag==0)
		{
			break;
		}
		++pos;
		if(pos==n)
		{
			break;
		}
	}

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

	for(ll i=0;i<pos;++i)
	{
	//	db(i,ans[i].size());
		ll sz=ans[i].size();
		--k;
		if((cnt-sz)>=k)
		{
			cout<<sz<<" ";
			for(ll j=0;j<sz;++j)
			{
				cout<<ans[i][j]<<" ";
			}
			cout<<"\n";
			cnt-=sz;
		}

		else
		{
			ll allowed=cnt-k;
			cout<<allowed<<" ";
			for(ll j=0;j<allowed;++j)
			{
				cout<<ans[i][j]<<" ";
			}
			cout<<"\n";

			for(ll j=allowed;j<sz;++j)
			{
				cout<<1<<" "<<ans[i][j]<<"\n";
			}
			cnt-=sz;
		}
	}

	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll                      long long int
#define pb                      push_back
#define MOD                     1000000007
#define inf                     3e18
#define ld                      long double
//#define mp                      make_pair
#define vpll                    vector<pair<ll,ll>>
#define sll                     set<ll>
#define vll                     vector<ll>
#define vld                     vector<ld>
#define vvll                    vector<vector<ll>>
#define vvld                    vector<vector<ld>>
#define pll                     pair<ll,ll>
#define vvpll                   vector<vector<pair<ll,ll>>>
#define pqll                    priority_queue<ll>
#define mll                     map<ll,ll>
#define mlc                     map<ll,char>
#define um                      unordered_map
#define umll                    um<ll,ll>
#define umlc                    um<ll,char>
#define umcl                    um<char,ll>
#define all(x)                  x.begin(),x.end()
#define fi                      first
#define se                      second
#define test                    ll Testcases;cin>>Testcases;while(Testcases--)
#define fastIO                  ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define db(...)                 __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) { cerr << " "<< name << " : " << arg1 <<'\n'; }
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
    const char* comma = strchr(names + 1, ',');
    cerr.write(names, comma - names) << " : " << arg1 << " | "; __f(comma + 1, args...);
}

void inp_out()
{
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    freopen("debug.txt", "w", stderr);
    #endif
}

int main()
{
	fastIO
	inp_out();
	ll n,k;
	cin>>n>>k;
	string s;
	cin>>s;
	vvll ans(n);

	ll pos=0,cnt=0;
	while(1)
	{
		ll flag=0;
		for(ll i=1;i<n;++i)
		{
			if((s[i-1]=='R')&&(s[i]=='L'))
			{
				flag=1;
				s[i]='R';
				s[i-1]='L';
				ans[pos].pb(i);
				++cnt;
				++i;
			}
		}
		if(flag==0)
		{
			break;
		}
		++pos;
	}

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

	ll i=-1;
	while((cnt>0)&&((ll)ans[++i].size()>0))
	{
		if(cnt-(ll)ans[i].size()>=--k)
		{
			cout<<ans[i].size()<<" ";
			for(ll j=0;j<(ll)ans[i].size();++j)
			{
				cout<<ans[i][j]<<" ";
			}
			cout<<"\n";
			cnt-=(ll)ans[i].size();
		}

		else
		{
			ll allowed=cnt-k;
			cout<<allowed<<" ";
			for(ll j=0;j<allowed;++j)
			{
				cout<<ans[i][j]<<" ";
			}
			cout<<"\n";

			for(ll j=allowed;j<(ll)ans[i].size();++j)
			{
				cout<<1<<" "<<ans[i][j]<<"\n";
			}
			cnt-=(ll)ans[i].size();
		}
	}

	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll                      long long int
#define pb                      push_back
#define MOD                     1000000007
#define inf                     3e18
#define ld                      long double
//#define mp                      make_pair
#define vpll                    vector<pair<ll,ll>>
#define sll                     set<ll>
#define vll                     vector<ll>
#define vld                     vector<ld>
#define vvll                    vector<vector<ll>>
#define vvld                    vector<vector<ld>>
#define pll                     pair<ll,ll>
#define vvpll                   vector<vector<pair<ll,ll>>>
#define pqll                    priority_queue<ll>
#define mll                     map<ll,ll>
#define mlc                     map<ll,char>
#define um                      unordered_map
#define umll                    um<ll,ll>
#define umlc                    um<ll,char>
#define umcl                    um<char,ll>
#define all(x)                  x.begin(),x.end()
#define fi                      first
#define se                      second
#define test                    ll Testcases;cin>>Testcases;while(Testcases--)
#define fastIO                  ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define db(...)                 __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) { cerr << " "<< name << " : " << arg1 <<'\n'; }
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
    const char* comma = strchr(names + 1, ',');
    cerr.write(names, comma - names) << " : " << arg1 << " | "; __f(comma + 1, args...);
}

void inp_out()
{
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    freopen("debug.txt", "w", stderr);
    #endif
}

int main()
{
	fastIO
	inp_out();
	ll n,k;
	cin>>n>>k;
	string s;
	cin>>s;
	vvll ans(n);

	ll pos=0,cnt=0;
	while(1)
	{
		ll flag=0;
		for(ll i=1;i<n;++i)
		{
			if((s[i-1]=='R')&&(s[i]=='L'))
			{
				flag=1;
				s[i]='R';
				s[i-1]='L';
				ans[pos].pb(i);
				++cnt;
				++i;
			}
		}
		if(flag==0)
		{
			break;
		}
		++pos;
	}

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

	ll i=0;
	while(cnt>0)
	{
		if(cnt-ans[i].size()>=--k)
		{
			cout<<ans[i].size()<<" ";
			for(ll j=0;j<ans[i].size();++j)
			{
				cout<<ans[i][j]<<" ";
			}
			cout<<"\n";
			cnt-=ans[i].size();
		}

		else
		{
			ll allowed=cnt-k;
			cout<<allowed<<" ";
			for(ll j=0;j<allowed;++j)
			{
				cout<<ans[i][j]<<" ";
			}
			cout<<"\n";

			for(ll j=allowed;j<ans[i].size();++j)
			{
				cout<<1<<" "<<ans[i][j]<<"\n";
			}
			cnt-=ans[i].size();
		}
		++i;
	}

	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll                      long long int
#define pb                      push_back
#define MOD                     1000000007
#define inf                     3e18
#define ld                      long double
//#define mp                      make_pair
#define vpll                    vector<pair<ll,ll>>
#define sll                     set<ll>
#define vll                     vector<ll>
#define vld                     vector<ld>
#define vvll                    vector<vector<ll>>
#define vvld                    vector<vector<ld>>
#define pll                     pair<ll,ll>
#define vvpll                   vector<vector<pair<ll,ll>>>
#define pqll                    priority_queue<ll>
#define mll                     map<ll,ll>
#define mlc                     map<ll,char>
#define um                      unordered_map
#define umll                    um<ll,ll>
#define umlc                    um<ll,char>
#define umcl                    um<char,ll>
#define all(x)                  x.begin(),x.end()
#define fi                      first
#define se                      second
#define test                    ll Testcases;cin>>Testcases;while(Testcases--)
#define fastIO                  ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define db(...)                 __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) { cerr << " "<< name << " : " << arg1 <<'\n'; }
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
    const char* comma = strchr(names + 1, ',');
    cerr.write(names, comma - names) << " : " << arg1 << " | "; __f(comma + 1, args...);
}

void inp_out()
{
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    freopen("debug.txt", "w", stderr);
    #endif
}

int main()
{
	fastIO
	inp_out();
	ll n,k;
	cin>>n>>k;
	string s;
	cin>>s;
	vvll ans(n);

	ll pos=0,cnt=0;
	while(1)
	{
		ll flag=0;
		for(ll i=1;i<n;++i)
		{
			if((s[i-1]=='R')&&(s[i]=='L'))
			{
				flag=1;
				s[i]='R';
				s[i-1]='L';
				ans[pos].pb(i);
				++cnt;
			}
		}
		if(flag==0)
		{
			break;
		}
		++pos;
	}

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

	for(ll i=0;i<pos;++i)
	{
		if(cnt-ans[i].size()>=--k)
		{
			cout<<ans[i].size()<<" ";
			for(ll j=0;j<ans[i].size();++j)
			{
				cout<<ans[i][j]<<" ";
			}
			cout<<"\n";
		}

		else
		{
			ll allowed=cnt-k;
			cout<<allowed<<" ";
			for(ll j=0;j<allowed;++j)
			{
				cout<<ans[i][j]<<" ";
			}
			cout<<"\n";

			for(ll j=allowed;j<ans[i].size();++j)
			{
				cout<<1<<" "<<ans[i][j]<<"\n";
			}
		}
	}

	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll                      long long int
#define pb                      push_back
#define MOD                     1000000007
#define inf                     3e18
#define ld                      long double
//#define mp                      make_pair
#define vpll                    vector<pair<ll,ll>>
#define sll                     set<ll>
#define vll                     vector<ll>
#define vld                     vector<ld>
#define vvll                    vector<vector<ll>>
#define vvld                    vector<vector<ld>>
#define pll                     pair<ll,ll>
#define vvpll                   vector<vector<pair<ll,ll>>>
#define pqll                    priority_queue<ll>
#define mll                     map<ll,ll>
#define mlc                     map<ll,char>
#define um                      unordered_map
#define umll                    um<ll,ll>
#define umlc                    um<ll,char>
#define umcl                    um<char,ll>
#define all(x)                  x.begin(),x.end()
#define fi                      first
#define se                      second
#define test                    ll Testcases;cin>>Testcases;while(Testcases--)
#define fastIO                  ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define db(...)                 __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) { cerr << " "<< name << " : " << arg1 <<'\n'; }
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
    const char* comma = strchr(names + 1, ',');
    cerr.write(names, comma - names) << " : " << arg1 << " | "; __f(comma + 1, args...);
}

void inp_out()
{
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    freopen("debug.txt", "w", stderr);
    #endif
}

int main()
{
	fastIO
	inp_out();
	ll n,k;
	cin>>n>>k;
	string s;
	cin>>s;
	vvll ans(n);

	ll pos=0,cnt=0;
	while(1)
	{
		ll flag=0;
		for(ll i=1;i<n;++i)
		{
			if((s[i-1]=='R')&&(s[i]=='L'))
			{
				flag=1;
				s[i]='R';
				s[i-1]='L';
				ans[pos].pb(i);
				++cnt;
				++i;
			}
		}
		if(flag==0)
		{
			break;
		}
		++pos;
		if(pos==n)
		{
			break;
		}
	}

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

	ll i=-1;
	while((cnt>0)&&((ll)ans[++i].size()>0))
	{
		--k;
		if((cnt-(ll)ans[i].size())>=k)
		{
			cout<<ans[i].size()<<" ";
			for(ll j=0;j<(ll)ans[i].size();++j)
			{
				cout<<ans[i][j]<<" ";
			}
			cout<<"\n";
			cnt-=(ll)ans[i].size();
		}

		else
		{
			ll allowed=cnt-k;
			cout<<allowed<<" ";
			for(ll j=0;j<allowed;++j)
			{
				cout<<ans[i][j]<<" ";
			}
			cout<<"\n";

			for(ll j=allowed;j<(ll)ans[i].size();++j)
			{
				cout<<1<<" "<<ans[i][j]<<"\n";
			}
			cnt-=(ll)ans[i].size();
		}
	}

	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll                      long long int
#define pb                      push_back
#define MOD                     1000000007
#define inf                     3e18
#define ld                      long double
//#define mp                      make_pair
#define vpll                    vector<pair<ll,ll>>
#define sll                     set<ll>
#define vll                     vector<ll>
#define vld                     vector<ld>
#define vvll                    vector<vector<ll>>
#define vvld                    vector<vector<ld>>
#define pll                     pair<ll,ll>
#define vvpll                   vector<vector<pair<ll,ll>>>
#define pqll                    priority_queue<ll>
#define mll                     map<ll,ll>
#define mlc                     map<ll,char>
#define um                      unordered_map
#define umll                    um<ll,ll>
#define umlc                    um<ll,char>
#define umcl                    um<char,ll>
#define all(x)                  x.begin(),x.end()
#define fi                      first
#define se                      second
#define test                    ll Testcases;cin>>Testcases;while(Testcases--)
#define fastIO                  ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define db(...)                 __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) { cerr << " "<< name << " : " << arg1 <<'\n'; }
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
    const char* comma = strchr(names + 1, ',');
    cerr.write(names, comma - names) << " : " << arg1 << " | "; __f(comma + 1, args...);
}

void inp_out()
{
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    freopen("debug.txt", "w", stderr);
    #endif
}

int main()
{
	fastIO
	inp_out();
	ll n,k;
	cin>>n>>k;
	string s;
	cin>>s;
	vvll ans(n);

	ll pos=0,cnt=0;
	while(1)
	{
		ll flag=0;
		for(ll i=1;i<n;++i)
		{
			if((s[i-1]=='R')&&(s[i]=='L'))
			{
				flag=1;
				s[i]='R';
				s[i-1]='L';
				ans[pos].pb(i);
				++cnt;
				++i;
			}
		}
		if(flag==0)
		{
			break;
		}
		++pos;
	}

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

	ll i=-1;
	while((cnt>0)&&((ll)ans[++i].size()>0))
	{
		if(cnt-ans[i].size()>=--k)
		{
			cout<<ans[i].size()<<" ";
			for(ll j=0;j<ans[i].size();++j)
			{
				cout<<ans[i][j]<<" ";
			}
			cout<<"\n";
			cnt-=ans[i].size();
		}

		else
		{
			ll allowed=cnt-k;
			cout<<allowed<<" ";
			for(ll j=0;j<allowed;++j)
			{
				cout<<ans[i][j]<<" ";
			}
			cout<<"\n";

			for(ll j=allowed;j<ans[i].size();++j)
			{
				cout<<1<<" "<<ans[i][j]<<"\n";
			}
			cnt-=ans[i].size();
		}
	}

	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll                      long long int
#define pb                      push_back
#define MOD                     1000000007
#define inf                     3e18
#define ld                      long double
//#define mp                      make_pair
#define vpll                    vector<pair<ll,ll>>
#define sll                     set<ll>
#define vll                     vector<ll>
#define vld                     vector<ld>
#define vvll                    vector<vector<ll>>
#define vvld                    vector<vector<ld>>
#define pll                     pair<ll,ll>
#define vvpll                   vector<vector<pair<ll,ll>>>
#define pqll                    priority_queue<ll>
#define mll                     map<ll,ll>
#define mlc                     map<ll,char>
#define um                      unordered_map
#define umll                    um<ll,ll>
#define umlc                    um<ll,char>
#define umcl                    um<char,ll>
#define all(x)                  x.begin(),x.end()
#define fi                      first
#define se                      second
#define test                    ll Testcases;cin>>Testcases;while(Testcases--)
#define fastIO                  ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define db(...)                 __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) { cerr << " "<< name << " : " << arg1 <<'\n'; }
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
    const char* comma = strchr(names + 1, ',');
    cerr.write(names, comma - names) << " : " << arg1 << " | "; __f(comma + 1, args...);
}

void inp_out()
{
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    freopen("debug.txt", "w", stderr);
    #endif
}

int main()
{
	fastIO
	inp_out();
	ll n,k;
	cin>>n>>k;
	string s;
	cin>>s;
	vvll ans(n);

	ll pos=0,cnt=0;
	while(1)
	{
		ll flag=0;
		for(ll i=1;i<n;++i)
		{
			if((s[i-1]=='R')&&(s[i]=='L'))
			{
				flag=1;
				s[i]='R';
				s[i-1]='L';
				ans[pos].pb(i);
				++cnt;
				++i;
			}
		}
		if(flag==0)
		{
			break;
		}
		++pos;
	}

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

	for(ll i=0;i<pos;++i)
	{
		if(cnt-ans[i].size()>=--k)
		{
			cout<<ans[i].size()<<" ";
			for(ll j=0;j<ans[i].size();++j)
			{
				cout<<ans[i][j]<<" ";
			}
			cout<<"\n";
		}

		else
		{
			ll allowed=cnt-k;
			cout<<allowed<<" ";
			for(ll j=0;j<allowed;++j)
			{
				cout<<ans[i][j]<<" ";
			}
			cout<<"\n";

			for(ll j=allowed;j<ans[i].size();++j)
			{
				cout<<1<<" "<<ans[i][j]<<"\n";
			}
		}
	}

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define pfi(a) printf("%d",a);
#define pfl(a) printf("%lld",a);
#define pfin(a) printf("%d\n",a);
#define pfln(a) printf("%lld\n",a);
#define sfi(a) scanf("%d",&a);
#define sfl(a) scanf("%lld",&a);
#define pb push_back
#define f(i,a,b) for(int i=a;i<b;i++)
#define ll long long
const int N=3e3+5;
const int M= 998244353;
const int modi6=166666668;

int main(){

	ll n,k;
	sfl(n) sfl(k)

	string s;
	cin>>s;

	vector<vector<int>>  moves;

	ll mini=0,maxi=0;

	while(1){
		vector<int> temp;

		for(int i=0;i+1<s.length();){
			if(s[i]=='R' && s[i+1]=='L'){
				s[i]='L';
				s[i+1]='R';
				temp.push_back(i);
				i+=2;
			}
			else
				i++;
		}

		if(temp.size()==0)
			break;

		mini++;
		maxi+=temp.size();

		moves.push_back(temp);

		//cout<<s<<endl;
	}

	//cout<<mini<<" "<<maxi<<endl;

	if(k>=mini && k<=maxi){
		int diff=k-mini;

		for(int j=0;j<moves.size();j++){
			if(diff>0){
				int m=moves[j].size()-1;

				m=min(diff,m);

				vector<int> temp1;

				for(int i=0;i<moves[j].size();i++){
					if(i<=m){
						cout<<1<<" "<<moves[j][i]+1<<endl;
					}
					else
						temp1.push_back(moves[j][i]);
				}

				if(temp1.size()){
					cout<<temp1.size()<<" ";

					for(int x:temp1){
						cout<<x+1<<" ";
					}
					cout<<endl;
				}

			}

			else{
				cout<<moves[j].size()<<" ";
				for(int x:moves[j]){
					cout<<x+1<<" ";
				}

				cout<<endl;
			}

		}
	}
	else{
		printf("-1\n");
	}

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define pfi(a) printf("%d",a);
#define pfl(a) printf("%lld",a);
#define pfin(a) printf("%d\n",a);
#define pfln(a) printf("%lld\n",a);
#define sfi(a) scanf("%d",&a);
#define sfl(a) scanf("%lld",&a);
#define pb push_back
#define f(i,a,b) for(int i=a;i<b;i++)
#define ll long long
const int N=3e3+5;
const int M= 998244353;
const int modi6=166666668;

int main(){

	ll n,k;
	sfl(n) sfl(k)

	string s;
	cin>>s;

	vector<vector<int>>  moves;

	ll mini=0,maxi=0;

	while(1){
		vector<int> temp;

		for(int i=0;i+1<s.length();){
			if(s[i]=='R' && s[i+1]=='L'){
				s[i]='L';
				s[i+1]='R';
				temp.push_back(i);
				i+=2;
			}
			else
				i++;
		}

		if(temp.size()==0)
			break;

		mini++;
		maxi+=temp.size();

		moves.push_back(temp);

		//cout<<s<<endl;
	}

	//cout<<mini<<" "<<maxi<<endl;

	if(k>=mini && k<=maxi){
		int diff=k-mini;

		//cout<<mini<<" "<<diff<<endl;

		for(int j=0;j<moves.size();j++){
			if(diff>0){
				int m=moves[j].size()-1;

				m=min(diff,m);

				diff-=m;

				//cout<<j<<" "<<m<<" **"<<endl;

				vector<int> temp1;

				for(int i=0;i<moves[j].size();i++){
					if(i<=m){
						cout<<1<<" "<<moves[j][i]+1<<endl;
					}
					else
						temp1.push_back(moves[j][i]);
				}

				if(temp1.size()){
					cout<<temp1.size()<<" ";

					for(int x:temp1){
						cout<<x+1<<" ";
					}
					cout<<endl;
				}

			}

			else{
				cout<<moves[j].size()<<" ";
				for(int x:moves[j]){
					cout<<x+1<<" ";
				}

				cout<<endl;
			}

		}
	}
	else{
		printf("-1\n");
	}

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define pfi(a) printf("%d",a);
#define pfl(a) printf("%lld",a);
#define pfin(a) printf("%d\n",a);
#define pfln(a) printf("%lld\n",a);
#define sfi(a) scanf("%d",&a);
#define sfl(a) scanf("%lld",&a);
#define pb push_back
#define f(i,a,b) for(int i=a;i<b;i++)
#define ll long long
const int N=3e3+5;
const int M= 998244353;
const int modi6=166666668;

int main(){

	ll n,k;
	sfl(n) sfl(k)

	string s;
	cin>>s;

	vector<vector<int>>  moves;

	ll mini=0,maxi=0;

	while(1){
		vector<int> temp;

		for(int i=0;i+1<s.length();){
			if(s[i]=='R' && s[i+1]=='L'){
				s[i]='L';
				s[i+1]='R';
				temp.push_back(i);
				i+=2;
			}
			else
				i++;
		}

		if(temp.size()==0)
			break;

		mini++;
		maxi+=temp.size();

		moves.push_back(temp);

		//cout<<s<<endl;
	}

	//cout<<mini<<" "<<maxi<<endl;

	if(k>=mini && k<=maxi){
		int diff=k-mini;

		for(int j=0;j<moves.size();j++){
			if(diff>0){
				int m=moves[j].size()-1;

				m=min(diff,m);

				vector<int> temp1;

				for(int i=0;i<moves[j].size();i++){
					if(i<=m){
						cout<<1<<" "<<moves[j][i]<<endl;
					}
					else
						temp1.push_back(moves[j][i]);
				}

				if(temp1.size()){
					cout<<temp1.size()<<" ";

				for(int x:temp1){
					cout<<x<<" ";
				}
				cout<<endl;
				}

			}

			else{
				cout<<moves[j].size()<<" ";
				for(int x:moves[j]){
					cout<<x+1<<" ";
				}

				cout<<endl;
			}

		}
	}
	else{
		printf("-1\n");
	}

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define pfi(a) printf("%d",a);
#define pfl(a) printf("%lld",a);
#define pfin(a) printf("%d\n",a);
#define pfln(a) printf("%lld\n",a);
#define sfi(a) scanf("%d",&a);
#define sfl(a) scanf("%lld",&a);
#define pb push_back
#define f(i,a,b) for(int i=a;i<b;i++)
#define ll long long
const int N=3e3+5;
const int M= 998244353;
const int modi6=166666668;

int main(){

	ll n,k;
	sfl(n) sfl(k)

	string s;
	cin>>s;

	vector<vector<int>>  moves;

	ll mini=0,maxi=0;

	while(1){
		vector<int> temp;

		for(int i=0;i+1<s.length();){
			if(s[i]=='R' && s[i+1]=='L'){
				s[i]='L';
				s[i+1]='R';
				temp.push_back(i);
				i+=2;
			}
			else
				i++;
		}

		if(temp.size()==0)
			break;

		mini++;
		maxi+=temp.size();

		moves.push_back(temp);

		//cout<<s<<endl;
	}

	//cout<<mini<<" "<<maxi<<endl;

	if(k>=mini && k<=maxi){
		int diff=k-mini;

		for(int j=0;j<moves.size();j++){
			if(diff>0){
				int m=moves[j].size()-1;

				m=min(diff,m);

				diff-=m;

				for(int i=0;i<m+1;i++){
					cout<<1<<" "<<moves[j][i]+1;
					cout<<endl;
				}

				if((m+1)<moves[j].size()){
					cout<<moves[j].size()-(m+1)<<" ";
					for(int i=m+1;i<moves[j].size();i++){
						cout<<moves[j][i]+1<<" ";
					}
					cout<<endl;
				}
			}

			else{
				cout<<moves[j].size()<<" ";
				for(int x:moves[j]){
					cout<<x+1<<" ";
				}

				cout<<endl;
			}

		}
	}
	else{
		printf("-1\n");
	}

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define pfi(a) printf("%d",a);
#define pfl(a) printf("%lld",a);
#define pfin(a) printf("%d\n",a);
#define pfln(a) printf("%lld\n",a);
#define sfi(a) scanf("%d",&a);
#define sfl(a) scanf("%lld",&a);
#define pb push_back
#define f(i,a,b) for(int i=a;i<b;i++)
#define ll long long
const int N=3e3+5;
const int M= 998244353;
const int modi6=166666668;

int main(){

	ll n,k;
	sfl(n) sfl(k)

	string s;
	cin>>s;

	vector<vector<int>>  moves;

	ll mini=0,maxi=0;

	while(1){
		vector<int> temp;

		for(int i=0;i+1<s.length();){
			if(s[i]=='R' && s[i+1]=='L'){
				s[i]='L';
				s[i+1]='R';
				temp.push_back(i);
				i+=2;
			}
			else
				i++;
		}

		if(temp.size()==0)
			break;

		mini++;
		maxi+=temp.size();

		moves.push_back(temp);

		//cout<<s<<endl;
	}

	//cout<<mini<<" "<<maxi<<endl;

	if(k>=mini && k<=maxi){
		int diff=k-mini;

		//cout<<mini<<" "<<diff<<endl;

		for(int j=0;j<moves.size();j++){
			if(diff>0){
				int m=moves[j].size()-1;

				m=min(diff,m);

				diff-=m;

				//cout<<moves[j].size()<<" **"<<m<<endl;
				//cout<<j<<" "<<m<<" **"<<endl;

				vector<int> temp1;

				for(int i=0;i<moves[j].size();i++){
					if(i<m){
						cout<<1<<" "<<moves[j][i]+1<<endl;
					}
					else
						temp1.push_back(moves[j][i]);
				}

				if(temp1.size()){
					cout<<temp1.size()<<" ";

					for(int x:temp1){
						cout<<x+1<<" ";
					}
					cout<<endl;
				}

			}

			else{
				cout<<moves[j].size()<<" ";
				for(int x:moves[j]){
					cout<<x+1<<" ";
				}

				cout<<endl;
			}

		}
	}
	else{
		printf("-1\n");
	}

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define pfi(a) printf("%d",a);
#define pfl(a) printf("%lld",a);
#define pfin(a) printf("%d\n",a);
#define pfln(a) printf("%lld\n",a);
#define sfi(a) scanf("%d",&a);
#define sfl(a) scanf("%lld",&a);
#define pb push_back
#define f(i,a,b) for(int i=a;i<b;i++)
#define ll long long
#define endl "\n"
const int N=3e3+5;
const int M= 998244353;
const int modi6=166666668;

int main(){

	ll n,k;
	sfl(n) sfl(k)

	string s;
	cin>>s;

	vector<vector<int>>  moves;

	ll mini=0,maxi=0;

	while(1){
		vector<int> temp;

		for(int i=0;i+1<s.length();){
			if(s[i]=='R' && s[i+1]=='L'){
				s[i]='L';
				s[i+1]='R';
				temp.push_back(i);
				i+=2;
			}
			else
				i++;
		}

		if(temp.size()==0)
			break;

		mini++;
		maxi+=temp.size();

		moves.push_back(temp);

		//cout<<s<<endl;
	}

	//cout<<mini<<" "<<maxi<<endl;

	if(k>=mini && k<=maxi){
		int diff=k-mini;

		//cout<<mini<<" "<<diff<<endl;

		for(int j=0;j<moves.size();j++){
			if(diff>0){
				int m=moves[j].size()-1;

				m=min(diff,m);

				diff-=m;

				//cout<<moves[j].size()<<" **"<<m<<endl;
				//cout<<j<<" "<<m<<" **"<<endl;

				vector<int> temp1;

				for(int i=0;i<moves[j].size();i++){
					if(i<m){
						printf("1 %d\n",moves[j][i]+1);

					}
					else
						temp1.push_back(moves[j][i]);
				}

				if(temp1.size()){
					printf("%d\n",(int)temp1.size() );

					for(int x:temp1){
						printf("%d ", x+1);
					}
					printf("\n");
				}

			}

			else{
				printf("%d\n",(int)moves[j].size() );
				for(int x:temp1){
						printf("%d ", x+1);
					}
					printf("\n");
			}

		}
	}
	else{
		printf("-1\n");
	}

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define pfi(a) printf("%d",a);
#define pfl(a) printf("%lld",a);
#define pfin(a) printf("%d\n",a);
#define pfln(a) printf("%lld\n",a);
#define sfi(a) scanf("%d",&a);
#define sfl(a) scanf("%lld",&a);
#define pb push_back
#define f(i,a,b) for(int i=a;i<b;i++)
#define ll long long
const int N=3e3+5;
const int M= 998244353;
const int modi6=166666668;

int main(){

	ll n,k;
	sfl(n) sfl(k)

	string s;
	cin>>s;

	vector<vector<int>>  moves;

	ll mini=0,maxi=0;

	while(1){
		vector<int> temp;

		for(int i=0;i+1<s.length();){
			if(s[i]=='R' && s[i+1]=='L'){
				s[i]='L';
				s[i+1]='R';
				temp.push_back(i);
				i+=2;
			}
			else
				i++;
		}

		if(temp.size()==0)
			break;

		mini++;
		maxi+=temp.size();

		moves.push_back(temp);

		//cout<<s<<endl;
	}

	//cout<<mini<<" "<<maxi<<endl;

	if(k>=mini && k<=maxi){
		int diff=k-mini;

		for(int j=0;j<moves.size();j++){
			if(diff>0){
				int m=moves[j].size()-1;

				m=min(diff,m);

				vector<int> temp1;

				for(int i=0;i<moves[j].size();i++){
					if(i<=m){
						cout<<1<<" "<<moves[j][i]<<endl;
					}
					else
						temp1.push_back(moves[j][i]);
				}

				cout<<temp1.size()<<" ";

				for(int x:temp1){
					cout<<x<<" ";
				}
				cout<<endl;
			}

			else{
				cout<<moves[j].size()<<" ";
				for(int x:moves[j]){
					cout<<x+1<<" ";
				}

				cout<<endl;
			}

		}
	}
	else{
		printf("-1\n");
	}

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define pfi(a) printf("%d",a);
#define pfl(a) printf("%lld",a);
#define pfin(a) printf("%d\n",a);
#define pfln(a) printf("%lld\n",a);
#define sfi(a) scanf("%d",&a);
#define sfl(a) scanf("%lld",&a);
#define pb push_back
#define f(i,a,b) for(int i=a;i<b;i++)
#define ll long long
const int N=3e3+5;
const int M= 998244353;
const int modi6=166666668;

int main(){

	ll n,k;
	sfl(n) sfl(k)

	string s;
	cin>>s;

	vector<vector<int>>  moves;

	ll mini=0,maxi=0;

	while(1){
		vector<int> temp;

		for(int i=0;i+1<s.length();){
			if(s[i]=='R' && s[i+1]=='L'){
				s[i]='L';
				s[i+1]='R';
				temp.push_back(i);
				i+=2;
			}
			else
				i++;
		}

		if(temp.size()==0)
			break;

		mini++;
		maxi+=temp.size();

		moves.push_back(temp);

		//cout<<s<<endl;
	}

	//cout<<mini<<" "<<maxi<<endl;

	if(k>=mini && k<=maxi){
		int diff=k-mini;

		for(int j=0;j<moves.size();j++){
			if(diff>0){
				int m=moves[j].size()-1;

				m=min(diff,m);

				diff-=m;

				for(int i=0;i<m+1;i++){
					cout<<1<<" "<<moves[j][i]+1;
					cout<<endl;
				}

				if(m+1<moves[j].size()){
					cout<<moves[j].size()-(m+1)<<" ";
					for(int i=m+1;i<moves[j].size();i++){
						cout<<moves[j][i]+1<<" ";
					}
					cout<<endl;
				}
			}

			else{
				cout<<moves[j].size()<<" ";
				for(int x:moves[j]){
					cout<<x+1<<" ";
				}

				cout<<endl;
			}

		}
	}
	else{
		printf("-1\n");
	}

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define pfi(a) printf("%d",a);
#define pfl(a) printf("%lld",a);
#define pfin(a) printf("%d\n",a);
#define pfln(a) printf("%lld\n",a);
#define sfi(a) scanf("%d",&a);
#define sfl(a) scanf("%lld",&a);
#define pb push_back
#define f(i,a,b) for(int i=a;i<b;i++)
#define ll long long
#define endl "\n"
const int N=3e3+5;
const int M= 998244353;
const int modi6=166666668;

int main(){

	ll n,k;
	sfl(n) sfl(k)

	string s;
	cin>>s;

	vector<vector<int>>  moves;

	ll mini=0,maxi=0;

	while(1){
		vector<int> temp;

		for(int i=0;i+1<s.length();){
			if(s[i]=='R' && s[i+1]=='L'){
				s[i]='L';
				s[i+1]='R';
				temp.push_back(i);
				i+=2;
			}
			else
				i++;
		}

		if(temp.size()==0)
			break;

		mini++;
		maxi+=temp.size();

		moves.push_back(temp);

		//cout<<s<<endl;
	}

	//cout<<mini<<" "<<maxi<<endl;

	if(k>=mini && k<=maxi){
		int diff=k-mini;

		//cout<<mini<<" "<<diff<<endl;

		for(int j=0;j<moves.size();j++){
			if(diff>0){
				int m=moves[j].size()-1;

				m=min(diff,m);

				diff-=m;

				//cout<<moves[j].size()<<" **"<<m<<endl;
				//cout<<j<<" "<<m<<" **"<<endl;

				vector<int> temp1;

				for(int i=0;i<moves[j].size();i++){
					if(i<m){
						printf("1 %d\n",moves[j][i]+1);

					}
					else
						temp1.push_back(moves[j][i]);
				}

				if(temp1.size()){
					printf("%d\n",(int)temp1.size() );

					for(int x:temp1){
						printf("%d ", x+1);
					}
					printf("\n");
				}

			}

			else{
				printf("%d\n",(int)moves[j].size() );
				for(int x:moves[j]){
						printf("%d ", x+1);
					}
					printf("\n");
			}

		}
	}
	else{
		printf("-1\n");
	}

	return 0;
}


#include <bits/stdc++.h>
/*#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;*/
using namespace std;
#define pb push_back
#define mp make_pair
#define ll long long
#define ld long double
#define F first
#define fr(i,n) for(ll i=1;i<=n;i++)
#define mm(a,k) memset(a,k,sizeof(a))
#define S second
#define all(a) a.begin(),a.end()
#define pii pair<int,int>
#define pll pair<long long, long long>
#define mod 998244353
#define inf 10000000000000ll
/*typedef tree<ll, null_type, less<ll>, rb_tree_tag,
             tree_order_statistics_node_update>
    new_data_set;*/

ll power(ll a,ll b){
    ll r=1;
    while(b!=0)
    {
        if(b%2!=0){r=r*a; r%=mod;}
        a=a*a; a=a%mod; b=b/2;
    }
    return r;
}

int main()
{   ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int t=1;
    //memset(prime,true,sizeof(prime));
    //cin>>t;
    while(t--){
        int n,k,avl; cin>>n>>k;
        string s; cin>>s; avl=k;
        queue<int> q;
        int tot=0,ct=0;
        bool f=false;
        for(int i=0;i<n;i++){
            if(s[i]=='R'){ ct+=1; }
            else{ tot+=ct; }
        }
        for(int i=1;i<n;i++){ if((s[i-1]=='R')&&(s[i]=='L')){ q.push(i); }}
        vector<vector<int>> ans; vector<int> tmp;
        ct=0; if(k>tot){ cout<<-1<<endl; continue; }
        while(avl!=0&&!q.empty()){
            tmp.clear();
            //cout<<avl<<" "<<q.size()<<" "<<tot<<endl;
            if((avl-1)>=(tot-q.size())){
                int p=q.size(),r;
                for(int i=1;i<=p;i++){
                    r=q.front(); q.pop();
                    tmp.pb(r);
                    if(r>=2){ if(s[r-2]=='R'){ q.push(r-1); } }
                    s[r]='R'; s[r-1]='L';
                    //cout<<r<<" "<<s<<endl;
                }
                avl=avl-1;
                tot=tot-p;
                //cout<<avl<<" "<<tot<<endl;
            }
            else{
                int p=tot-(avl-1),r;
                for(int i=1;i<=p;i++){
                    r=q.front(); q.pop();
                    tmp.pb(r);
                    if(r>=3){ if(s[r-2]=='R'){ q.push(r-1); } } s[r]='R'; s[r-1]='L';
                }
                avl=avl-1;
                tot=tot-p;
            }
            ans.pb(tmp);
        }

        if(!q.empty()||avl!=0){ cout<<-1<<endl; }
        else{
            for(int i=0;i<ans.size();i++){
                cout<<ans[i].size()<<" ";
                for(int j=0;j<ans[i].size();j++){
                    cout<<ans[i][j]<<" ";
                }cout<<endl;
            }
        }
    }
}


#include <bits/stdc++.h>
/*#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;*/
using namespace std;
#define pb push_back
#define mp make_pair
#define ll long long
#define ld long double
#define F first
#define fr(i,n) for(ll i=1;i<=n;i++)
#define mm(a,k) memset(a,k,sizeof(a))
#define S second
#define all(a) a.begin(),a.end()
#define pii pair<int,int>
#define pll pair<long long, long long>
#define mod 998244353
#define inf 10000000000000ll
/*typedef tree<ll, null_type, less<ll>, rb_tree_tag,
             tree_order_statistics_node_update>
    new_data_set;*/

ll power(ll a,ll b){
    ll r=1;
    while(b!=0)
    {
        if(b%2!=0){r=r*a; r%=mod;}
        a=a*a; a=a%mod; b=b/2;
    }
    return r;
}

int main()
{   ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int t=1;
    //memset(prime,true,sizeof(prime));
    //cin>>t;
    while(t--){
        int n,k,avl; cin>>n>>k;
        string s; cin>>s; avl=k;
        queue<int> q;
        int tot=0,ct=0;
        bool f=false;
        for(int i=0;i<n;i++){
            if(s[i]=='R'){ ct+=1; }
            else{ tot+=ct; }
        }
        for(int i=1;i<n;i++){ if((s[i-1]=='R')&&(s[i]=='L')){ q.push(i); }}
        vector<vector<int>> ans; vector<int> tmp;
        ct=0; if(k>tot){ cout<<-1<<endl; continue; }
        while(!q.empty()){
            tmp.clear();
            //cout<<avl<<" "<<q.size()<<" "<<tot<<endl;
              int p,r;
            if((avl-1)<=(tot-q.size())){ p=q.size(); }
            else{ p=tot-(avl-1); }

            for(int i=1;i<=p;i++){
                r=q.front(); q.pop();
                tmp.pb(r);
                s[r]='R'; s[r-1]='L';
                //cout<<r<<" "<<s<<endl;
            }
            avl=avl-1;
            tot=tot-p;
            set<int> jt;
            for(int i=0;i<tmp.size();i++){
                p=tmp[i];
                if((p>=2)&&(s[p-2]=='R')){ jt.insert(p-1); }
                if((p<=(n-2))&&(s[p+1]=='L')){ jt.insert(p+1); }
            }
            while(!jt.empty()){ q.push(*jt.begin()); jt.erase(jt.begin()); }
            //cout<<avl<<" "<<tot<<endl;
            ans.pb(tmp);
        }

        if(avl!=0){ cout<<-1<<endl; }
        else{
            for(int i=0;i<ans.size();i++){
                cout<<ans[i].size()<<" ";
                for(int j=0;j<ans[i].size();j++){
                    cout<<ans[i][j]<<" ";
                }cout<<'\n';
            }
        }
    }
}


#include <bits/stdc++.h>
/*#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;*/
using namespace std;
#define pb push_back
#define mp make_pair
#define ll long long
#define ld long double
#define F first
#define fr(i,n) for(ll i=1;i<=n;i++)
#define mm(a,k) memset(a,k,sizeof(a))
#define S second
#define all(a) a.begin(),a.end()
#define pii pair<int,int>
#define pll pair<long long, long long>
#define mod 998244353
#define inf 10000000000000ll
/*typedef tree<ll, null_type, less<ll>, rb_tree_tag,
             tree_order_statistics_node_update>
    new_data_set;*/

ll power(ll a,ll b){
    ll r=1;
    while(b!=0)
    {
        if(b%2!=0){r=r*a; r%=mod;}
        a=a*a; a=a%mod; b=b/2;
    }
    return r;
}

int main()
{   ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int t=1;
    //memset(prime,true,sizeof(prime));
    //cin>>t;
    while(t--){
        int n,k,avl; cin>>n>>k;
        string s; cin>>s; avl=k;
        queue<int> q;
        int tot=0,ct=0;
        bool f=false;
        for(int i=0;i<n;i++){
            if(s[i]=='R'){ ct+=1; }
            else{ tot+=ct; }
        }
        for(int i=1;i<n;i++){ if((s[i-1]=='R')&&(s[i]=='L')){ q.push(i); }}
        vector<vector<int>> ans; vector<int> tmp;
        ct=0; if(k>tot){ cout<<-1<<endl; continue; }
        while(avl!=0&&!q.empty()){
            tmp.clear();
            if((avl-1)>=(tot-q.size())){
                int p=q.size(),r;
                for(int i=1;i<=p;i++){
                    r=q.front(); q.pop();
                    tmp.pb(r);
                    if(r>=2){ if(s[r-2]=='R'){ q.push(r-1); } }
                    s[r]='R'; s[r-1]='L';
                    //cout<<r<<" "<<s<<endl;
                }
                avl=avl-1;
                tot=tot-p;
                //cout<<avl<<" "<<tot<<endl;
            }
            else{
                int p=tot-(avl-1),r;
                for(int i=1;i<=p;i++){
                    r=q.front(); q.pop();
                    tmp.pb(r);
                    if(r>=2){ if(s[r-2]=='R'){ q.push(r-1); } }
                    s[r]='R'; s[r-1]='L';
                }
                avl=avl-1;
                tot=tot-p;
            }
            ans.pb(tmp);
        }

        if(!q.empty()||avl!=0){ cout<<-1<<endl; }
        else{
            for(int i=0;i<ans.size();i++){
                cout<<ans[i].size()<<" ";
                for(int j=0;j<ans[i].size();j++){
                    cout<<ans[i][j]<<" ";
                }cout<<endl;
            }
        }
    }
}


#include <bits/stdc++.h>
/*#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;*/
using namespace std;
#define pb push_back
#define mp make_pair
#define ll long long
#define ld long double
#define F first
#define fr(i,n) for(ll i=1;i<=n;i++)
#define mm(a,k) memset(a,k,sizeof(a))
#define S second
#define all(a) a.begin(),a.end()
#define pii pair<int,int>
#define pll pair<long long, long long>
#define mod 998244353
#define inf 10000000000000ll
/*typedef tree<ll, null_type, less<ll>, rb_tree_tag,
             tree_order_statistics_node_update>
    new_data_set;*/

ll power(ll a,ll b){
    ll r=1;
    while(b!=0)
    {
        if(b%2!=0){r=r*a; r%=mod;}
        a=a*a; a=a%mod; b=b/2;
    }
    return r;
}

int main()
{   ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int t=1;
    //memset(prime,true,sizeof(prime));
    //cin>>t;
    while(t--){
        int n,k,avl; cin>>n>>k;
        string s; cin>>s; avl=k;
        queue<int> q;
        int tot=0,ct=0;
        bool f=false;
        for(int i=0;i<n;i++){
            if(s[i]=='R'){ ct+=1; }
            else{ tot+=ct; }
        }
        for(int i=1;i<n;i++){ if((s[i-1]=='R')&&(s[i]=='L')){ q.push(i); }}
        vector<vector<int>> ans; vector<int> tmp;
        ct=0; if(k>tot){ cout<<-1<<endl; continue; }
        while(avl!=0&&!q.empty()){
            tmp.clear();
            if((avl-1)>=(tot-q.size())){
                int p=q.size(),r;
                for(int i=1;i<=p;i++){
                    r=q.front(); q.pop();
                    tmp.pb(r);
                    if(r>=2){ if(s[r-2]=='R'){ q.push(r-1); } }
                    s[r]='R'; s[r-1]='L';
                    //cout<<r<<" "<<s<<endl;
                }
                avl=avl-1;
                tot=tot-p;
                //cout<<avl<<" "<<tot<<endl;
            }
            else{
                int p=q.size();
                p=min(p,tot-(avl-1));
                int r;

                for(int i=1;i<=p;i++){
                    r=q.front(); q.pop();
                    tmp.pb(r);
                    if(r>=2){ if(s[r-2]=='R'){ q.push(r-1); } }
                    s[r]='R'; s[r-1]='L';
                }
                avl=avl-1;
                tot=tot-p;
            }
            ans.pb(tmp);
        }

        if(!q.empty()||avl!=0){ cout<<-1<<endl; }
        else{
            for(int i=0;i<ans.size();i++){
                cout<<ans[i].size()<<" ";
                for(int j=0;j<ans[i].size();j++){
                    cout<<ans[i][j]<<" ";
                }cout<<endl;
            }
        }
    }
}


#include <bits/stdc++.h>
/*#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;*/
using namespace std;
#define pb push_back
#define mp make_pair
#define ll long long
#define ld long double
#define F first
#define fr(i,n) for(ll i=1;i<=n;i++)
#define mm(a,k) memset(a,k,sizeof(a))
#define S second
#define all(a) a.begin(),a.end()
#define pii pair<int,int>
#define pll pair<long long, long long>
#define mod 998244353
#define inf 10000000000000ll
/*typedef tree<ll, null_type, less<ll>, rb_tree_tag,
             tree_order_statistics_node_update>
    new_data_set;*/

ll power(ll a,ll b){
    ll r=1;
    while(b!=0)
    {
        if(b%2!=0){r=r*a; r%=mod;}
        a=a*a; a=a%mod; b=b/2;
    }
    return r;
}

int main()
{   ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int t=1;
    //memset(prime,true,sizeof(prime));
    //cin>>t;
    while(t--){
        int n,k,avl; cin>>n>>k;
        string s; cin>>s; avl=k;
        queue<int> q;
        int tot=0,ct=0;
        bool f=false;
        for(int i=0;i<n;i++){
            if(s[i]=='R'){ ct+=1; }
            else{ tot+=ct; }
        }
        for(int i=1;i<n;i++){ if((s[i-1]=='R')&&(s[i]=='L')){ q.push(i); }}
        vector<vector<int>> ans; vector<int> tmp;
        ct=0; if(k>tot){ cout<<-1<<endl; continue; }
        while(!q.empty()){
            tmp.clear();
            //cout<<avl<<" "<<q.size()<<" "<<tot<<endl;
              int p,r;
            if((avl-1)<=(tot-q.size())){ p=q.size(); }
            else{ p=tot-(avl-1); }

            for(int i=1;i<=p;i++){
                r=q.front(); q.pop();
                tmp.pb(r);
                s[r]='R'; s[r-1]='L';
                //cout<<r<<" "<<s<<endl;
            }
            avl=avl-1;
            tot=tot-p;
            set<int> jt;
            for(int i=0;i<tmp.size();i++){
                p=tmp[i];
                if((p>=2)&&(s[p-2]=='R')){ jt.insert(p-1); }
                if((p<=(n-2))&&(s[p+1]=='L')){ jt.insert(p+1); }
            }
            while(!jt.empty()){ q.push(*jt.begin()); jt.erase(jt.begin()); }
            //cout<<avl<<" "<<tot<<endl;
            ans.pb(tmp);
        }

        if(avl!=0){ cout<<-1<<endl; }
        else{
            for(int i=0;i<ans.size();i++){
                cout<<ans[i].size()<<" ";
                for(int j=0;j<ans[i].size();j++){
                    cout<<ans[i][j]<<" ";
                }cout<<endl;
            }
        }
    }
}


#include <bits/stdc++.h>
/*#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;*/
using namespace std;
#define pb push_back
#define mp make_pair
#define ll long long
#define ld long double
#define F first
#define fr(i,n) for(ll i=1;i<=n;i++)
#define mm(a,k) memset(a,k,sizeof(a))
#define S second
#define vv(k) vector<k>
#define all(a) a.begin(),a.end()
#define pii pair<int,int>
#define pll pair<long long, long long>
#define mod 998244353
#define inf 10000000000000ll
#define maxn 3009
/*typedef tree<ll, null_type, less<ll>, rb_tree_tag,
             tree_order_statistics_node_update>
    new_data_set;*/
int lm[maxn*maxn];

ll power(ll a,ll b){
    ll r=1;
    while(b!=0)
    {
        if(b%2!=0){r=r*a; r%=mod;}
        a=a*a; a=a%mod; b=b/2;
    }
    return r;
}

int main()
{   ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int t=1;
    //memset(prime,true,sizeof(prime));
    //cin>>t;
    while(t--){
        int n,k,al,ar; cin>>n>>k;
        string s; cin>>s;
        int nm=0,ct=0,mm=0;
        for(int i=0;i<n;i++){
            if(s[i]=='L'){ nm+=ct; }
            else{ ct+=1; }
        }

        vv(int) ans;

        for(int i=1;i<=k;i++){ lm[i]=1; }
        while(1){
            ct=0;
            for(int i=0;i<(n-1);){
                if((s[i]=='R')&&(s[i+1]=='L')){ ans.pb(i+1); s[i]='L'; s[i+1]='R'; i=i+2; ct+=1; }
                else{ i=i+1; }
            }
            if(ct==0){ break; }
            mm+=1; lm[mm]=ct;

        }
        if(k>nm||k<mm){ cout<<-1<<endl; }
        else{
            int st=0,rp;
            for(int i=1;i<=k;i++){
                al=k-i;
                ar=ans.size()-(st);
                //cout<<lm[i]<<" "<<al<<" "<<ar<<endl;
                if((ar-lm[i])>al){
                    cout<<lm[i]<<" ";
                    for(int j=1;j<=lm[i];j++){ cout<<ans[st]<<" "; st+=1; }
                    cout<<'\n';
                }
                else{
                    rp=ar-al;
                    cout<<rp<<" ";
                    for(int j=1;j<=rp;j++){ cout<<ans[st]<<" "; st+=1; }
                    cout<<'\n';
                }
            }
        }
    }
}


#include <bits/stdc++.h>
/*#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;*/
using namespace std;
#define pb push_back
#define mp make_pair
#define ll long long
#define ld long double
#define F first
#define fr(i,n) for(ll i=1;i<=n;i++)
#define mm(a,k) memset(a,k,sizeof(a))
#define S second
#define all(a) a.begin(),a.end()
#define pii pair<int,int>
#define pll pair<long long, long long>
#define mod 998244353
#define inf 10000000000000ll
/*typedef tree<ll, null_type, less<ll>, rb_tree_tag,
             tree_order_statistics_node_update>
    new_data_set;*/

ll power(ll a,ll b){
    ll r=1;
    while(b!=0)
    {
        if(b%2!=0){r=r*a; r%=mod;}
        a=a*a; a=a%mod; b=b/2;
    }
    return r;
}

int main()
{   ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int t=1;
    //memset(prime,true,sizeof(prime));
    //cin>>t;
    while(t--){
        int n,k,avl; cin>>n>>k;
        string s; cin>>s; avl=k;
        queue<int> q;
        int tot=0,ct=0;
        bool f=false;
        for(int i=0;i<n;i++){
            if(s[i]=='R'){ ct+=1; }
            else{ tot+=ct; }
        }
        for(int i=1;i<n;i++){ if((s[i-1]=='R')&&(s[i]=='L')){ q.push(i); }}
        vector<vector<int>> ans; vector<int> tmp;
        ct=0; if(k>tot){ cout<<-1<<endl; continue; }
        while(avl!=0){
            tmp.clear();
            //cout<<avl<<" "<<q.size()<<" "<<tot<<endl;
            if((avl-1)>=(tot-q.size())){
                int p=q.size(),r;
                for(int i=1;i<=p;i++){
                    r=q.front(); q.pop();
                    tmp.pb(r);
                    if(r>=2){ if(s[r-2]=='R'){ q.push(r-1); } }
                    s[r]='R'; s[r-1]='L';
                    //cout<<r<<" "<<s<<endl;
                }
                avl=avl-1;
                tot=tot-p;
                //cout<<avl<<" "<<tot<<endl;
            }
            else{
                int p=tot-(avl-1),r;
                for(int i=1;i<=p;i++){
                    r=q.front(); q.pop();
                    tmp.pb(r);
                    if(r>=3){ if(s[r-2]=='R'){ q.push(r-1); s[r]='R'; s[r-1]='L'; } }
                }
                avl=avl-1;
                tot=tot-p;
            }
            ans.pb(tmp);
        }

        if(!q.empty()){ cout<<-1<<endl; }
        else{
            for(int i=0;i<ans.size();i++){
                cout<<ans[i].size()<<" ";
                for(int j=0;j<ans[i].size();j++){
                    cout<<ans[i][j]<<" ";
                }cout<<endl;
            }
        }
    }
}


#include <bits/stdc++.h>
/*#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;*/
using namespace std;
#define pb push_back
#define mp make_pair
#define ll long long
#define ld long double
#define F first
#define fr(i,n) for(ll i=1;i<=n;i++)
#define mm(a,k) memset(a,k,sizeof(a))
#define S second
#define all(a) a.begin(),a.end()
#define pii pair<int,int>
#define pll pair<long long, long long>
#define mod 998244353
#define inf 10000000000000ll
/*typedef tree<ll, null_type, less<ll>, rb_tree_tag,
             tree_order_statistics_node_update>
    new_data_set;*/

ll power(ll a,ll b){
    ll r=1;
    while(b!=0)
    {
        if(b%2!=0){r=r*a; r%=mod;}
        a=a*a; a=a%mod; b=b/2;
    }
    return r;
}

int main()
{   ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int t=1;
    //memset(prime,true,sizeof(prime));
    //cin>>t;
    while(t--){
        int n,k,avl; cin>>n>>k;
        string s; cin>>s; avl=k;
        queue<int> q;
        int tot=0,ct=0;
        bool f=false;
        for(int i=0;i<n;i++){
            if(s[i]=='R'){ ct+=1; }
            else{ tot+=ct; }
        }
        for(int i=1;i<n;i++){ if((s[i-1]=='R')&&(s[i]=='L')){ q.push(i); }}
        vector<vector<int>> ans; vector<int> tmp;
        ct=0; if(k>tot){ cout<<-1<<endl; continue; }
        while(avl!=0&&!q.empty()){
            tmp.clear();
            //cout<<avl<<" "<<q.size()<<" "<<tot<<endl;
            int p,r;
            if((avl-1)<=(tot-q.size())){ p=q.size(); }
            else{ p=tot-(avl-1); }

            for(int i=1;i<=p;i++){
                r=q.front(); q.pop();
                tmp.pb(r);
                s[r]='R'; s[r-1]='L';
                //cout<<r<<" "<<s<<endl;
            }
            avl=avl-1;
            tot=tot-p;
            set<int> jt;
            for(int i=0;i<tmp.size();i++){
                p=tmp[i];
                if((p>=2)&&(s[p-2]=='R')){ jt.insert(p-1); }
                if((p<=(n-2))&&(s[p+1]=='L')){ jt.insert(p+1); }
            }
            while(!jt.empty()){ q.push(*jt.begin()); jt.erase(jt.begin()); }
            //cout<<avl<<" "<<tot<<endl;

            ans.pb(tmp);
        }

        if(!q.empty()||avl!=0){ cout<<-1<<endl; }
        else{
            for(int i=0;i<ans.size();i++){
                cout<<ans[i].size()<<" ";
                for(int j=0;j<ans[i].size();j++){
                    cout<<ans[i][j]<<" ";
                }cout<<endl;
            }
        }
    }
}


#include <bits/stdc++.h>
/*#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;*/
using namespace std;
#define pb push_back
#define mp make_pair
#define ll long long
#define ld long double
#define F first
#define fr(i,n) for(ll i=1;i<=n;i++)
#define mm(a,k) memset(a,k,sizeof(a))
#define S second
#define vv(k) vector<k>
#define all(a) a.begin(),a.end()
#define pii pair<int,int>
#define pll pair<long long, long long>
#define mod 998244353
#define inf 10000000000000ll
/*typedef tree<ll, null_type, less<ll>, rb_tree_tag,
             tree_order_statistics_node_update>
    new_data_set;*/

ll power(ll a,ll b){
    ll r=1;
    while(b!=0)
    {
        if(b%2!=0){r=r*a; r%=mod;}
        a=a*a; a=a%mod; b=b/2;
    }
    return r;
}

int main()
{   ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int t=1;
    //memset(prime,true,sizeof(prime));
    //cin>>t;
    while(t--){
        int n,k,al,ar; cin>>n>>k;
        string s; cin>>s;
        int nm=0,ct=0,mm=0;
        for(int i=0;i<n;i++){
            if(s[i]=='L'){ nm+=ct; }
            else{ ct+=1; }
        }

        vv(int) ans;
        int lm[k+1];
        for(int i=1;i<=k;i++){ lm[i]=1; }
        while(1){
            ct=0;
            for(int i=0;i<(n-1);){
                if((s[i]=='R')&&(s[i+1]=='L')){ ans.pb(i+1); s[i]='L'; s[i+1]='R'; i=i+2; ct+=1; }
                else{ i=i+1; }
            }
            if(ct==0){ break; }
            mm+=1; lm[mm]=ct;

        }
        if(k>nm||k<mm){ cout<<-1<<endl; }
        else{
            int st=0,rp;
            for(int i=1;i<=k;i++){
                al=k-i;
                ar=ans.size()-(st);
                //cout<<lm[i]<<" "<<al<<" "<<ar<<endl;
                if((ar-lm[i])>al){
                    cout<<lm[i]<<" ";
                    for(int j=1;j<=lm[i];j++){ cout<<ans[st]<<" "; st+=1; }
                    cout<<'\n';
                }
                else{
                    rp=ar-al;
                    cout<<rp<<" ";
                    for(int j=1;j<=rp;j++){ cout<<ans[st]<<" "; st+=1; }
                    cout<<'\n';
                }
            }
        }
    }
}


#include <bits/stdc++.h>
/*#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;*/
using namespace std;
#define pb push_back
#define mp make_pair
#define ll long long
#define ld long double
#define F first
#define fr(i,n) for(ll i=1;i<=n;i++)
#define mm(a,k) memset(a,k,sizeof(a))
#define S second
#define vv(k) vector<k>
#define all(a) a.begin(),a.end()
#define pii pair<int,int>
#define pll pair<long long, long long>
#define mod 998244353
#define inf 10000000000000ll
/*typedef tree<ll, null_type, less<ll>, rb_tree_tag,
             tree_order_statistics_node_update>
    new_data_set;*/

ll power(ll a,ll b){
    ll r=1;
    while(b!=0)
    {
        if(b%2!=0){r=r*a; r%=mod;}
        a=a*a; a=a%mod; b=b/2;
    }
    return r;
}

int main()
{   ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int t=1;
    //memset(prime,true,sizeof(prime));
    //cin>>t;
    while(t--){
        int n,k,al,ar; cin>>n>>k;
        string s; cin>>s;
        int nm=0,ct=0,mm=0;
        for(int i=0;i<n;i++){
            if(s[i]=='L'){ nm+=ct; }
            else{ ct+=1; }
        }

        vv(int) ans;
        int lm[k+1];
        for(int i=1;i<=k;i++){ lm[i]=1; }
        while(1){
            ct=0;
            for(int i=0;i<(n-1);){
                if((s[i]=='R')&&(s[i+1]=='L')){ ans.pb(i+1); s[i]='L'; s[i+1]='R'; i=i+2; ct+=1; }
                else{ i=i+1; }
            }
            if(ct==0){ break; }
            mm+=1; lm[mm]=ct;

        }
        if(k>nm||k<mm){ cout<<-1<<endl; }
        else{
            int st=0,rp;
            for(int i=1;i<=k;i++){
                al=k-i;
                ar=ans.size()-(st);
                //cout<<lm[i]<<" "<<al<<" "<<ar<<endl;
                if((ar-lm[i])>al){
                    cout<<lm[i]<<" ";
                    for(int j=1;j<=lm[i];j++){ cout<<ans[st]<<" "; st+=1; }
                    cout<<endl;
                }
                else{
                    rp=ar-al;
                    cout<<rp<<" ";
                    for(int j=1;j<=rp;j++){ cout<<ans[st]<<" "; st+=1; }
                    cout<<endl;
                }
            }
        }
    }
}


#include <bits/stdc++.h>
using namespace std;
#define pf push_front
#define pb push_back
#define FOR(i,begin,end) for (int i=begin;i<=end;i++)
#define rep(i,t) for (int i=0;i<t;i++)
#define pii pair<int,int>
#define pi pair<pii,LL>
#define X first
#define Y second
typedef long long LL;
typedef unsigned long long int ulli;
const LL maxN=1e5+7,MOD=1e9+7,INF=1e9+7,N=5000+7;
string str;
int n,q,l,r,data[4*maxN][30],helper[4*maxN][30],cnt[30],help;
int left(int x)
{return 2*x+1;}
int right(int x)
{return 2*x+2;}
void shift(int node , int st, int en, int ind)
{
  if(helper[node][ind]==-1 || en-st<2)
    return ;
  int mid=(st+en)/2;
  helper[left(node)][ind]=helper[node][ind];
  helper[right(node)][ind]=helper[node][ind];
  data[left(node)][ind]=(mid-st)*helper[node][ind];
  data[right(node)][ind]=(en-mid)*helper[node][ind];
  helper[node][ind]=-1;
}
int get(int node, int st, int en, int l, int r, int ind)
{
  if(en<=l || r<=st)
    return 0;
  if(st>=l && en<=r)
    return data[node][ind];
  shift(node,st,en,ind);
  int mid=(st+en)/2;
  return get(left(node),st,mid,l,r,ind)+get(right(node),mid,en,l,r,ind);
}
void update(int node, int st, int en, int l, int r, int ind, int val)
{
  if(en<=l || r<=st)
    return ;
  if(st>=l && en<=r)
  {
    data[node][ind]=val*(en-st);
    helper[node][ind]=val;
    return ;
  }
  shift(node,st,en,ind);
  int mid=(st+en)/2;
  update(left(node),st,mid,l,r,ind,val);
  update(right(node),mid,en,l,r,ind,val);
  data[node][ind]=data[left(node)][ind]+data[right(node)][ind];
}
main()
{
  ifstream fin("input.txt");
  ofstream fout("output.txt");
  #define cin fin
  #define cout fout
  cin>>n>>q>>str;
  rep(i,100000)
  {
    FOR(j,1,26)
      helper[i][j]=-1;
  }
  rep(i,n)
    update(0,0,n,i,i+1,str[i]-'a'+1,1);
  while(q--)
  {
    cin>>l>>r;
    l--;
    bool odd=false,bad=false;
    FOR(i,1,26)
    {
      cnt[i]=get(0,0,n,l,r,i);
      if(cnt[i]&1)
      {
        if(odd)
          bad=true;
        else
          odd=true,help=i;
      }
    }
    if(!bad)
    {
      FOR(i,1,26)
        update(0,0,n,l,r,i,0);
      FOR(i,1,26)
      {
        int wh=cnt[i]/2;
        update(0,0,n,l,l+wh,i,1);
        update(0,0,n,r-wh,r,i,1);
        r-=wh;
        l+=wh;
      }
      if(odd)
        update(0,0,n,l,l+1,help,1);
    }
  }
  rep(i,n)
  {
    FOR(j,1,26)
    {
      char help='a';
      if(get(0,0,n,i,i+1,j))
      {
        help+=j;
        help--;
        cout<<help;
        break;
      }
    }
  }
  return cout<<"\n",0;
}


#include <bits/stdc++.h>
using namespace std;
#define pf push_front
#define pb push_back
#define FOR(i,begin,end) for (int i=begin;i<=end;i++)
#define rep(i,t) for (int i=0;i<t;i++)
#define pii pair<int,int>
#define pi pair<pii,LL>
#define X first
#define Y second
typedef long long LL;
typedef unsigned long long int ulli;
const LL maxN=1e5+7,MOD=1e9+7,INF=1e9+7,N=5000+7;
int n,q,l,r,data[4*maxN][30],helper[4*maxN],cnt[30],help;
string str;
int left(int x)
{return 2*x+1;}
int right(int x)
{return 2*x+2;}
void build(int node, int st, int en)
{
  if(en-st<2)
  {
    data[node][str[st]-'a'+1]=1;
    return ;
  }
  int mid=(st+en)/2;
  build(left(node),st,mid);
  build(right(node),mid,en);
  FOR(i,1,26)
    data[node][i]=data[left(node)][i]+data[right(node)][i];
}
void shift(int node , int st, int en)
{
  if(!helper[node] || en-st<2)
    return ;
  int mid=(st+en)/2;
  helper[left(node)]=helper[node];
  helper[right(node)]=helper[node];
  FOR(i,1,26)
    data[left(node)][i]=0,data[right(node)][i]=0;
  data[left(node)][helper[node]]=mid-st;
  data[right(node)][helper[node]]=en-mid;
  helper[node]=0;
}
int get(int node, int st, int en, int l, int r, int ind)
{
  if(en<=l || r<=st)
    return 0;
  shift(node,st,en);
  if(st>=l && en<=r)
    return data[node][ind];
  int mid=(st+en)/2;
  return get(left(node),st,mid,l,r,ind)+get(right(node),mid,en,l,r,ind);
}
void update(int node, int st, int en, int l, int r, int ind)
{
  if(en<=l || r<=st)
    return ;
  shift(node,st,en);
  if(st>=l && en<=r)
  {
    FOR(i,1,26)
      data[node][i]=0;
    data[node][ind]=en-st;
    helper[node]=ind;
    return ;
  }
  int mid=(st+en)/2;
  update(left(node),st,mid,l,r,ind);
  update(right(node),mid,en,l,r,ind);
  FOR(i,1,26)
    data[node][i]=data[left(node)][i]+data[right(node)][i];
}
main()
{
  freopen("input.txt","r",stdin);
  freopen("output.txt","w",stdout);
  scanf("%d%d",&n,&q);
  cin>>str;
  build(0,0,n);
  while(q--)
  {
    scanf("%d%d",&l,&r);
    l--;
    bool odd=false,bad=false;
    FOR(i,1,26)
    {
      cnt[i]=get(0,0,n,l,r,i);
      if(cnt[i]&1)
      {
        if(odd)
          bad=true;
        else
          odd=true,help=i;
      }
    }
    if(!bad)
    {
      FOR(i,1,26)
        cnt[i]/=2;
      FOR(i,1,26)
        update(0,0,n,l,l+cnt[i],i),l+=cnt[i];
      if(odd)
        update(0,0,n,l,l+1,help),l++;
      for(int i=26;i>=1;i--)
        update(0,0,n,l,l+cnt[i],i),l+=cnt[i];
    }
  }
  rep(i,n)
  {
    FOR(j,1,26)
    {
      char help='a';
      if(get(0,0,n,i,i+1,j))
      {
        help+=j;
        help--;
        cout<<help;
        break;
      }
    }
  }
  return cout<<"\n",0;
}


#include <bits/stdc++.h>
using namespace std;
const int maxN=1e5+7,MOD=1e9+7,INF=1e9+7,N=5000+7;
string str;
int n,q,l,r,data[4*maxN][30],helper[4*maxN][30],cnt[30],help;
void shift(int node , int st, int en, int ind)
{
  if(helper[node][ind]==-1 || en-st<2)
    return ;
  int mid=(st+en)/2;
  helper[2*node+1][ind]=helper[node][ind];
  helper[2*node+2][ind]=helper[node][ind];
  data[2*node+1][ind]=(mid-st)*helper[node][ind];
  data[2*node+2][ind]=(en-mid)*helper[node][ind];
  helper[node][ind]=-1;
}
int get(int node, int st, int en, int l, int r, int ind)
{
  if(en<=l || r<=st)
    return 0;
  if(st>=l && en<=r)
    return data[node][ind];
  shift(node,st,en,ind);
  int mid=(st+en)/2;
  return get(2*node+1,st,mid,l,r,ind)+get(2*node+2,mid,en,l,r,ind);
}
void update(int node, int st, int en, int l, int r, int ind, int val)
{
  if(en<=l || r<=st)
    return ;
  if(st>=l && en<=r)
  {
    data[node][ind]=val*(en-st);
    helper[node][ind]=val;
    return ;
  }
  shift(node,st,en,ind);
  int mid=(st+en)/2;
  update(2*node+1,st,mid,l,r,ind,val);
  update(2*node+1,mid,en,l,r,ind,val);
  data[node][ind]=data[2*node+1][ind]+data[2*node+2][ind];
}
main()
{
  ifstream fin("input.txt");
  ofstream fout("output.txt");
  #define cin fin
  #define cout fout
  cin>>n>>q>>str;
  for(int i=0;i<maxN;i++)
  {
    for(int j=1;j<=26;j++)
      helper[i][j]=-1;
  }
  for(int i=0;i<n;i++)
    update(0,0,n,i,i+1,str[i]-'a'+1,1);
  while(q--)
  {
    cin>>l>>r;
    l--;
    bool odd=false,bad=false;
    for(int i=1;i<=26;i++)
    {
      cnt[i]=get(0,0,n,l,r,i);
      if(cnt[i]&1)
      {
        if(odd)
          bad=true;
        else
          odd=true,help=i;
      }
    }
    if(!bad)
    {
      for(int i=1;i<=26;i++)
        update(0,0,n,l,r,i,0);
      for(int i=1;i<=26;i++)
      {
        int wh=cnt[i]/2;
        update(0,0,n,l,l+wh,i,1);
        update(0,0,n,r-wh,r,i,1);
        r-=wh;
        l+=wh;
      }
      if(odd)
        update(0,0,n,l,l+1,help,1);
    }
  }
  for(int i=0;i<n;i++)
  {
    for(int j=1;j<=26;j++)
    {
      char help='a';
      if(get(0,0,n,i,i+1,j))
      {
        help+=j;
        help--;
        cout<<help;
        break;
      }
    }
  }
  return cout<<"\n",0;
}


#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair

const int maxN = 1e5 + 10;
int data[4 * maxN][26],lazy[4 * maxN][26],n;
//data[node][c]: jaame tedade character haye c too bazehye node
int cnt[26];

void shift(int ch, int s, int e, int id)
{
    int x = lazy[id][ch];
    if (x == -1) //chizi baraye shift dadan nadare
        return;

    int mid = s + e >> 1;

    lazy[2 * id][ch] = x;
    data[2 * id][ch] = (mid - s) * x;

    lazy[2 * id + 1][ch] = x;
    data[2 * id + 1][ch] = (e - mid) * x;

    lazy[id][ch] = -1;
}

void update(int l, int r, int ch, int val, int s = 0, int e = n, int id = 1)
{
    if (e <= l || r <= s)
        return;
    if (l <= s && e <= r)
    {
        data[id][ch] = (e - s) * val;
        lazy[id][ch] = val;
        //cout << l << " " << r << " " << data[id][ch] << " " << lazy[id][ch] << " " << char(ch + 'a') << endl;
        return;
    }

    shift(ch, s, e, id);

    int mid = s + e >> 1;
    update(l, r, ch, val, s, mid, 2 * id);
    update(l, r, ch, val, mid, e, 2 * id + 1);
    data[id][ch] = data[2 * id][ch] + data[2 * id + 1][ch];
}

int get(int l, int r, int ch, int s = 0, int e = n, int id = 1)
{
    if (e <= l || r <= s)
        return 0;
    if (l <= s && e <= r)
        return data[id][ch];
    int mid = s + e >> 1;
    shift(ch, s, e, id);
    return get(l, r, ch, s, mid, 2 * id) + get(l, r, ch, mid, e, 2 * id + 1);
}

ifstream fin ("input.txt");
ofstream fout ("output.txt");
#define cin fin
#define cout fout

int32_t main()
{
    for (int i = 0 ; i < maxN ; i++)
        for (int j = 0 ; j < 26 ; j++)
            lazy[i][j] = -1;

    string s;
    int q;
    cin >> n >> q >> s;
    for (int i = 0 ; i < n ; i++)
    {
        //cout << "Adding " << i << " " << i + 1 << " " << s[i] - 'a' << " " << 1 << endl;
        update(i, i + 1, s[i] - 'a', 1);
    }

    while (q--)
    {
        int l,r;
        cin >> l >> r;
        l--;
        int pos1 = l, pos2 = r;
        int odd = 0;
        char mid; //character ee ke fard bar omade bayad miad vasat
        for (int i = 0 ; i < 26 ; i++)
        {
            cnt[i] = get(l, r, i);
            if (cnt[i] & 1)
            {
                mid = i;
                odd++;
            }
        }

        if (odd > 1)
            continue;

        if ( (r - l) % 2 == 0 ) //toolesh zoj
            if (odd == 1) //hame bayad zoj bar omade bashan
                continue;

        for (int i = 0 ; i < 26 ; i++)
            update(l, r, i, 0); //paak kon hame ro az inja

        for (int i = 0 ; i < 26 ; i++)
        {
            if (cnt[i] == 0)
                continue;
            int num = cnt[i] / 2;
            update(pos1, pos1 + num, i, 1); //num ta i bezar avvalesh
            update(pos2 - num, pos2, i, 1); //num ta i bezar akharesh
            pos1 += num;
            pos2 -= num;
        }

        if ((r - l) & 1)
            update(pos1, pos1 + 1, mid, 1);
    }

    for (int i = 0 ; i < n ; i++)
        for (int j = 0 ; j < 26 ; j++)
            if (get(i, i + 1, j) > 0)
                cout << (char)(j + 'a');
    cout << endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define pf push_front
#define pb push_back
#define FOR(i,begin,end) for (int i=begin;i<=end;i++)
#define rep(i,t) for (int i=0;i<t;i++)
#define pii pair<int,int>
#define pi pair<pii,LL>
#define X first
#define Y second
typedef long long LL;
typedef unsigned long long int ulli;
const LL maxN=1e5+7,MOD=1e9+7,INF=1e9+7,N=5000+7;
int n,q,l,r,data[4*maxN][30],helper[4*maxN],cnt[30],help;
string str;
int left(int x)
{return 2*x+1;}
int right(int x)
{return 2*x+2;}
void build(int node, int st, int en)
{
  if(en-st<2)
  {
    data[node][str[st]-'a'+1]=1;
    return ;
  }
  int mid=(st+en)/2;
  build(left(node),st,mid);
  build(right(node),mid,en);
  FOR(i,1,26)
    data[node][i]=data[left(node)][i]+data[right(node)][i];
}
void shift(int node , int st, int en)
{
  if(!helper[node] || en-st<2)
    return ;
  int mid=(st+en)/2;
  helper[left(node)]=helper[node];
  helper[right(node)]=helper[node];
  FOR(i,1,26)
    data[left(node)][i]=0,data[right(node)][i]=0;
  data[left(node)][helper[node]]=mid-st;
  data[right(node)][helper[node]]=en-mid;
  helper[node]=0;
}
int get(int node, int st, int en, int l, int r, int ind)
{
  if(en<=l || r<=st)
    return 0;
  shift(node,st,en);
  if(st>=l && en<=r)
    return data[node][ind];
  int mid=(st+en)/2;
  return get(left(node),st,mid,l,r,ind)+get(right(node),mid,en,l,r,ind);
}
void update(int node, int st, int en, int l, int r, int ind)
{
  if(en<=l || r<=st)
    return ;
  shift(node,st,en);
  if(st>=l && en<=r)
  {
    FOR(i,1,26)
      data[node][i]=0;
    data[node][ind]=en-st;
    helper[node]=ind;
    return ;
  }
  int mid=(st+en)/2;
  update(left(node),st,mid,l,r,ind);
  update(right(node),mid,en,l,r,ind);
  FOR(i,1,26)
    data[node][i]=data[left(node)][i]+data[right(node)][i];
}
main()
{
  freopen("input.txt","r",stdin);
  freopen("output.txt","w",stdout);
  cin>>n>>q>>str;
  build(0,0,n);
  while(q--)
  {
    cin>>l>>r;
    l--;
    bool odd=false,bad=false;
    FOR(i,1,26)
    {
      cnt[i]=get(0,0,n,l,r,i);
      if(cnt[i]&1)
      {
        if(odd)
          bad=true;
        else
          odd=true,help=i;
      }
    }
    if(!bad)
    {
      FOR(i,1,26)
        cnt[i]/=2;
      FOR(i,1,26)
        update(0,0,n,l,l+cnt[i],i),l+=cnt[i];
      if(odd)
        update(0,0,n,l,l+1,help),l++;
      for(int i=26;i>=1;i--)
        update(0,0,n,l,l+cnt[i],i),l+=cnt[i];
    }
  }
  rep(i,n)
  {
    FOR(j,1,26)
    {
      char help='a';
      if(get(0,0,n,i,i+1,j))
      {
        help+=j;
        help--;
        cout<<help;
        break;
      }
    }
  }
  return cout<<"\n",0;
}


#include <bits/stdc++.h>
using namespace std;
const int maxN=1e5+7,MOD=1e9+7,INF=1e9+7,N=5000+7;
string str;
int n,q,l,r,data[4*maxN][30],helper[4*maxN][30],cnt[30],help;
void shift(int node , int st, int en, int ind)
{
  if(helper[node][ind]==-1 || en-st<2)
    return ;
  int mid=(st+en)/2;
  helper[2*node+1][ind]=helper[node][ind];
  helper[2*node+2][ind]=helper[node][ind];
  data[2*node+1][ind]=(mid-st)*helper[node][ind];
  data[2*node+2][ind]=(en-mid)*helper[node][ind];
  helper[node][ind]=-1;
}
int get(int node, int st, int en, int l, int r, int ind)
{
  if(en<=l || r<=st)
    return 0;
  if(st>=l && en<=r)
    return data[node][ind];
  shift(node,st,en,ind);
  int mid=(st+en)/2;
  return get(2*node+1,st,mid,l,r,ind)+get(2*node+2,mid,en,l,r,ind);
}
void update(int node, int st, int en, int l, int r, int ind, int val)
{
  if(en<=l || r<=st)
    return ;
  if(st>=l && en<=r)
  {
    data[node][ind]=val*(en-st);
    helper[node][ind]=val;
    return ;
  }
  shift(node,st,en,ind);
  int mid=(st+en)/2;
  update(2*node+1,st,mid,l,r,ind,val);
  update(2*node+2,mid,en,l,r,ind,val);
  data[node][ind]=data[2*node+1][ind]+data[2*node+2][ind];
}
main()
{
  ifstream fin("input.txt");
  ofstream fout("output.txt");
  #define cin fin
  #define cout fout
  cin>>n>>q>>str;
  for(int i=0;i<maxN;i++)
  {
    for(int j=1;j<=26;j++)
      helper[i][j]=-1;
  }
  for(int i=0;i<n;i++)
    update(0,0,n,i,i+1,str[i]-'a'+1,1);
  while(q--)
  {
    cin>>l>>r;
    l--;
    bool odd=false,bad=false;
    for(int i=1;i<=26;i++)
    {
      cnt[i]=get(0,0,n,l,r,i);
      if(cnt[i]&1)
      {
        if(odd)
          bad=true;
        else
          odd=true,help=i;
      }
    }
    if(!bad)
    {
      for(int i=1;i<=26;i++)
        update(0,0,n,l,r,i,0);
      for(int i=1;i<=26;i++)
      {
        int wh=cnt[i]/2;
        update(0,0,n,l,l+wh,i,1);
        update(0,0,n,r-wh,r,i,1);
        r-=wh;
        l+=wh;
      }
      if(odd)
        update(0,0,n,l,l+1,help,1);
    }
  }
  for(int i=0;i<n;i++)
  {
    for(int j=1;j<=26;j++)
    {
      char help='a';
      if(get(0,0,n,i,i+1,j))
      {
        help+=j;
        help--;
        cout<<help;
        break;
      }
    }
  }
  return cout<<"\n",0;
}