#include <bits/stdc++.h>
using namespace std;
static string chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
static string lines[6];
static vector<string> moves;
void emit(const char *p, int r, int c) {
  for (; *p; ++p) {
    ostringstream oss;
    oss << *p << ((*p == 'L' || *p == 'R') ? r : c) + 1;
    moves.push_back(oss.str());
  }
}
void swap_hori(int r, int c) {
  emit("RDRURDRURDRRU", r, c);
  std::swap(lines[r][c], lines[r][(c + 1) % 6]);
}
void swap_vert(int r, int c) {
  emit("RURDRURDRURDR", r, c);
  std::swap(lines[r][c], lines[(r + 1) % 6][c]);
}
int main() {
  for (int r = 0; r < int(6); ++r) cin >> lines[r];
  for (int r1 = 0; r1 < int(6); ++r1)
    for (int c1 = 0; c1 < int(6); ++c1) {
      const char ch = chars[6 * r1 + c1];
      int r2, c2;
      for (r2 = 0; r2 < 6; ++r2) {
        for (c2 = 0; c2 < 6; ++c2) {
          if (lines[r2][c2] == ch) goto found;
        }
      }
      assert(0);
    found:
      assert(r2 > r1 || (r2 == r1 && c2 >= c1));
      while (c2 < c1) swap_hori(r2, c2++);
      while (c2 > c1) swap_hori(r2, --c2);
      while (r2 > r1) swap_vert(--r2, c2);
    }
  std::cout << moves.size() << '\n';
  for (__typeof((moves).begin()) it = (moves).begin(); it != (moves).end();
       ++it)
    std::cout << *it << '\n';
}
