/*--------------------------------------------------------------*/
/* 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_ok_fast 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_ok_fast.this.mask[y][x]].print();
                out.print(":");
                states[y][x][this.mask & image_gk_ok_fast.this.mask[y][x]].print();
                out.print(")");
            }
        }
    }
    
    public void run() {
        long start = System.currentTimeMillis();
        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();
            }
        }
        //System.out.println("read: " + (System.currentTimeMillis() - start));
        
        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;
                    }
                }
            }
        }
//        System.out.println("mask: " + (System.currentTimeMillis() - start));
        
        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; 
        }
     //   System.out.println("caps: " + (System.currentTimeMillis() - start));

        states = new State[h][w][1 << d];
        final Deque<State> queue = new ArrayDeque<State>((w * h) << d);
        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;
                }
            }
        }
//        System.out.println("init: " + (System.currentTimeMillis() - start));

        while (!queue.isEmpty()) {
            final State s = queue.poll();
            if (states[0][0][(1 << d) - 1] != null && states[0][0][(1 << d) - 1].time == s.time) {
                break;
            }
            State[] lstates = states[s.y][s.x];
            if (lstates[s.mask] != s) {
                continue;
            }
            
            int lmask = mask[s.y][s.x];
            for (int cap : caps[s.mask]) {
                final State cs = lstates[cap];
                if (cs == null || cs.time > s.time) {
                    if ((cap & lmask) == s.mask) {
                        final State os = lstates[cap & ~lmask];
                        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 & ~lmask) == s.mask) {
                        final State os = lstates[cap & lmask];
                        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;
                }
            }
        }
     //   System.out.println("find: " + (System.currentTimeMillis() - start));
        states[0][0][(1 << d) - 1].print();
//        System.out.println("print: " + (System.currentTimeMillis() - start));
    }

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

        new image_gk_ok_fast().run();

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