#include using namespace std; int main(){ int N, X, Y; cin >> N >> X >> Y; string S; cin >> S; int Scnt = 0; for (int i = 0; i < N; i++){ if (S[i] == 'S'){ Scnt++; if (Scnt > Y){ S[i] == '.'; } } } if (Y > Scnt){ cout << -1 << endl; } else { vector T; T.push_back(""); for (int i = 0; i < N; i++){ if (S[i] == 'L' || S[i] == 'R'){ T.back() += S[i]; } else if (S[i] == 'S' && T.size() <= Scnt){ T.push_back(""); } } int cnt = T.size(); vector left(cnt), right(cnt), sum(cnt); for (int i = 0; i < cnt; i++){ int sz = T[i].size(); left[i] = 0, right[i] = 0, sum[i] = 0; for (int j = 0; j < sz; j++){ if (T[i][j] == 'L'){ left[i]--; right[i]--; sum[i]--; } if (T[i][j] == 'R'){ left[i]++; right[i]++; sum[i]++; } left[i] = min(left[i], 0); right[i] = max(right[i], 0); } } int Rsum = 0; for (int i = 0; i < cnt; i++){ Rsum += right[i]; } if (X > Rsum){ cout << -1 << endl; } else { vector> ob; int currX = 0; for (int i = 0; i < cnt; i++){ if (currX + right[i] <= X){ ob.push_back(make_pair(currX - 1, i)); currX += right[i]; } else if (currX == X){ ob.push_back(make_pair(currX - 1, i)); ob.push_back(make_pair(currX + 1, i)); } else { ob.push_back(make_pair(currX - 1 - (X - currX - right[i]), i)); } } if (Y < Scnt){ ob.push_back(make_pair(X, Y + 1)); } int M = ob.size(); cout << M << endl; for (int i = 0; i < M; i++){ cout << ob[i].first << ' ' << ob[i].second << endl; } } } }