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 long maxn = 6;
const long long mod = 1e9 + 7;
const long long inf = 1e9 + 500;
vector<pair<char, long long> > ans;
char jad[maxn][maxn];
char opp[maxn][maxn];
char aaa[maxn][maxn];
void copyy() {
  for (long long i = 0; i < maxn; i++) {
    for (long long j = 0; j < maxn; j++) {
      opp[i][j] = jad[i][j];
    }
  }
}
void prin() {
  cout << "===========================\n";
  for (long long i = 0; i < 6; i++) {
    for (long long j = 0; j < 6; j++) {
      cout << opp[i][j];
    }
    cout << endl;
  }
}
void act(char c, long long i) {
  ans.push_back(make_pair(c, i + 1));
  if (c == 'U') {
    for (long long j = 0; j < 5; j++) {
      swap(opp[j][i], opp[(j + 5) % 6][i]);
    }
    return;
  }
  if (c == 'R') {
    for (long long j = 5; j > 0; j--) {
      swap(opp[i][j], opp[i][(j + 5) % 6]);
    }
    return;
  }
  if (c == 'L') {
    for (long long j = 0; j < 5; j++) {
      swap(opp[i][j], opp[i][(j + 1) % 6]);
    }
    return;
  }
  if (c == 'D') {
    for (long long j = 5; j > 0; j--) {
      swap(opp[j][i], opp[(j + 1) % 6][i]);
    }
    return;
  }
  cout << "RIDI";
}
void pri() {
  cout << ans.size() << endl;
  for (long long i = 0; i < ans.size(); i++) {
    cout << ans[i].first << ans[i].second << endl;
  }
}
pair<long long, long long> fin(char c) {
  for (long long i = 0; i < 6; i++) {
    for (long long j = 0; j < 6; j++) {
      if (opp[i][j] == c) {
        return make_pair(i, j);
      }
    }
  }
}
bool hal() {
  for (long long i = 0; i < 5; i++) {
    for (long long j = 0; j < 6; j++) {
      char c = aaa[i][j];
      pair<long long, long long> v = fin(c);
      long long ii = v.first;
      long long jj = v.second;
      if (ii == i && jj == j) {
        continue;
      }
      if (ii == i) {
        act('D', jj);
        act('L', ii + 1);
        act('U', jj);
        ii++;
        jj--;
      }
      if (jj == j) {
        act('L', ii);
        jj = (jj + 5) % 6;
      }
      for (long long u = 0; u < ii - i; u++) {
        act('D', j);
      }
      while (jj != j) {
        act('R', ii);
        jj = (jj + 1) % 6;
      }
      for (long long u = 0; u < ii - i; u++) {
        act('U', j);
      }
    }
  }
  for (long long j = 0; j < 6; j++) {
    if (aaa[5][j] != opp[5][j]) {
      return 0;
    }
  }
  return 1;
}
int main() {
  srand(time(0));
  for (long long i = 0; i < 6; i++) {
    for (long long j = 0; j < 6; j++) {
      cin >> jad[i][j];
    }
  }
  copyy();
  for (long long i = 0; i < 6; i++) {
    for (long long j = 0; j < 6; j++) {
      if (i * 6 + j <= 9) {
        aaa[i][j] = 6 * i + j + '0';
      } else {
        aaa[i][j] = 6 * i + j - 10 + 'A';
      }
    }
  }
  while (hal() == 0) {
    ans.clear();
    copyy();
    for (long long i = 0; i < 50; i++) {
      long long c = rand() % 4;
      long long v = rand() % 6;
      if (c == 0) {
        act('U', v);
      }
      if (c == 1) {
        act('D', v);
      }
      if (c == 2) {
        act('R', v);
      }
      if (c == 3) {
        act('L', v);
      }
    }
  }
  pri();
}