#include <bits/stdc++.h>
using namespace std;
char S[10][10];
int id(char c) {
  if ('0' <= c && c <= '9') return c - '0';
  return c - 'A' + 10;
}
int N;
char opt[10010][5];
void work(char c, int x) {
  N++;
  opt[N][0] = c;
  opt[N][1] = x + '0';
}
void swp_r(int x, int y) {
  swap(S[x][y], S[x][y + 1]);
  work('D', y + 1);
  work('R', x);
  work('D', y + 1);
  work('L', x);
  work('D', y + 1);
  work('R', x);
  work('D', y + 1);
  work('L', x);
  work('D', y + 1);
  work('R', x);
  work('D', y + 1);
  work('L', x);
  work('D', y + 1);
  return;
}
void swp_d(int x, int y) {
  swap(S[x][y], S[x + 1][y]);
  work('R', x + 1);
  work('D', y);
  work('R', x + 1);
  work('U', y);
  work('R', x + 1);
  work('D', y);
  work('R', x + 1);
  work('U', y);
  work('R', x + 1);
  work('D', y);
  work('R', x + 1);
  work('U', y);
  work('R', x + 1);
  return;
}
int main() {
  for (int i = 1; i <= 6; i++) scanf("%s", S[i] + 1);
  for (int i = 1; i <= 6; i++)
    for (int j = 1; j <= 6; j++) {
      int need = (i - 1) * 6 + j - 1;
      int x = 0, y = 0;
      for (int p = 1; p <= 6; p++)
        for (int q = 1; q <= 6; q++)
          if (id(S[p][q]) == need) x = p, y = q;
      while (x < i) {
        swp_d(x, y);
        x++;
      }
      while (y < j) {
        swp_r(x, y);
        y++;
      }
      while (x > i) {
        x--;
        swp_d(x, y);
      }
      while (y > j) {
        y--;
        swp_r(x, y);
      }
    }
  printf("%d\n", N);
  for (int i = 1; i <= N; i++) printf("%s\n", opt[i]);
  return 0;
}
