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;
template <class T>
ostream &operator<<(ostream &s, pair<T, long long int> a) {
  s << a.first << ' ' << a.second;
  return s;
}
string grid[6];
void left(long long int x, vector<string> &ans) {
  string s = "L";
  s += '1' + x;
  ans.push_back(s);
  for (int i = 1; i < 6; i++) swap(grid[x][i], grid[x][i - 1]);
}
void right(long long int x, vector<string> &ans) {
  string s = "R";
  s += '1' + x;
  ans.push_back(s);
  for (int i = 4; i >= 0; i--) swap(grid[x][i], grid[x][i + 1]);
}
void up(long long int x, vector<string> &ans) {
  string s = "U";
  s += '1' + x;
  ans.push_back(s);
  for (int i = 1; i < 6; i++) swap(grid[i][x], grid[i - 1][x]);
}
void down(long long int x, vector<string> &ans) {
  string s = "D";
  s += '1' + x;
  ans.push_back(s);
  for (int i = 4; i >= 0; i--) swap(grid[i][x], grid[i + 1][x]);
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  long long int T = 1;
  for (long long int qq = 1; qq <= T; qq++) {
    for (int i = 0; i < 6; i++) cin >> grid[i];
    vector<string> ans;
    string correct = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
    for (int i = 0; i < 5; i++) {
      for (int j = 0; j < 6; j++) {
        char c = correct[i * 6 + j];
        long long int x, y;
        for (int k = i; k < 6; k++)
          for (int l = 0; l < 6; l++)
            if (c == grid[k][l]) x = k, y = l;
        if (x == i && y == j) continue;
        if (x == i)
          down(y, ans), right(x + 1, ans), up(y, ans), x++, y++, y %= 6;
        if (y == j) right(x, ans), y++, y %= 6;
        for (int k = i; k < x; k++) down(j, ans);
        while (y != j) right(x, ans), y++, y %= 6;
        for (int k = i; k < x; k++) up(j, ans);
      }
    }
    for (int i = 0; i < 4; i++) {
      char c = correct[30 + i];
      long long int y, x = -1;
      for (int j = 0; j < 6; j++)
        if (grid[5][j] == c) y = j;
      y++, y %= 6;
      c = correct[31 + i];
      for (int j = 0; j < 6; j++)
        if (grid[5][j] == c) x = j;
      if (x == -1) {
        while (y != 4) right(5, ans), y++, y %= 6;
        down(5, ans);
        right(5, ans);
        up(5, ans);
        x = 0;
        y = 5;
      }
      if (x == y) continue;
      while (x != 5) right(5, ans), x++, y++, y %= 6;
      down(5, ans);
      while (y != 5) right(5, ans), y++, y %= 6;
      up(5, ans);
    }
    long long int x = -1;
    for (int i = 0; i < 6; i++)
      if (correct[29] == grid[5][i]) x = i;
    if (x != -1) {
      while (x != 5) right(5, ans), x++;
      string ara[13] = {"R6", "D6", "R6", "U6", "R6", "D6", "R6",
                        "U6", "R6", "D6", "R6", "U6", "R6"};
      for (int i = 0; i < 13; i++) ans.push_back(ara[i]);
    } else
      while (grid[5][5] != correct[35]) right(5, ans);
    cout << ans.size() << endl;
    for (auto x : ans) cout << x << endl;
  }
}