m = []
9.times{|i|
  m[i] = gets.chomp.split("").map(&:to_i)
}

x = 0
y = 0
direc = 0
name = ["R", "D", "L", "U"]

50.times{
  print name[direc]
  if direc == 0
    if y > 0 && x < 8 && m[y-1][x+1] == 1
      direc = 3
      y -= 1
      x += 1
    elsif x < 8 && m[y][x+1] == 1
      x += 1
    elsif y < 8 && x < 8 && m[y+1][x+1] == 1
      direc = 1
      y += 1
      x += 1
    else
      direc = 2
    end
  elsif direc == 1
    if y < 8 && m[y+1][x] == 1
      direc = 0
      y += 1
    elsif y < 7 && m[y+2][x] == 1
      y += 2
    elsif y < 8 && x > 0 && m[y+1][x-1] == 1
      direc = 2
      y += 1
      x -= 1
    else
      direc = 3
    end
  elsif direc == 2
    if y < 8 && m[y+1][x] == 1
      direc = 1
      y += 1
    elsif x > 0 && m[y][x-1] == 1
      x -= 1
    elsif y > 0 && m[y-1][x] == 1
      direc = 3
      y -= 1
    else
      direc = 0
    end
  elsif direc == 3
    if y > 0 && x > 0 && m[y-1][x-1] == 1
      direc = 2
      y -= 1
      x -= 1
    elsif y > 1 && m[y-2][x] == 1
      y -= 2
    elsif y > 0 && m[y-1][x] == 1
      direc = 0
      y -= 1
    else
      direc = 1
    end
  end
  break if x == 0 && y == 0 && direc == 0
}

puts