$wall = $<.each_line.map(&:chomp)
def wall?(i, j, di, dj)
	i = i * 2 + di
	j += dj / 2
	return false if i < 0 or 8 < i or j < 0
	return $wall[i][j] == '1'
end

label = {
	[0, 1] => 'R',
	[1, 0] => 'D',
	[0, -1] => 'L',
	[-1, 0] => 'U',
}

i, j = v = [0, 1]
print 'R'

until i.zero? and j.zero?
	case
	when wall?(i, j, -v[1], v[0])
		v = [-v[1], v[0]]
	when wall?(i, j, *v)
	when wall?(i, j, v[1], -v[0])
		v = [v[1], -v[0]]
	else
		v = [-v[0], -v[1]]
	end
	i += v[0]
	j += v[1]
	print label[v]
end

puts