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 JAVA):

Solution:
import java.io.*;
import java.util.*;

public class Main {
	static Scanner in;
	static PrintWriter out;
//	static StreamTokenizer in; static int next() throws Exception {in.nextToken(); return (int) in.nval;}
    static PrintWriter sout = new PrintWriter(System.out);

    static void sout(int[][] x) {
    	for (int[] xx : x) {
    		for (int xxx : xx) System.out.print(xxx + " ");
			System.out.println();
    	}
    	System.out.println();
    }
	
    static void sout(int[] x) {
    	for (int xxx : x) System.out.print(xxx + " ");
		System.out.println();
	}	

	static int[][] a;
	static int n = 6;
	static ArrayList<String> answ;

	static void shift(int line, boolean hor, boolean plus) {
		int d = plus ? 1 : -1;
		if (hor) {
			int[] y = new int[n];
			for (int i = 0; i < n; i++) y[(i + d + n) % n] = a[line][i];
			for (int i = 0; i < n; i++) a[line][i] = y[i];
			answ.add((plus ? "R" : "L") + (line + 1));
		} else {
			int[] y = new int[n];
			for (int i = 0; i < n; i++) y[(i + d + n) % n] = a[i][line];
			for (int i = 0; i < n; i++) a[i][line] = y[i];
			answ.add((plus ? "D" : "U") + (line + 1));
		}
	}

	static void rotate(int x, int y, boolean right, boolean down, boolean clock) {
		if (clock ^ right ^ down) {
			shift(x, false, !down);
			shift(y, true, !right);
			shift(x, false, down);			
			shift(y, true, right);
		} else {
			shift(y, true, !right);
			shift(x, false, !down);
			shift(y, true, right);
			shift(x, false, down);
		}
	}

	static void up(int x, int y) {
		rotate(x, y, true, false, true);
	}

	static void down(int x, int y) {
		rotate(x, y, true, true, false);
	}

	static void left(int x, int y) {
		rotate(x, y, false, true, false);
	}

	static void right(int x, int y) {
		rotate(x, y, true, true, true);
	}

	public static void main(String[] args) throws Exception {
		in = new Scanner(System.in);
		out = new PrintWriter(System.out);
//		in = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));
		
		
		answ = new ArrayList<String>();

		a = new int[n][n];
		for (int i = 0; i < n; i++) {
			String s = in.next();
			for (int j = 0; j < n; j++) {
				if ('0' <= s.charAt(j) && s.charAt(j) <= '9') a[i][j] = s.charAt(j) - '0';
				else a[i][j] = s.charAt(j) - 'A' + 10;
			}
		}

		int[][] aa = new int[n][n];
		for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) aa[i][j] = a[i][j];
		
		int[][] g = new int[n][n];
		int[] gx = new int[n*n];
		int[] gy = new int[n*n];
		int count = 0;
		for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) {
			g[i][j] = count;
			gx[count] = j;
			gy[count] = i;
			count++;
		}
		for (int index = 0;; index++) {

		answ = new ArrayList<String>();
		for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) a[i][j] = aa[i][j];
		
		if (index > 0) {
			int cnt = ((int)(Math.random() * 1e9)) % 100;
			for (int i = 0; i < cnt; i++) {
				int ii = ((int)(Math.random() * 1e9)) % 6;
				int jj1 = ((int)(Math.random() * 1e9)) % 2;
				int jj2 = ((int)(Math.random() * 1e9)) % 2;
				shift(ii, jj1 == 0, jj2 == 0);
			}
		}
//		sout(a);
//		System.out.println("!!!");

		for (int i = 0; i < 4*n; i++) {
			while (true) {
//				sout(a);
				int x = 0;
				int y = 0;
				F: for (; x < n; x++) for (y = 0; y < n; y++) {
					if (a[y][x] == i) break F;
				}
//				System.out.println(x + " " + y + " " + a[x][y] + " " + a[1][1]);
				if (g[y][x] == i) break;
				if (x != gx[i]) {
					if (y == 5) rotate(x, y, false, false, true);
					else left(x, y);
				}
				else up(x, y);
			}
		}

//		System.out.println("!!! 24");

		for (int i = 0; i < 4; i++) for (int t = 4*n + i; t <= 5*n + i; t += n) {
//			System.out.println(t);
//			sout(a);
			while (true) {
//				sout(a);
				int x = 0;
				int y = 0;
				F: for (; x < n; x++) for (y = 0; y < n; y++) if (a[y][x] == t) break F;
				if (g[y][x] == t) break;

				if (y != gy[t]) {
					if (x == 5) {
						if (y < gy[t]) rotate(x, y, false, true, true);
						else rotate(x, y, false, false, false);
					} else {
						if (y < gy[t]) rotate(x, y, true, true, false);
						else rotate(x, y, true, false, true);
					}
				} else {
					if (y == 4) rotate(x, y, false, true, false);
					else rotate(x, y, false, false, true);
				}
			}
		}
//		System.out.println("!!!");
		
/*		while (a[4][4] != 28 || a[4][5] != 29 || a[5][4] != 34 || a[5][5] != 35) {
			int i = ((int)(Math.random() * 1e9)) % 4;
			int j = ((int)(Math.random() * 1e9)) % 2;
			if (i == 0) rotate(4, 4, true, true, j == 0);
			if (i == 1) rotate(4, 5, true, false, j == 0);
			if (i == 2) rotate(5, 4, false, true, j == 0);
			if (i == 3) rotate(5, 5, false, false, j == 0);

			sout(a);
		}*/

		int x = 0;
		int y = 0;
		F: for (x = 0; x < n; x++) for (y = 0; y < n; y++) if (a[y][x] == 28) break F;
		if (x == 5 && y == 5) rotate(x, y, false, false, true);
		F: for (x = 0; x < n; x++) for (y = 0; y < n; y++) if (a[y][x] == 28) break F;
		if (x == 5) rotate(x, y, false, true, false);
		F: for (x = 0; x < n; x++) for (y = 0; y < n; y++) if (a[y][x] == 28) break F;
		if (y == 5) rotate(x, y, true, false, true);

		while (a[5][5] != g[5][5]) rotate(5, 5, false, false, true);

		if (a[5][4] == 34) break;

		}

		out.println(answ.size());
		for (String s : answ) out.println(s);

//		sout(a);

		out.close();
	}
}