Problem: 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

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
int ni() {
  int a;
  scanf("%d", &a);
  return a;
}
double nf() {
  double a;
  scanf("%lf", &a);
  return a;
}
char sbuf[100005];
string ns() {
  scanf("%s", sbuf);
  return sbuf;
}
long long nll() {
  long long a;
  scanf("%lld", &a);
  return a;
}
template <class T>
void out(T a, T b) {
  bool first = true;
  for (T i = a; i != b; ++i) {
    if (!first) printf(" ");
    first = false;
    cout << *i;
  }
  printf("\n");
}
template <class T>
void outl(T a, T b) {
  for (T i = a; i != b; ++i) {
    cout << *i << "\n";
  }
}
int n, m;
int moo(char c) {
  if (c <= '9' && c >= '0') return c - '0';
  return c - 'A' + 10;
}
int a[6][6];
bool inside(int a) { return a >= 0 && a < 6; }
char ss[1005];
vector<string> ans;
void add(char c, int z, int num) {
  int j;
  sprintf(ss, "%c%d\n", c, z + 1);
  while (num) {
    if (c == 'L') {
      int t = a[z][0];
      for (j = (0); j < (((5))); ++j) a[z][j] = a[z][j + 1];
      a[z][5] = t;
    }
    if (c == 'R') {
      int t = a[z][5];
      for (j = (0); j < (((5))); ++j) a[z][5 - j] = a[z][4 - j];
      a[z][0] = t;
    }
    if (c == 'U') {
      int t = a[0][z];
      for (j = (0); j < (((5))); ++j) a[j][z] = a[j + 1][z];
      a[5][z] = t;
    }
    if (c == 'D') {
      int t = a[5][z];
      for (j = (0); j < (((5))); ++j) a[5 - j][z] = a[4 - j][z];
      a[0][z] = t;
    }
    ans.push_back(ss);
    --num;
  }
}
int main() {
  int i, j, k;
  for (i = (0); i < (((6))); ++i) {
    string s = ns();
    for (j = (0); j < (((6))); ++j) a[i][j] = moo(s[j]);
  }
startOver:
  int done = 0;
  for (i = (0); i < (((15))); ++i) {
    for (j = (0); j < (((15))); ++j) {
      int y = j;
      int x = i - j;
      if (inside(x) && inside(y)) {
        int xx = -1, yy = -1;
        int ii, jj;
        for (ii = (0); ii < ((6)); ++ii)
          for (jj = (0); jj < ((6)); ++jj)
            if (a[ii][jj] == y * 6 + x) xx = jj, yy = ii;
        ;
        if (x == 5 && y == 0) x = 5;
        if (xx == x && yy == y) {
        } else {
          bool needUp = 0;
          if (yy == 5 && xx == 5) {
            if (y == 5) {
              y = 4;
              add('U', x, 1);
              needUp = 1;
            }
            if (x < 4)
              add('L', 5, 4 - x);
            else if (x > 4)
              add('R', 5, 1);
            add('D', x, 5 - y);
            add('L', 5, 1);
            add('U', x, 5 - y);
            if (x != 5) add('R', 5, 5 - x);
            if (needUp) {
              add('D', x, 1);
              y = 5;
            }
          } else {
            if (yy == 5 && xx != 4) {
              yy = 4;
              add('U', xx, 1);
              needUp = 1;
            }
            if (xx < 4)
              add('L', 5, 4 - xx);
            else if (xx > 4)
              add('R', 5, 1);
            add('D', xx, 5 - yy);
            add('L', 5, 1);
            add('U', xx, 5 - yy);
            if (xx != 5) add('R', 5, 5 - xx);
            if (needUp) {
              add('D', xx, 1);
              yy = 5;
            }
            needUp = 0;
            if (y == 5) {
              y = 4;
              add('U', x, 1);
              needUp = 1;
            }
            if (x != 5) add('L', 5, 5 - x);
            add('D', x, 5 - y);
            add('R', 5, 1);
            add('U', x, 5 - y);
            if (x < 4)
              add('R', 5, 4 - x);
            else if (x > 4)
              add('L', 5, 1);
            if (needUp) {
              add('D', x, 1);
              y = 5;
            }
          }
        }
        if (a[y][x] != y * 6 + x) {
          printf("%d %d\n", x, y);
          return 0;
        }
        ++done;
      }
      if (done == 34) {
        if (a[5][5] != 35) {
          add('L', 5, 3);
          goto startOver;
        }
        printf("%d\n", ans.size());
        for (i = (0); i < (((ans.size()))); ++i) printf("%s", ans[i].c_str());
        return 0;
      }
    }
  }
  return 0;
}