H, W = 5, 5
None, Wall = 0, 1
R, D, L, U = (0...4).to_a
Letter = ["R", "D", "L", "U"]
dy = [0, 1, 0, -1]
dx = [1, 0, -1, 0]

horizontalWall = Array.new(5+2) {Array.new(4+2, 0)}
verticalWall = Array.new(4+2) {Array.new(5+2, 0)}
horizontalWall[1][1,4] = gets.chomp.chars.map(&:to_i)
for i in 1..4 do
  verticalWall[i][1,5] = gets.chomp.chars.map(&:to_i)
  horizontalWall[i+1][1,4] = gets.chomp.chars.map(&:to_i)
end

frontWall = Array.new(H) {Array.new(W) {Array.new(4, 0)}}
rightWall = Array.new(H) {Array.new(W) {Array.new(4, 0)}}
for i in 0...5 do
  for j in 0...5 do
    rightWall[i][j][R] = horizontalWall[i+1][j+1]
    rightWall[i][j][L] = horizontalWall[i+1][j]
    rightWall[i][j][U] = verticalWall[i][j+1]
    rightWall[i][j][D] = verticalWall[i+1][j+1]

    frontWall[i][j][R] = verticalWall[i][j+1]
    frontWall[i][j][L] = verticalWall[i+1][j+1]
    frontWall[i][j][U] = horizontalWall[i+1][j]
    frontWall[i][j][D] = horizontalWall[i+1][j+1]
  end
end

y = x = 0
direction = R
while true do
  break if [y, x] == [0, 0] && direction != R
  if frontWall[y][x][direction] == Wall
    direction = (direction - 1) % 4
  else
    while rightWall[y][x][direction] != Wall do
      direction = (direction + 1) % 4
    end
  end
  print Letter[direction]
  y += dy[direction]
  x += dx[direction]
end
puts ""