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;
char FF[10][10];
int F[6][6];
void LL(int x) {
  char tmp = FF[x][0];
  for (int i = (0); i <= (4); i++) FF[x][i] = FF[x][i + 1];
  FF[x][5] = tmp;
}
void UU(int x) {
  char tmp = FF[0][x];
  for (int i = (0); i <= (4); i++) FF[i][x] = FF[i + 1][x];
  FF[5][x] = tmp;
}
void print2() {
  for (int i = (0); i <= (5); i++) {
    for (int j = (0); j <= (5); j++) printf("%c", FF[i][j]);
    printf("\n");
  }
}
vector<pair<int, int> > ans;
void Up(int x, int l) {
  int tmp[6];
  for (int i = (l); i <= (l + 5); i++) tmp[i - l] = F[i % 6][x];
  for (int i = (0); i <= (5); i++) F[i][x] = tmp[i];
  for (int i = (1); i <= (l); i++) {
    ans.push_back(pair<int, int>(0, x));
    UU(x);
  }
}
void Down(int x, int l) { Up(x, 6 - l); }
void Left(int x, int l) {
  int tmp[6];
  for (int i = (l); i <= (l + 5); i++) tmp[i - l] = F[x][i % 6];
  for (int i = (0); i <= (5); i++) F[x][i] = tmp[i];
  for (int i = (1); i <= (l); i++) {
    ans.push_back(pair<int, int>(1, x));
    LL(x);
  }
}
void Right(int x, int l) { Left(x, 6 - l); }
void go1(int i, int j) {
  swap(i, j);
  if (i != 0) Left(5, i);
  j -= i;
  if (j < 0) j += 6;
  Up(0, 1);
  Left(5, j);
  Down(0, 1);
  Right(5, j);
  if (i != 0) Right(5, i);
}
void go2(int i, int j, int k) {
  go1(i, j);
  go1(j, k);
}
vector<pair<int, int> > need;
void Getneed() {
  need.clear();
  int tmp[10];
  bool vis[10] = {};
  for (int i = (0); i <= (5); i++) tmp[i] = F[5][i] % 6;
  for (int i = (0); i <= (5); i++) {
    if (!vis[i] && tmp[i] != i) {
      int p = tmp[i];
      vis[i] = 1;
      need.push_back(pair<int, int>(i, p));
      while (!vis[p]) {
        if (!vis[tmp[p]]) need.push_back(pair<int, int>(p, tmp[p]));
        vis[p] = 1;
        p = tmp[p];
      }
    }
  }
}
void solve() {
  Getneed();
  if (need.size() % 2) {
    Left(5, 1);
    Getneed();
  }
  int m = need.size();
  vector<pair<int, int> > need2 = need;
  need.clear();
  for (int i = (m - 1); i >= (0); i--)
    need.push_back(pair<int, int>(need2[i].second, need2[i].first));
  for (int i = 0; i < m; i += 2) {
    if (need[i].second == need[i + 1].first) {
      go2(need[i].first, need[i].second, need[i + 1].second);
    } else {
      go2(need[i].first, need[i].second, need[i + 1].first);
      go2(need[i].second, need[i + 1].first, need[i + 1].second);
    }
  }
}
void go(int i, int j) {
  int x, y;
  for (x = 0; x <= 5; x++) {
    for (y = 0; y <= 5; y++)
      if (F[x][y] == i * 6 + j) break;
    if (y < 6) break;
  }
  if (y == j) {
    if (x == i) return;
    Left(x, 1);
    Down(j, x - i);
    Right(x, 1);
    Up(j, x - i);
  } else {
    if (x == i) {
      Down(j, 1);
      Down(y, 1);
      Left(x + 1, y - j);
      Up(j, 1);
      Up(y, 1);
    } else {
      Down(j, x - i);
      Left(x, (y - j + 6) % 6);
      Up(j, x - i);
    }
  }
}
void print() {
  for (int i = (0); i <= (5); i++) {
    for (int j = (0); j <= (5); j++) printf("%d ", F[i][j]);
    printf("\n");
  }
}
int main() {
  for (int i = (0); i <= (5); i++) {
    scanf("%s", FF[i]);
    for (int j = (0); j <= (5); j++) {
      if (FF[i][j] >= '0' && FF[i][j] <= '9')
        F[i][j] = FF[i][j] - '0';
      else
        F[i][j] = FF[i][j] - 'A' + 10;
    }
  }
  for (int i = (0); i <= (4); i++)
    for (int j = (0); j <= (5); j++) go(i, j);
  solve();
  printf("%d\n", ans.size());
  for (pair<int, int> tmp : ans) {
    if (tmp.first == 1) {
      printf("L%d\n", tmp.second + 1);
    } else {
      printf("U%d\n", tmp.second + 1);
    }
  }
  return 0;
}