U = 0
R = 1
D = 2
L = 3

dx = [0, 1, 0, -1]
dy = [-1, 0, 1, 0]

h, w = gets.split.map(&:to_i)

a = (1..h).map { gets.chomp }
y0 = x0 = nil

dir = nil
(0..h-1).each do |i|
    (0..w-1).each do |j|
        if a[i][j] =~ /[URDL]/
            dir = eval(a[i][j])
            y0 = i
            x0 = j
            a[i][j] = ?.
        end
    end
end

pond = a.reverse.map(&:reverse).join.tr('.o', '01').to_i(2)

def encode(pond, dir, x, y)
    (pond << 10) + (dir << 8) + (x << 4) + y
end

def decode(state)
    [(state >> 10), (state >> 8) & 0b11, (state >> 4) & 0b1111, state & 0b1111]
end

start_state = encode(pond, dir, x0, y0)

stack = [start_state]

prev_state = {start_state => start_state}
goal = nil

catch(:finish) do
    loop do
        state = stack.pop
        pond, dir, x0, y0 = decode(state)

        dirs = [dir-1, dir, dir+1].map {|x| x % 4}
        dirs.each do |new_dir|
            x, y = x0, y0
            catch(:break) do
                loop do
                    x += dx[new_dir]
                    y += dy[new_dir]
                    throw(:break) if x < 0 || x >= w
                    throw(:break) if y < 0 || y >= h
                    break if pond[y * w + x] == 1
                end
                new_pond = pond - (1 << y * w + x)
                new_state = encode(new_pond, new_dir, x, y)
                if ! prev_state[new_state]
                    prev_state[new_state] = state
                    stack << new_state
                end
                if new_pond == 0
                    goal = new_state
                    throw(:finish)
                end
            end
        end
    end
end

v = goal
a = [?U, ?R, ?D, ?L]
route = []
loop do
    _, dir, _, _ = decode(v)
    route << a[dir]
    u = prev_state[v]
    break if u == prev_state[u]
    v = u
end
puts route.join.reverse