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;
const long double pi = fabsl(atan2l(0.0, -1.0));
const long double eps = 1e-9;
const int inf = 1 << 28;
const int n = 6;
int a[123][123], b[256];
int ia[123][123];
int getid(int ch) {
  if (isdigit(ch))
    return ch - '0';
  else
    return ch - 'A' + 10;
}
void load() {
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      a[i][j] = getid(getchar());
      ia[i][j] = a[i][j];
      b[a[i][j]] = i * n + j;
    }
    {
      int c = 0;
      while ((c = getchar()) != 10 && c != EOF)
        ;
    };
  }
}
vector<pair<int, int> > res;
const char ch[] = {'D', 'U', 'R', 'L'};
void moveDown(int i, int k) {
  for (int l = 0; l < k; l++) {
    res.push_back(make_pair(0, i));
    int lst = a[n - 1][i];
    for (int j = n - 1; j > 0; j--) {
      a[j][i] = a[j - 1][i];
      b[a[j][i]] = j * n + i;
    }
    a[0][i] = lst;
    b[lst] = i;
  }
}
void moveUp(int i, int k) {
  for (int l = 0; l < k; l++) {
    res.push_back(make_pair(1, i));
    int lst = a[0][i];
    for (int j = 0; j < n - 1; j++) {
      a[j][i] = a[j + 1][i];
      b[a[j][i]] = j * n + i;
    }
    a[n - 1][i] = lst;
    b[lst] = (n - 1) * n + i;
  }
}
void moveRight(int i, int k) {
  for (int l = 0; l < k; l++) {
    res.push_back(make_pair(2, i));
    int lst = a[i][n - 1];
    for (int j = n - 1; j > 0; j--) {
      a[i][j] = a[i][j - 1];
      b[a[i][j]] = i * n + j;
    }
    a[i][0] = lst;
    b[lst] = i * n;
  }
}
void moveLeft(int i, int k) {
  for (int l = 0; l < k; l++) {
    res.push_back(make_pair(3, i));
    int lst = a[i][0];
    for (int j = 0; j < n - 1; j++) {
      a[i][j] = a[i][j + 1];
      b[a[i][j]] = i * n + j;
    }
    a[i][n - 1] = lst;
    b[lst] = i * n + n - 1;
  }
}
bool solve() {
  int toturn;
  for (int i = 0; i + 1 < n; i++) {
    for (int j = 0; j < n; j++) {
      if (b[i * n + j] == i * n + j) continue;
      toturn = -1;
      if (b[i * n + j] / n == i) {
        moveDown(b[i * n + j] % n, 1);
        toturn = b[i * n + j] % n;
      }
      if (b[i * n + j] % n == j) {
        if (j == 0)
          moveRight(b[i * n + j] / n, 1);
        else
          moveLeft(b[i * n + j] / n, 1);
      }
      if (b[i * n + j] / n - i > 0) moveDown(j, b[i * n + j] / n - i);
      if (b[i * n + j] % n < j)
        moveRight(b[i * n + j] / n, j - (b[i * n + j] % n));
      if (b[i * n + j] % n > j)
        moveLeft(b[i * n + j] / n, (b[i * n + j] % n) - j);
      if (toturn >= 0) moveUp(toturn, 1);
      moveUp(j, b[i * n + j] / n - i);
    }
  }
  if (b[(n - 1) * n] != (n - 1) * n) moveLeft((n - 1), b[(n - 1) * n] % n);
  for (int i = 1; i < n; i++) {
    if (b[(n - 1) * n + i] == (n - 1) * n + i) continue;
    int col = b[(n - 1) * n + i] % n;
    moveUp(col, 1);
    int rgtmove = col - i;
    moveRight((n - 1), rgtmove);
    moveDown(col, 1);
    int pz = b[n * n - 1] % n;
    if (pz > col)
      moveLeft(n - 1, pz - col);
    else if (pz < col)
      moveRight(n - 1, col - pz);
    moveUp(col, 1);
    int up_pos = b[col] % n;
    if (up_pos > col) moveLeft(n - 1, up_pos - col);
    if (up_pos < col) moveRight(n - 1, col - up_pos);
    moveDown(col, 1);
    if (b[(n - 1) * n] != (n - 1) * n) moveLeft((n - 1), b[(n - 1) * n] % n);
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (b[i * n + j] != i * n + j) return false;
    }
  }
  cout << res.size() << "\n";
  for (int i = 0; i < res.size(); i++) {
    cout << ch[res[i].first] << res[i].second + 1 << "\n";
  }
  return true;
}
int main() {
  load();
  while (!solve()) {
    res.resize(0);
    memcpy(a, ia, sizeof ia);
    for (int i = 0; i < n; i++)
      for (int j = 0; j < n; j++) b[a[i][j]] = i * n + j;
    for (int i = 0; i <= 200; i++) {
      int t = rand() % 4;
      if (t == 0)
        moveLeft(rand() % n, 1);
      else if (t == 1)
        moveRight(rand() % n, 1);
      else if (t == 2)
        moveDown(rand() % n, 1);
      else if (t == 3)
        moveUp(rand() % n, 1);
    }
  }
  return 0;
}