/*--------------------------------------------------------------*/
/* 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 {
	private static String fileName = image_md.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 final int infty = Integer.MAX_VALUE / 2;
	
	private int d;
	private int hei;
	private int wid;
	private boolean[][][] image;
	private int[][][] classify;
	private int masks;
	private int[][][] a;
	private int[][][] howi;
	private int[][][] howj;
	
	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;
		a = new int[masks][hei][wid];
		howi = new int[masks][hei][wid];
		howj = new int[masks][hei][wid];
		for (int m = 1; m < masks; m++) {
			for (int i = 0; i < hei; i++) {
				for (int j = 0; j < wid; j++) {
					if ((m & (m - 1)) == 0) {
						a[m][i][j] = 0;
						continue;
					}
					a[m][i][j] = infty;
					for (int ii = 0; ii < hei; ii++) {
						for (int jj = 0; jj < wid; jj++) {
							int m0 = m & classify[ii][jj][0];
							int m1 = m & classify[ii][jj][1];
							if (m0 > 0 && m1 > 0) {
								int cur = dist(i, j, ii, jj) + Math.max(a[m0][ii][jj], a[m1][ii][jj]);
								if (cur < a[m][i][j]) {
									a[m][i][j] = cur;
									howi[m][i][j] = ii;
									howj[m][i][j] = jj;
								}
							}
						}
					}
				}
			}
		}
		print(masks - 1, 0, 0);
	}

	private void print(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(m0, i, j);
			out.print(":");
			print(m1, i, j);
			out.print(")");
			return;
		}
		if (a[m][i][j] > 0) {
			int ii = howi[m][i][j];
			int jj = howj[m][i][j];
			move(i, j, ii, jj);
			print(m, ii, jj);
			return;
		}
		for (int k = 0; k < d; k++) {
			if (m == 1 << k) {
				out.print(k);
				return;
			}
		}
	}

	private int dist(int x1, int y1, int x2, int y2) {
		return Math.abs(x1 - x2) + Math.abs(y1 - y2);
	}

	private void move(int x1, int y1, int x2, int y2) {
		for (int d = 0; d < 4; d++) {
			while (dist(x1 + dx[d], y1 + dy[d], x2, y2) < dist(x1, y1, x2, y2)) {
				out.print(dn[d]);
				x1 += dx[d];
				y1 += dy[d];
			}
		}
	}

	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 FileReader(inputFileName));
		out = new PrintWriter(outputFileName);
		new image_md().run();
		in.close();
		out.close();
	}
}
