#include <bits/stdc++.h>
using namespace std;
const int MAXN = 3000;
int N, K;
char S[MAXN + 10], T[MAXN + 10];
int main() {
  int i, j;
  scanf("%d%d", &N, &K);
  scanf("%s", S + 1);
  for (i = 1; i <= N; i++) {
    if (S[i] == 'L')
      S[i] = 'B';
    else
      S[i] = 'A';
  }
  int inv = 0, cnt = 0;
  for (i = 1; i <= N; i++) {
    if (S[i] == 'A')
      cnt++;
    else
      inv += cnt;
  }
  if (inv < K) return !printf("-1\n");
  vector<int> Q;
  for (i = 1; i <= N; i++) T[i] = S[i];
  for (i = 1; i < N; i++)
    if (T[i] == 'A' && T[i + 1] == 'B') Q.push_back(i);
  int p = 0;
  while (!Q.empty()) {
    p++;
    for (auto it : Q) swap(T[it], T[it + 1]);
    if (p > K) return !printf("-1\n");
    vector<int> QQ;
    for (auto it : Q) {
      if (1 <= it - 1 && it <= N && T[it - 1] == 'A') QQ.push_back(it - 1);
      if (1 <= it + 1 && it + 2 <= N && T[it + 2] == 'B') QQ.push_back(it + 1);
    }
    Q = QQ;
    Q.erase(unique(Q.begin(), Q.end()), Q.end());
  }
  Q.clear();
  for (i = 1; i <= N; i++) T[i] = S[i];
  for (i = 1; i < N; i++)
    if (T[i] == 'A' && T[i + 1] == 'B') Q.push_back(i);
  p = inv - K;
  while (!Q.empty() && p > 0) {
    int sz = min(p + 1, (int)Q.size());
    while (Q.size() > sz) Q.pop_back();
    printf("%d ", Q.size());
    for (auto it : Q) printf("%d ", it);
    printf("\n");
    for (auto it : Q) swap(T[it], T[it + 1]);
    p -= sz - 1;
    if (p == 0) break;
    vector<int> QQ;
    for (auto it : Q) {
      if (1 <= it - 1 && it <= N && T[it - 1] == 'A') QQ.push_back(it - 1);
      if (1 <= it + 1 && it + 2 <= N && T[it + 2] == 'B') QQ.push_back(it + 1);
    }
    Q = QQ;
    Q.erase(unique(Q.begin(), Q.end()), Q.end());
  }
  for (i = 1; i <= N; i++) {
    if (T[i] == 'A') continue;
    for (j = i - 1; j >= 1 && T[j] == 'A'; j--)
      printf("1 %d\n", j), swap(T[j], T[j + 1]);
  }
}
