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 int MAXN = 6;
char a[MAXN][MAXN], b[MAXN];
int dis() {
  int ret = 0;
  for (int i = 0; i < MAXN; ++i) {
    for (int j = 0; j < MAXN; ++j) {
      ret += abs(i - a[i][j] / MAXN);
      ret += abs(j - a[i][j] % MAXN);
    }
  }
  return ret;
}
void locate(int& x, int& y, int z) {
  for (x = 0; x < MAXN; ++x) {
    for (y = 0; y < MAXN; ++y) {
      if (a[x][y] == z) {
        return;
      }
    }
  }
}
void dump(const char* caption = "") {}
vector<tuple<char, int, int> > op;
void addop(char c, int i, int n) {
  op.push_back(tuple<char, int, int>(c, i, n));
}
template <bool ADDOP = true>
void rotr(int x, int k) {
  k = (k % MAXN + MAXN) % MAXN;
  for (int i = 0; i < MAXN; ++i) {
    b[i] = a[x][i];
  }
  rotate(b, b + k, b + MAXN);
  for (int i = 0; i < MAXN; ++i) {
    a[x][i] = b[i];
  }
  if (ADDOP) {
    addop('L', x, k);
  }
}
template <bool ADDOP = true>
void rotc(int y, int k) {
  k = (k % MAXN + MAXN) % MAXN;
  for (int i = 0; i < MAXN; ++i) {
    b[i] = a[i][y];
  }
  rotate(b, b + k, b + MAXN);
  for (int i = 0; i < MAXN; ++i) {
    a[i][y] = b[i];
  }
  if (ADDOP) {
    addop('U', y, k);
  }
}
int main() {
  char ch;
  int x, y;
  for (int i = 0; i < MAXN; ++i) {
    for (int j = 0; j < MAXN; ++j) {
      scanf(" %c", &ch);
      a[i][j] = (char)(isdigit(ch) ? ch - '0' : ch - 'A' + 10);
    }
  }
  dump();
  for (int i = 0; i < MAXN; ++i) {
    for (int j = 1; j < MAXN; ++j) {
      locate(x, y, i * MAXN + j);
      rotr(x, y);
      rotc(0, x);
      if (x != 0) {
        rotr(x, -y);
      }
      rotr(i, j);
      rotc(0, -i);
      rotr(i, -j);
    }
  }
  for (int j = 0; j < MAXN; ++j) {
    locate(x, y, j);
    rotr(x, y);
    rotc(0, x - 1);
    rotr(x, -y);
    rotc(0, 1);
    rotr(0, 1);
  }
  priority_queue<pair<int, string> > todo;
  map<string, pair<char, int> > done;
  string src(a[0], a[MAXN]), trg(a[0], a[MAXN]);
  sort(trg.begin(), trg.end());
  done[src] = {'!', -1};
  todo.push({0, src});
  while (done.count(trg) == 0) {
    string cur = todo.top().second;
    todo.pop();
    copy(cur.begin(), cur.end(), a[0]);
    for (int i = 0; i < 1; ++i) {
      for (int j = 0; j < 4; ++j) {
        (j < 2 ? rotr<false> : rotc<false>)(i, j % 2 == 0 ? 1 : -1);
        cur = string(a[0], a[MAXN]);
        if (done.count(cur) == 0) {
          todo.push({-dis(), cur});
          done[cur] = {"LRUD"[j], i};
        }
        (j < 2 ? rotr<false> : rotc<false>)(i, j % 2 == 0 ? -1 : 1);
      }
    }
  }
  vector<pair<char, int> > tail;
  while (trg != src) {
    pair<char, int> by = done[trg];
    copy(trg.begin(), trg.end(), a[0]);
    tail.push_back(by);
    (by.first == 'L' || by.first == 'R'
         ? rotr<false>
         : rotc<false>)(by.second, by.first == 'L' || by.first == 'U' ? -1 : 1);
    trg = string(a[0], a[MAXN]);
  }
  reverse(tail.begin(), tail.end());
  for (const auto& i : tail) {
    addop(i.first, i.second, 1);
  }
  int ans = 0;
  for (const auto& i : op) {
    ans += get<2>(i);
  }
  printf("%d\n", ans);
  for (const auto& i : op) {
    char c;
    int p, q;
    tie(c, p, q) = i;
    for (int j = 0; j < q; ++j) {
      printf("%c%d\n", c, p + 1);
    }
  }
  return 0;
}