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;
string s[6];
string f[] = {"012345", "6789AB", "CDEFGH", "IJKLMN", "OPQRST", "UVWXYZ"};
string par[] = {"L6", "D6", "L6", "U6", "L6", "D6", "L6",
                "U6", "L6", "D6", "L6", "U6", "L6"};
vector<string> ans;
inline void add(char ch, int num) {
  string str = "";
  str += ch;
  str += char(num + 1 + '0');
  ans.emplace_back(str);
}
inline void rotateRight(int row) {
  for (int i = 5; i > 0; i--) {
    swap(s[row][i], s[row][i - 1]);
  }
}
inline void rotateLeft(int row) {
  for (int i = 0; i < 5; i++) {
    swap(s[row][i], s[row][i + 1]);
  }
}
inline void rotateDown(int col) {
  for (int i = 5; i > 0; i--) {
    swap(s[i][col], s[i - 1][col]);
  }
}
inline void rotateUp(int col) {
  for (int i = 0; i < 5; i++) {
    swap(s[i][col], s[i + 1][col]);
  }
}
inline void bringToEnd(char ch) {
  for (int i = 0; i < 6; i++) {
    for (int j = 0; j < 6; j++) {
      if (s[i][j] == ch) {
        for (int k = j; k < 5; k++) {
          rotateRight(i);
          add('R', i);
        }
        for (int k = i; k < 5; k++) {
          rotateDown(5);
          add('D', 5);
        }
        if (i != 5) {
          for (int k = j; k < 5; k++) {
            rotateLeft(i);
            add('L', i);
          }
        }
        return;
      }
    }
  }
}
inline pair<int, int> find(char ch) {
  for (int i = 0; i < 6; i++) {
    for (int j = 0; j < 6; j++) {
      if (s[i][j] == ch) return {i, j};
    }
  }
}
inline void func1(int k, pair<int, int> pos) {
  if (pos.first != 5) {
    for (int i = k; i < 5; i++) {
      rotateRight(5);
      add('R', 5);
    }
    for (int i = pos.first; i < 5; i++) {
      rotateDown(5);
      add('D', 5);
    }
    for (int i = k; i < 5; i++) {
      rotateLeft(5);
      add('L', 5);
    }
    for (int i = pos.first; i < 5; i++) {
      rotateUp(5);
      add('U', 5);
    }
  } else {
    for (int i = pos.second; i < 5; i++) {
      rotateRight(5);
      add('R', 5);
    }
    rotateDown(5);
    add('D', 5);
    for (int i = k; i < pos.second; i++) {
      rotateRight(5);
      add('R', 5);
    }
    rotateUp(5);
    add('U', 5);
    for (int i = k; i < 5; i++) {
      rotateLeft(5);
      add('L', 5);
    }
  }
}
inline void func2(int k, pair<int, int> pos) {
  if (pos.second != 5) {
    for (int i = k; i < 5; i++) {
      rotateDown(5);
      add('D', 5);
    }
    for (int i = pos.second; i < 5; i++) {
      rotateRight(5);
      add('R', 5);
    }
    for (int i = k; i < 5; i++) {
      rotateUp(5);
      add('U', 5);
    }
    for (int i = pos.second; i < 5; i++) {
      rotateLeft(5);
      add('L', 5);
    }
  } else {
    for (int i = pos.first; i < 5; i++) {
      rotateDown(5);
      add('D', 5);
    }
    rotateRight(5);
    add('R', 5);
    for (int i = k; i < pos.first; i++) {
      rotateDown(5);
      add('D', 5);
    }
    rotateLeft(5);
    add('L', 5);
    for (int i = k; i < 5; i++) {
      rotateUp(5);
      add('U', 5);
    }
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout << setprecision(32);
  for (int i = 0; i < 6; i++) {
    cin >> s[i];
  }
  for (int i = 0; i < 5; i++) {
    for (int j = 0; j < i; j++) {
      if (s[i][j] == f[i][j]) continue;
      bringToEnd(f[i][j]);
      for (int k = i; k < 5; k++) {
        rotateDown(j);
        add('D', j);
      }
      for (int k = j; k < 5; k++) {
        rotateLeft(5);
        add('L', 5);
      }
      for (int k = i; k < 5; k++) {
        rotateUp(j);
        add('U', j);
      }
    }
    for (int j = 0; j < i; j++) {
      if (s[j][i] == f[j][i]) continue;
      bringToEnd(f[j][i]);
      for (int k = i; k < 5; k++) {
        rotateRight(j);
        add('R', j);
      }
      for (int k = j; k < 5; k++) {
        rotateUp(5);
        add('U', 5);
      }
      for (int k = i; k < 5; k++) {
        rotateLeft(j);
        add('L', j);
      }
    }
    if (s[i][i] != f[i][i]) {
      bringToEnd(f[i][i]);
      for (int k = i; k < 5; k++) {
        rotateDown(i);
        add('D', i);
      }
      for (int k = i; k < 5; k++) {
        rotateLeft(5);
        add('L', 5);
      }
      for (int k = i; k < 5; k++) {
        rotateUp(i);
        add('U', i);
      }
    }
  }
  for (int i = 0; i < 5; i++) {
    for (int j = 0; j < 5; j++) {
      assert(s[i][j] == f[i][j]);
    }
  }
  if (f[5][0] != s[5][0]) func1(0, find(f[5][0]));
  if (f[0][5] != s[0][5]) func2(0, find(f[0][5]));
  if (f[5][1] != s[5][1]) func1(1, find(f[5][1]));
  if (f[1][5] != s[1][5]) func2(1, find(f[1][5]));
  if (f[5][2] != s[5][2]) func1(2, find(f[5][2]));
  if (f[2][5] != s[2][5]) func2(2, find(f[2][5]));
  if (f[5][3] != s[5][3]) func1(3, find(f[5][3]));
  if (f[3][5] != s[3][5]) func2(3, find(f[3][5]));
  if (f[5][4] != s[5][4]) func1(4, find(f[5][4]));
  if (f[5][5] != s[5][5]) {
    for (int i = 0; i < 13; i++) {
      ans.emplace_back(par[i]);
      if (par[i][0] == 'L') rotateLeft(5);
      if (par[i][0] == 'R') rotateRight(5);
      if (par[i][0] == 'U') rotateUp(5);
      if (par[i][0] == 'D') rotateDown(5);
    }
  }
  cout << ans.size() << '\n';
  for (auto x : ans) {
    cout << x << '\n';
  }
  return 0;
}