/*--------------------------------------------------------------*/
/* ACM ICPC 2009-2010, NEERC                                    */
/* Northern Subregional Contest                                 */
/* St Petersburg, October 17, 2009                              */
/*--------------------------------------------------------------*/
/* Problem I. Image Recognition                                 */
/*                                                              */
/* Original idea         Mikhail Dvorkin                        */
/* Problem statement     Mikhail Dvorkin                        */
/* Testset               Mikhail Dvorkin                        */
/*--------------------------------------------------------------*/
/* Solution                                                     */
/*                                                              */
/* Author                Mikhail Dvorkin                        */
/*--------------------------------------------------------------*/
 
import java.io.*;
import java.util.*;

public class image_md_memory {
	private static String fileName = image_md_memory.class.getSimpleName().replaceFirst("_.*", "");
	private static String inputFileName = fileName + ".in";
	private static String outputFileName = fileName + ".out";
	private static Scanner in;
	private static PrintWriter out;
	
	private final int[] dx = new int[]{1, 0, -1, 0};
	private final int[] dy = new int[]{0, 1, 0, -1};
	private final char[] dn = new char[]{'D', 'R', 'U', 'L'};
	
	private int d;
	private int hei;
	private int wid;
	private boolean[][][] image;
	private int[][][] classify;
	private int masks;
	private int maxAnswer;
	private boolean[][][][] a;
	
	public void run() {
		d = in.nextInt();
		hei = in.nextInt();
		wid = in.nextInt();
		image = new boolean[d][hei][wid];
		classify = new int[hei][wid][2];
		for (int k = 0; k < d; k++) {
			for (int i = 0; i < hei; i++) {
				String s = in.next();
				for (int j = 0; j < wid; j++) {
					boolean black = s.charAt(j) == 'B';
					image[k][i][j] = black;
					classify[i][j][black ? 1 : 0] |= 1 << k;
				}
			}
		}
		masks = 1 << d;
		maxAnswer = (hei + wid) * d;
		a = new boolean[maxAnswer][masks][hei][wid];
		for (int k = 0; k < d; k++) {
			for (int i = 0; i < hei; i++) {
				for (int j = 0; j < wid; j++) {
					a[0][1 << k][i][j] = true;
				}
			}
		}
		int t = 0;
		while (true) {
			for (int m = 1; m < masks; m++) {
				for (int i = 0; i < hei; i++) {
					for (int j = 0; j < wid; j++) {
						if (a[t][m][i][j]) {
							continue;
						}
						int m0 = m & classify[i][j][0];
						int m1 = m & classify[i][j][1];
						if (a[t][m0][i][j] && a[t][m1][i][j]) {
							a[t][m][i][j] = true;
						}
					}
				}
			}
			if (a[t][masks - 1][0][0]) {
				print(t, masks - 1, 0, 0);
				out.println();
				return;
			}
			t++;
			for (int m = 1; m < masks; m++) {
				for (int i = 0; i < hei; i++) {
					for (int j = 0; j < wid; j++) {
						if (a[t][m][i][j]) {
							continue;
						}
						for (int d = 0; d < 4; d++) {
							int ii = i + dx[d];
							int jj = j + dy[d];
							if (ii < 0 || ii >= hei || jj < 0 || jj >= wid)
								continue;
							if (a[t - 1][m][ii][jj]) {
								a[t][m][i][j] = true;
							}
						}
					}
				}
			}
		}
	}

	private void print(int t, int m, int i, int j) {
		int m0 = m & classify[i][j][0];
		int m1 = m & classify[i][j][1];
		if (m0 > 0 && m1 > 0) {
			out.print("(");
			print(t, m0, i, j);
			out.print(":");
			print(t, m1, i, j);
			out.print(")");
			return;
		}
		if (t > 0) {
			for (int d = 0; d < 4; d++) {
				int ii = i + dx[d];
				int jj = j + dy[d];
				if (ii < 0 || ii >= hei || jj < 0 || jj >= wid)
					continue;
				if (a[t - 1][m][ii][jj]) {
					out.print(dn[d]);
					print(t - 1, m, ii, jj);
					return;
				}
			}
		}
		for (int k = 0; k < d; k++) {
			if (m == 1 << k) {
				out.print(k);
				return;
			}
		}
	}

	public static void main(String[] args) throws IOException {
		Locale.setDefault(Locale.US);
		if (args.length >= 2) {
			inputFileName = args[0];
			outputFileName = args[1];
		}
		in = new Scanner(new InputStreamReader(System.in));
		out = new PrintWriter(System.out);
		new image_md_memory().run();
		in.close();
		out.close();
	}
}
