#include <bits/stdc++.h>
using namespace std;
char str[10][10];
char ts[10];
char ans[10][10] = {"012345", "6789AB", "CDEFGH", "IJKLMN", "OPQRST", "UVWXYZ"};
vector<string> arr;
void s(int ax, int ay, int d) {
  if (!d) {
    swap(str[ax][ay], str[(ax + 5) % 6][ay]);
    ax++, ay++;
    sprintf(ts, "U%d\n", ay), arr.push_back(ts);
    sprintf(ts, "R%d\n", ax), arr.push_back(ts);
    sprintf(ts, "U%d\n", ay), arr.push_back(ts);
    sprintf(ts, "L%d\n", ax), arr.push_back(ts);
    sprintf(ts, "U%d\n", ay), arr.push_back(ts);
    sprintf(ts, "R%d\n", ax), arr.push_back(ts);
    sprintf(ts, "U%d\n", ay), arr.push_back(ts);
    sprintf(ts, "L%d\n", ax), arr.push_back(ts);
    sprintf(ts, "U%d\n", ay), arr.push_back(ts);
    sprintf(ts, "R%d\n", ax), arr.push_back(ts);
    sprintf(ts, "U%d\n", ay), arr.push_back(ts);
    sprintf(ts, "U%d\n", ay), arr.push_back(ts);
    sprintf(ts, "L%d\n", ax), arr.push_back(ts);
  } else {
    swap(str[ax][ay], str[ax][(ay + 5) % 6]);
    ax++, ay++;
    sprintf(ts, "L%d\n", ax), arr.push_back(ts);
    sprintf(ts, "D%d\n", ay), arr.push_back(ts);
    sprintf(ts, "L%d\n", ax), arr.push_back(ts);
    sprintf(ts, "U%d\n", ay), arr.push_back(ts);
    sprintf(ts, "L%d\n", ax), arr.push_back(ts);
    sprintf(ts, "D%d\n", ay), arr.push_back(ts);
    sprintf(ts, "L%d\n", ax), arr.push_back(ts);
    sprintf(ts, "U%d\n", ay), arr.push_back(ts);
    sprintf(ts, "L%d\n", ax), arr.push_back(ts);
    sprintf(ts, "D%d\n", ay), arr.push_back(ts);
    sprintf(ts, "L%d\n", ax), arr.push_back(ts);
    sprintf(ts, "L%d\n", ax), arr.push_back(ts);
    sprintf(ts, "U%d\n", ay), arr.push_back(ts);
  }
}
int main() {
  int i, j, ti, tj;
  for (i = 0; i < 6; i++) scanf("%s", str[i]);
  for (i = 0; i < 6; i++)
    for (j = 0; j < 6; j++) {
      if (str[i][j] == ans[i][j]) continue;
      for (ti = 0; ti < 6; ti++) {
        for (tj = 0; tj < 6; tj++) {
          if (str[ti][tj] == ans[i][j]) break;
        }
        if (str[ti][tj] == ans[i][j]) break;
      }
      while (j != tj) {
        s(ti, tj, 1);
        tj = (tj + 5) % 6;
      }
      while (i != ti) {
        s(ti, tj, 0);
        ti = (ti + 5) % 6;
      }
    }
  printf("%d\n", arr.size());
  for (i = 0; i < arr.size(); i++) printf("%s", arr[i].c_str());
}
