let walk path =
  let (y_max, x_max) = (Array.length path.(0) + 1, (Array.length path)/2 + 1) in
  let move (x,y) dir =
          if dir = "R" then (x,y+1)
          else if dir = "L" then (x,y-1)
          else if dir = "D" then (x+1,y)
          else (x-1, y)
  in
  let turn_right dir =
          if dir = "R" then "D"
          else if dir = "D" then "L"
          else if dir = "L" then "U"
          else "R"
  in
  let turn_left dir = turn_right dir |> turn_right |> turn_right
  in
  let right_is_clear (x,y) dir =
      if dir = "R" && (y = y_max || path.(x*2).(y-1) = 0) then true
      else if dir = "L" && (y = 0 || path.((x-1)*2).(y-1) = 0) then true
      else if dir = "D" && (x = x_max || path.(x*2-1).(y-1) = 0) then true
      else if dir = "U" && (x = 0 || path.(x*2-1).(y) = 0) then true
      else false
  in
  let front_is_clear (x,y) dir =
      right_is_clear (x,y) (turn_left dir)
  in
  let rec loop (x,y) dir turn =
    if (x,y) = (0,0) then ()
    else
      begin
        if (not turn) && right_is_clear (x,y) dir then
          begin
            let d = turn_right dir in
            loop (x,y) d true
          end
        else if front_is_clear (x,y) dir then
          begin
            if not turn then print_string dir;
            loop (move (x,y) dir) dir false
          end
        else begin
            print_string dir;
            let d = turn_left dir in
            loop (x,y) d  false end
        end
  in
  loop (move (0,0) "R") "R" false
;;

let to_array s =
  let n = String.length s in
  Array.init n (fun x -> String.make 1 s.[x] |> int_of_string)
;;

let () =
  let a = Array.init 9 (fun x -> read_line () |> to_array) in
  walk a;Printf.printf "\n"
;;