There is a square box 6 × 6 in size. It contains 36 chips 1 × 1 in size. Those chips contain 36 different characters — "0"-"9" and "A"-"Z". There is exactly one chip with each character.

You are allowed to make the following operations: you may choose one of 6 rows or one of 6 columns and cyclically shift the chips there to one position to the left or to the right (for the row) or upwards or downwards (for the column). Those operations are allowed to perform several times. 

To solve the puzzle is to shift the chips using the above described operations so that they were written in the increasing order (exactly equal to the right picture). An example of solving the puzzle is shown on a picture below.

<image>

Write a program that finds the sequence of operations that solves the puzzle. That sequence should not necessarily be shortest, but you should not exceed the limit of 10000 operations. It is guaranteed that the solution always exists.

Input

The input data are represented by 6 lines containing 6 characters each. They are the puzzle's initial position. Those lines contain each character from the string "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ" exactly once.

Output

On the first line print number n, which is the number of operations. On the next n lines print the sequence of operations one per line. An operation is described by a word consisting of two characters. The first character shows the direction where the row or the column will be shifted. The possible directions are "L", "R" (to the left, to the right correspondingly, we shift a row), "U", "D" (upwards, downwards correspondingly, we shift a column). The second character is the number of the row (or the column), it is an integer from "1" to "6". The rows are numbered from the top to the bottom, the columns are numbered from the left to the right.

The number of operations should not exceed 104. If there are several solutions, print any of them.

Examples

Input

01W345
729AB6
CD8FGH
IJELMN
OPKRST
UVQXYZ


Output

2
R2
U3
#include <bits/stdc++.h>
using namespace std;
int n, m, a[10][10], px[50], py[50], b[10], cnt;
string ans;
char s[20];
void MR(int x, int k) {
  cnt += fabs(k);
  for (int i = 1; i <= fabs(k); i++)
    sprintf(s, "%c%d\n", (k > 0 ? 'R' : 'L'), x + 1), ans += s;
  if (k > 0) {
    for (int i = 0; i < m - k; i++) b[i + k] = a[x][i];
    for (int i = m - k; i < m; i++) b[i - m + k] = a[x][i];
  } else {
    for (int i = 0; i < -k; i++) b[i + m + k] = a[x][i];
    for (int i = -k; i < m; i++) b[i + k] = a[x][i];
  }
  for (int i = 0; i < m; i++) a[x][i] = b[i], py[a[x][i]] = i;
}
void MC(int y, int k) {
  cnt += fabs(k);
  for (int i = 1; i <= fabs(k); i++)
    sprintf(s, "%c%d\n", (k > 0 ? 'D' : 'U'), y + 1), ans += s;
  if (k > 0) {
    for (int i = 0; i < n - k; i++) b[i + k] = a[i][y];
    for (int i = n - k; i < n; i++) b[i - n + k] = a[i][y];
  } else {
    for (int i = 0; i < -k; i++) b[i + n + k] = a[i][y];
    for (int i = -k; i < n; i++) b[i + k] = a[i][y];
  }
  for (int i = 0; i < n; i++) a[i][y] = b[i], px[a[i][y]] = i;
}
void solve(int x, int k) {
  MC(x, -1);
  for (int i = 1; i < k; i += 2)
    MR(n - 1, -1), MC(x, 1), MR(n - 1, -1), MC(x, -1);
  MR(n - 1, k - 1), MC(x, 1);
}
void solve2(int x) {
  MC(x, -1), MR(n - 1, -2), MC(x, 1), MR(n - 1, 1), MC(x, -1), MR(n - 1, 1),
      MC(x, 1);
}
void work() {
  n = m = 6;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) {
      char ch = getchar();
      while (!((('0' <= ch) && (ch <= '9')) || (('A' <= ch) && (ch <= 'Z'))))
        ch = getchar();
      if (('0' <= ch) && (ch <= '9'))
        a[i][j] = ch - '0';
      else
        a[i][j] = ch - 'A' + 10;
      px[a[i][j]] = i, py[a[i][j]] = j;
    }
  for (int i = 0, x, y; i < m; i++) {
    x = px[i], y = py[i];
    if (x)
      if (y != i)
        MR(x, i - y), MC(i, -x);
      else
        MC(i, -x);
    else if (y != i) {
      if (i)
        MC(y, 1), MR(1, i - y), MC(i, -1);
      else
        MR(0, -y);
    }
  }
  for (int i = 1, x, y; i < n - 1; i++)
    for (int j = 0; j < m; j++) {
      x = px[i * m + j], y = py[i * m + j];
      if (x != i)
        if (y != j)
          MC(j, x - i), MR(x, j - y), MC(j, i - x);
        else
          MR(x, -1), MC(j, x - i), MR(x, 1), MC(j, i - x);
      else if (y != j)
        MR(i, j - y), MC(j, -1), MR(i, y - j), MC(j, 1);
    }
  if (py[(n - 1) * m]) MR(n - 1, -py[(n - 1) * m]);
  for (int i = 1, x = n - 1, y; i < m - 2; i++) {
    y = py[x * m + i];
    if (y == i) continue;
    if ((y - i) & 1)
      solve(i + 1, y - i), solve2(i);
    else
      solve(i, y - i + 1);
  }
  if (a[n - 1][m - 2] > a[n - 1][m - 1]) {
    MR(n - 1, 2), MC(0, -1), MR(n - 1, -1), MC(0, 1), MR(n - 1, 1), MC(0, -1),
        MR(n - 1, -2);
    MR(0, 1), MC(0, -1), MR(0, -1), MC(0, -1), MR(0, 1);
    MC(0, -1), MR(0, -1), MC(0, -1), MR(0, 1), MC(0, -2), MR(0, -1);
  }
  cout << cnt << endl << ans;
}
int main() {
  work();
  return 0;
}
