Even, Odd = 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

print "R"
y = 0
x = 1
direction = R
while true do
  break if [y, x] == [1, 0] && direction == U
  break if [y, x] == [1, 1] && direction == L
  case direction
    when R
      if verticalWall[y][x+1] == 1
        direction = (direction - 1) % 4
      elsif horizontalWall[y+1][x+1] == 0
        direction = (direction + 1) % 4
        y += 1
        x += 1
      else
        y += dy[direction]
        x += dx[direction]
      end
    when L
      if verticalWall[y][x] == 1
        direction = (direction - 1) % 4
      elsif horizontalWall[y][x-1] == 0
        direction = (direction + 1) % 4
        y += -1
        x += -1
      else
        y += dy[direction]
        x += dx[direction]
      end
    when D
      if horizontalWall[y+1][x] == 1
        direction = (direction - 1) % 4
      elsif verticalWall[y+1][x] == 0
        direction = (direction + 1) % 4
        y += 1
        x += -1
      else
        y += dy[direction]
        x += dx[direction]
      end
    when U
      if horizontalWall[y][x] == 1
        direction = (direction - 1) % 4
      elsif verticalWall[y-1][x+1] == 0
        direction = (direction + 1) % 4
        y += -1
        x += 1
      else
        y += dy[direction]
        x += dx[direction]
      end
  end
  print Letter[direction]
end
puts ""