#include <bits/stdc++.h>
using namespace std;
char mat[7][7], sol[7][7] = {{0, 0, 0, 0, 0, 0, 0},
                             {0, '0', '1', '2', '3', '4', '5'},
                             {0, '6', '7', '8', '9', 'A', 'B'},
                             {0, 'C', 'D', 'E', 'F', 'G', 'H'},
                             {0, 'I', 'J', 'K', 'L', 'M', 'N'},
                             {0, 'O', 'P', 'Q', 'R', 'S', 'T'},
                             {0, 'U', 'V', 'W', 'X', 'Y', 'Z'}};
vector<pair<char, int>> ans;
void mvl(int x, int y) {
  ans.push_back(make_pair('D', y));
  ans.push_back(make_pair('R', x));
  ans.push_back(make_pair('D', y));
  ans.push_back(make_pair('L', x));
  ans.push_back(make_pair('D', y));
  ans.push_back(make_pair('R', x));
  ans.push_back(make_pair('D', y));
  ans.push_back(make_pair('L', x));
  ans.push_back(make_pair('D', y));
  ans.push_back(make_pair('R', x));
  ans.push_back(make_pair('D', y));
  ans.push_back(make_pair('L', x));
  ans.push_back(make_pair('D', y));
  swap(mat[x][y], mat[x][y - 1]);
}
void mvu(int x, int y) {
  ans.push_back(make_pair('L', x));
  ans.push_back(make_pair('D', y));
  ans.push_back(make_pair('L', x));
  ans.push_back(make_pair('U', y));
  ans.push_back(make_pair('L', x));
  ans.push_back(make_pair('D', y));
  ans.push_back(make_pair('L', x));
  ans.push_back(make_pair('U', y));
  ans.push_back(make_pair('L', x));
  ans.push_back(make_pair('D', y));
  ans.push_back(make_pair('L', x));
  ans.push_back(make_pair('U', y));
  ans.push_back(make_pair('L', x));
  swap(mat[x][y], mat[x - 1][y]);
}
int main(void) {
  for (int i = 1; i <= 6; ++i)
    for (int j = 1; j <= 6; ++j) cin >> mat[i][j];
  for (int i = 1; i <= 6; ++i) {
    for (int j = 1; j <= 6; ++j) {
      int px = -1, py = -1;
      for (int ii = 1; ii <= 6; ++ii)
        for (int jj = 1; jj <= 6; ++jj)
          if (sol[i][j] == mat[ii][jj]) px = ii, py = jj;
      while (py > j) mvl(px, py--);
      while (py < j) mvl(px, py++ + 1);
      while (px > i) mvu(px--, py);
    }
  }
  cout << ans.size() << "\n";
  for (pair<char, int> pr : ans) cout << pr.first << pr.second << "\n";
  return 0;
}
