#include <bits/stdc++.h>
const int N = 1e5 + 5;
int n;
char c[N];
int main() {
  int T = 1;
  scanf("%d", &T);
  while (T--) {
    scanf("%s", c + 1);
    n = strlen(c + 1);
    printf("%d\n", 4);
    printf("L 2\n");
    printf("L 2\n");
    printf("R 2\n");
    n += 2;
    n += n - 2;
    printf("R %d\n", n - 1);
  }
  return 0;
}
