require 'pp'

class Grid
  def initialize
    @result = []
    @x = 0
    @y = 0
    @direct = 0
    @map = []
    count = 0
    while input = $stdin.gets do 
      if count % 2 == 0  
        @map << ["1"] + input.chomp.split('').join("1").split('') + ["1"]
      else
        @map << input.chomp.split('').join("0").split('')
      end
      count += 1
    end
    @size = count
    walk_map

    puts @result.join('')
  end

  def walk_map
    loop do
      case @direct
      when 0
        walk_right
      when 1
        walk_down
      when 2
        walk_left
      when 3
        walk_up
      end
      break if @y == 0 && @x == 0
    end
  end

  def check_up_or_down
    case @direct
    when 0
      if @y != 0 && @map[@y-1][@x] == "1"
        @direct = 3
      elsif @y != @map.size-1 && @map[@y+1][@x] == "1"
        @direct = 1
      else
        @direct = 2
      end
    when 2
      if @y != @map.size-1 && @map[@y+1][@x] == "1"
        @direct = 1
      elsif @y != 0 && @map[@y-1][@x] == "1"
        @direct = 3
      else
        @direct = 0
      end
    end
  end

  def check_right_or_left
    case @direct
    when 1
      if @x != @map[@y].size-1 && @map[@y][@x+1] == "1"
        @direct = 0
      elsif @x != 0 && @map[@y][@x-1] == "1"
        @direct = 2
      else
        @direct = 3
      end
    when 3
      if @x != 0 && @map[@y][@x-1] == "1"
        @direct = 2
      elsif @x != @map[@y].size-1 && @map[@y][@x+1] == "1"
        @direct = 0
      else
        @direct = 1
      end
    end
  end

  def walk_right
    @x.step(@map[@y].size-3,2) do |index|
      if @map[@y][index+1] == "1" && @map[@y][index+2] == "1"
        @x += 2
        @result << "R"
      else
        break
      end
    end
    check_up_or_down
  end

  def walk_down
    @y.step(@map.size-3,2) do |index|
      if @map[index+1][@x] == "1" && @map[index+2][@x] == "1"
        @y += 2
        @result << "D"
      end
    end
    check_right_or_left
  end

  def walk_left
    @x.step(2,-2) do |index|
      if @map[@y][index-1] == "1" && @map[@y][index-2] == "1"
        @x -= 2
        @result << "L"
      else
        break
      end
    end
    check_up_or_down
  end

  def walk_up
    @y.step(2,-2) do |index|
      if @map[index-1][@x] == "1" && @map[index-2][@x] == "1"
        @y -= 2
        @result << "U"
      end
    end
    check_right_or_left
  end
end

g = Grid.new