/*--------------------------------------------------------------*/
/* 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                Georgiy Korneev                        */
/*--------------------------------------------------------------*/
 
import java.util.*;
import java.io.*;

public class image_gk implements Runnable {
    static Scanner in;
    static PrintWriter out;

    static int[] DX = new int[]{1, 0, -1, 0};
    static int[] DY = new int[]{0, 1, 0, -1};
    
    char[][][] fields;
    int[][] mask;
    State[][][] states;
    int[][] caps;
    
    int time(int x1, int y1, int x2, int y2) {
    	return Math.abs(x1 - x2) + Math.abs(y1 - y2);
    }
    
    class State {
    	final int mask;
    	final int x;
    	final int y;
    	final int time;
    	final State prev;
    	
    	State(int mask, int x, int y, int time, State prev) {
    		this.mask = mask;
    		this.x = x;
    		this.y = y;
    		this.time = time;
    		this.prev = prev;
    	}

		public void print() {
			if (prev == null) {
				int m = mask;
				int c = 0;
				while (m != 0) {
					m >>= 1;
					c++;
				}
				out.print(c - 1);
			} else if (this.x != prev.x) {
				out.print(this.x < prev.x ? "R" : "L");
				prev.print();
			} else if (this.y != prev.y) {
				out.print(this.y < prev.y ? "D" : "U");
				prev.print();
			} else {
				out.print("(");
				states[y][x][this.mask & ~image_gk.this.mask[y][x]].print();
				out.print(":");
				states[y][x][this.mask & image_gk.this.mask[y][x]].print();
				out.print(")");
			}
		}
    }
    
    public void run() {
        int d = in.nextInt();
        int h = in.nextInt();
        int w = in.nextInt();

        fields = new char[d][h][];
        for (int i = 0; i < d; i++) {
        	in.nextLine();
            for (int y = 0; y < h; y++) {
                fields[i][y] = in.nextLine().toCharArray();
            }
        }
    	
        mask = new int[h][w];
        for (int x = 0; x < w; x++) {
        	for (int y = 0; y < h; y++) {
        		for (int i = 0; i < d; i++) {
        			if (fields[i][y][x] == 'B') {
        				mask[y][x] |= 1 << i;
        			}
        		}
        	}
        }
        
        caps = new int[1 << d][];
        for (int i = 0; i < 1 << d; i++) {
        	caps[i] = new int[(1 << (d - Integer.bitCount(i))) - 1];
        	int c = 0;
        	for (int j = 0; j < 1 << d; j++) {
        		if (i != j && (i | j) == j) {
            		caps[i][c++] = j;
        		}
        	}
        	assert c == caps[i].length; 
        }

        states = new State[h][w][1 << d];
        final Deque<State> queue = new ArrayDeque<State>();
        for (int x = 0; x < w; x++) {
        	for (int y = 0; y < h; y++) {
        		for (int i = 0; i < d; i++) {
        			State state = new State(1 << i, x, y, 0, null);
					queue.offer(state);
					states[y][x][1 << i] = state;
        		}
        	}
        }

        while (!queue.isEmpty()) {
        	final State s = queue.poll();
        	if (states[s.y][s.x][s.mask] != s) {
        		continue;
        	}
        	
			for (int cap : caps[s.mask]) {
				final State cs = states[s.y][s.x][cap];
				if (cs == null || cs.time > s.time) {
					if ((cap & mask[s.y][s.x]) == s.mask) {
						final State os = states[s.y][s.x][cap & ~mask[s.y][s.x]];
						if (os != null && os.time <= s.time) {
							State ns = new State(cap, s.x, s.y, s.time, s);
							queue.addFirst(ns);
							states[ns.y][ns.x][ns.mask] = ns;
						}
					} 
					if ((cap & ~mask[s.y][s.x]) == s.mask) {
						final State os = states[s.y][s.x][cap & mask[s.y][s.x]];
						if (os != null && os.time <= s.time) {
							State ns = new State(cap, s.x, s.y, s.time, s);
							queue.addFirst(ns);
							states[ns.y][ns.x][ns.mask] = ns;
						}
					}
				}
			}
			
        	for (int z = 0; z < 4; z++) {
        		int nx = s.x + DX[z];
				int ny = s.y + DY[z];
				
				if (0 <= nx && nx < w && 0 <= ny && ny < h && states[ny][nx][s.mask] == null) {
					final State ns = new State(s.mask, nx, ny, s.time + 1, s);
					queue.offer(ns);
					states[ns.y][ns.x][ns.mask] = ns;
				}
        	}
        }
        states[0][0][(1 << d) - 1].print();
    }

	public static void main(String[] args) throws Exception {        
        in = new Scanner(System.in);
        out = new PrintWriter(System.out);

        new image_gk().run();

        in.close();
        out.close();
    }
}
