board = Array.new(6) { Array.new(6) { Array.new 4 } }
9.times do |i|
  ws = gets.chomp.each_char.map {|c| c == ?0 ? false : true }
  if i % 2 == 0
    ws.each_with_index do |w, j|
      board[i/2][j+1][3] = board[i/2+1][j+1][1] = true if w
    end
  else
    ws.each_with_index do |w, j|
      board[i/2+1][j][0] = board[i/2+1][j+1][2] = true if w
    end
  end
end
x, y, d = 1, 0, 0
until x == 0 && y == 1 && d == 2 || x == 0 && y == 0 && d == 1
  if board[y][x][(d+3)%4]
    if board[y][x][d]
      print %w[R U L D][d]
      d = (d + 1) % 4
    else
      dx, dy = [[1, 0], [0, -1], [-1, 0], [0, 1]][d]
      x += dx
      y += dy
      print %w[R U L D][d]
    end
  else
    d = (d - 1) % 4
    dx, dy = [[1, 0], [0, -1], [-1, 0], [0, 1]][d]
    x += dx
    y += dy
  end
end
puts