using System;
using System.Text;

namespace AOJ0037
{
    class Program
    {
        static void Main(string[] args)
        {
            while (true)
            {
                string input = "";
                int[,] row = new int[6, 7];
                int[,] column = new int[7, 6];

                for (int i = 0; i < 4; i++)
                {
                    input = Console.ReadLine();
                    for(int j = 0; j < input.Length; j++)
                    {
                        row[j + 1, i + 1] = int.Parse(input.Substring(j, 1));
                    }

                    input = Console.ReadLine();
                    for (int j = 0; j < input.Length; j++)
                    {
                        column[j + 1, i + 1] = int.Parse(input.Substring(j, 1));
                    }
                }

                input = Console.ReadLine();
                for (int j = 0; j < input.Length; j++)
                {
                    row[j + 1, 5] = int.Parse(input.Substring(j, 1));
                }

                int X = 1;
                int Y = 1;
                char Dir = 'R';
                StringBuilder output = new StringBuilder();

                do
                {

                    switch (Dir)
                    {
                        case 'R':
                            if (column[X, Y - 1] == 1)
                            {
                                Y--;
                                Dir = 'U';
                            } else
                            {
                                if (row[X, Y] == 1)
                                {
                                    X++;
                                }
                                else
                                {
                                    if (column[X, Y] == 1)
                                    {
                                        Y++;
                                        Dir = 'D';
                                    }
                                    else
                                    {
                                        X--;
                                        Dir = 'L';
                                    }
                                }
                            }
                            break;

                        case 'L':
                            if (column[X, Y] == 1)
                            {
                                Y++;
                                Dir = 'D';
                            }
                            else
                            {
                                if (row[X-1, Y] == 1)
                                {
                                    X--;
                                }
                                else
                                {
                                    if (column[X, Y - 1] == 1)
                                    {
                                        Y--;
                                        Dir = 'U';
                                    }
                                    else
                                    {
                                        X++;
                                        Dir = 'R';
                                    }
                                }
                            }
                            break;

                        case 'D':
                            if (row[X, Y] == 1)
                            {
                                X++;
                                Dir = 'R';
                            }
                            else
                            {
                                if (column[X, Y] == 1)
                                {
                                    Y++;
                                }
                                else
                                {
                                    if (row[X - 1, Y] == 1)
                                    {
                                        X--;
                                        Dir = 'L';
                                    }
                                    else
                                    {
                                        Y--;
                                        Dir = 'U';
                                    }
                                }
                            }
                            break;

                        case 'U':
                            if (row[X - 1, Y] == 1)
                            {
                                X--;
                                Dir = 'L';
                            }
                            else
                            {
                                if (column[X, Y-1] == 1)
                                {
                                    Y--;
                                }
                                else
                                {
                                    if (row[X, Y] == 1)
                                    {
                                        X++;
                                        Dir = 'R';
                                    }
                                    else
                                    {
                                        Y++;
                                        Dir = 'D';
                                    }
                                }
                            }
                            break;
                    }

                    output.Append(Dir);
                } while (!((X == 1) && (Y == 1)));


                Console.WriteLine(output);
                if (String.IsNullOrEmpty(Console.ReadLine())) break;

            }
        }
    }
}

Measured memory_bytes: 8664