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>
std::mt19937 rng(
    (int)std::chrono::steady_clock::now().time_since_epoch().count());
struct State {
  int a[6][6];
  void U(int j) {
    for (int i = 0; i < 5; i++) {
      std::swap(a[i][j], a[i + 1][j]);
    }
  }
  void D(int j) {
    for (int i = 0; i < 5; i++) {
      std::swap(a[5 - i][j], a[5 - i - 1][j]);
    }
  }
  void R(int i) {
    for (int j = 0; j < 5; j++) {
      std::swap(a[i][5 - j], a[i][5 - j - 1]);
    }
  }
  void L(int i) {
    for (int j = 0; j < 5; j++) {
      std::swap(a[i][j], a[i][j + 1]);
    }
  }
  void sendUP(int i, int j) {
    R(i);
    D(j);
    L(i);
    U(j);
  }
  void sendUP2(int i, int j) {
    L(i);
    D(j);
    R(i);
    U(j);
  }
  bool operator<(const State &o) const {
    for (int i = 0; i < 6; i++) {
      for (int j = 0; j < 6; j++) {
        if (a[i][j] != o.a[i][j]) {
          return a[i][j] < o.a[i][j];
        }
      }
    }
    return false;
  }
};
int main() {
  std::ios_base::sync_with_stdio(false);
  std::cin.tie(NULL);
  int a[6][6];
  {
    std::string mat[6];
    std::vector<std::pair<int, int>> ord;
    for (int i = 0; i < 6; i++) {
      std::cin >> mat[i];
      for (int j = 0; j < 6; j++) {
        ord.emplace_back('0' <= mat[i][j] && mat[i][j] <= '9'
                             ? mat[i][j] - '0'
                             : 10 + mat[i][j] - 'A',
                         i * 6 + j);
      }
    }
    std::sort(ord.begin(), ord.end());
    for (int i = 0; i < 36; i++) {
      a[ord[i].second / 6][ord[i].second % 6] = i;
    }
  }
  std::vector<std::pair<char, int>> ans;
  auto U = [&](int j) {
    for (int i = 0; i < 5; i++) {
      std::swap(a[i][j], a[i + 1][j]);
    }
    ans.emplace_back('U', j);
  };
  auto D = [&](int j) {
    for (int i = 0; i < 5; i++) {
      std::swap(a[5 - i][j], a[5 - i - 1][j]);
    }
    ans.emplace_back('D', j);
  };
  auto R = [&](int i) {
    for (int j = 0; j < 5; j++) {
      std::swap(a[i][5 - j], a[i][5 - j - 1]);
    }
    ans.emplace_back('R', i);
  };
  auto L = [&](int i) {
    for (int j = 0; j < 5; j++) {
      std::swap(a[i][j], a[i][j + 1]);
    }
    ans.emplace_back('L', i);
  };
  auto sendUP = [&](int i, int j) {
    R(i);
    D(j);
    L(i);
    U(j);
  };
  auto sendUP2 = [&](int i, int j) {
    L(i);
    D(j);
    R(i);
    U(j);
  };
  for (int on = 0; on < 36; on++) {
    for (int i = 0; i < 6; i++) {
      for (int j = 0; j < 6; j++) {
      }
    }
    int x, y;
    auto getPos = [&](int val) {
      x = -1, y = -1;
      for (int i = 0; i < 6; i++) {
        for (int j = 0; j < 6; j++) {
          if (a[i][j] == val) {
            x = i, y = j;
          }
        }
      }
      assert(x != -1);
    };
    getPos(on);
    if (on + 6 < 36) {
      if (x * 6 + y == on) {
        continue;
      }
      if (x == on / 6) {
        sendUP(x + 1, y);
        getPos(on);
      }
      assert(x != on / 6);
      while (y != on % 6) {
        R(x);
        getPos(on);
      }
      while (x != on / 6) {
        sendUP(x, y);
        getPos(on);
      }
    } else {
      assert(on + 6 == 36);
      std::map<State, std::pair<State, char>> bck;
      State curState, endState;
      for (int i = 0; i < 6; i++) {
        for (int j = 0; j < 6; j++) {
          curState.a[i][j] = a[i][j];
          endState.a[i][j] = i * 6 + j;
        }
      }
      bck[curState] = {curState, 'E'};
      std::queue<State> q;
      q.push(curState);
      while (!q.empty() && !bck.count(endState)) {
        curState = q.front();
        q.pop();
        auto cur = curState;
        cur.R(5);
        if (!bck.count(cur)) {
          bck[cur] = {curState, 'R'};
          q.push(cur);
        }
        cur = curState;
        cur.L(5);
        if (!bck.count(cur)) {
          bck[cur] = {curState, 'L'};
          q.push(cur);
        }
        cur = curState;
        cur.sendUP(5, 0);
        if (!bck.count(cur)) {
          bck[cur] = {curState, 'U'};
          q.push(cur);
        }
        cur = curState;
        cur.sendUP2(5, 0);
        if (!bck.count(cur)) {
          bck[cur] = {curState, 'u'};
          q.push(cur);
        }
      }
      assert(bck.count(endState));
      std::vector<char> wtf;
      for (curState = endState; bck[curState].second != 'E';
           curState = bck[curState].first) {
        wtf.push_back(bck[curState].second);
      }
      std::reverse(wtf.begin(), wtf.end());
      for (auto ch : wtf) {
        if (ch == 'R') {
          R(5);
        } else if (ch == 'L') {
          L(5);
        } else if (ch == 'U') {
          sendUP(5, 0);
        } else if (ch == 'u') {
          sendUP2(5, 0);
        } else {
          assert(0);
        }
      }
      break;
    }
  }
  for (int i = 0; i < 6; i++) {
    for (int j = 0; j < 6; j++) {
      assert(a[i][j] == i * 6 + j);
    }
  }
  assert(ans.size() <= 10000);
  std::cout << ans.size() << std::endl;
  for (auto op : ans) {
    std::cout << op.first << op.second + 1 << '\n';
  }
}