#include <bits/stdc++.h>
using namespace std;
int gr[10][10];
vector<pair<int, int> > moves;
void swp(int x, int y, int d) {
  if (d == 1) {
    for (int i = 0; i < (signed)(6); i++) {
      moves.push_back({'D', y});
      if (i % 2 == 0) {
        moves.push_back({'L', x});
      } else {
        moves.push_back({'R', x});
      }
    }
    moves.push_back({'D', y});
  } else {
    for (int i = 0; i < (signed)(6); i++) {
      moves.push_back({'R', x});
      if (i % 2 == 0) {
        moves.push_back({'U', y});
      } else {
        moves.push_back({'D', y});
      }
    }
    moves.push_back({'R', x});
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  for (int i = (1); i <= (signed)(6); i++) {
    for (int j = (1); j <= (signed)(6); j++) {
      char c;
      cin >> c;
      if (c >= '0' && c <= '9') {
        gr[i][j] = c - '0';
      } else {
        gr[i][j] = 10 + c - 'A';
      }
    }
  }
  for (int i = (1); i <= (signed)(6); i++) {
    for (int j = (1); j <= (signed)(6); j++) {
      int v = 6 * i + j - 7;
      int ok = false;
      for (int a = (1); a <= (signed)(6); a++) {
        for (int b = (1); b <= (signed)(6); b++) {
          if (gr[a][b] == v) {
            for (int c = (b - 1); c >= j; c--) {
              swp(a, c, 1);
              swap(gr[a][c], gr[a][c + 1]);
            }
            for (int c = (b); c <= (signed)(j - 1); c++) {
              swp(a, c, 1);
              swap(gr[a][c], gr[a][c + 1]);
            }
            for (int c = (a - 1); c >= i; c--) {
              swp(c, j, 0);
              swap(gr[c][j], gr[c + 1][j]);
            }
            ok = true;
            break;
          }
        }
        if (ok) break;
      }
    }
  }
  cout << moves.size() << "\n";
  for (auto u : moves) {
    cout << (char)u.first << u.second << "\n";
  }
  return 0;
}
