#include <bits/stdc++.h>
using namespace std;
const string esper_y = "LULDLULDLULDL";
const string esper_x = "RURDRURDRURRD";
string itos(int x) {
  stringstream ss;
  ss << x;
  return ss.str();
}
string conv(char c, int y, int x) {
  string u = "*";
  u[0] = c;
  if (c == 'U' || c == 'D')
    return u + itos(x + 1);
  else
    return u + itos(y + 1);
}
string res;
int nums;
void movex(string &s, int y, int x) {
  for (int j = 0; j < (int)((int)((esper_x).size())); ++j)
    res += conv(esper_x[j], y, x) + "\n", nums++;
  swap(s[6 * y + x], s[6 * y + x + 1]);
}
void movey(string &s, int y, int x) {
  for (int j = 0; j < (int)((int)((esper_y).size())); ++j)
    res += conv(esper_y[j], y, x) + "\n", nums++;
  swap(s[6 * y + x], s[6 * (y + 1) + x]);
}
char itoc(int x) {
  if (x < 10) return '0' + x;
  return 'A' + x - 10;
}
int main() {
  string s;
  while (cin >> s) {
    for (int itr = 0; itr < (int)(5); ++itr) {
      string tmp;
      cin >> tmp;
      s += tmp;
    }
    res = "";
    nums = 0;
    for (int target = 0; target < (int)(36); ++target) {
      char c = itoc(target);
      int curpos = 0;
      for (int j = 0; j < (int)(36); ++j)
        if (s[j] == c) {
          curpos = j;
          break;
        }
      for (; curpos % 6 != target % 6;) {
        if (curpos % 6 < target % 6) movex(s, curpos / 6, curpos % 6), curpos++;
        if (target % 6 < curpos % 6)
          movex(s, curpos / 6, curpos % 6 - 1), curpos--;
      }
      for (; curpos / 6 != target / 6;) {
        assert(curpos / 6 > target / 6);
        movey(s, curpos / 6 - 1, curpos % 6), curpos -= 6;
      }
      assert(curpos == target);
    }
    for (int j = 0; j < (int)(36); ++j) assert(s[j] == itoc(j));
    printf("%d\n%s", nums, res.c_str());
  }
}
