#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cstdlib>
#include <cstdio>
using namespace std;
#define M_PI 3.141592
#define toRad 2.0*M_PI/360.0
#define inin(x) int x;cin>>x;
#define all(x) x.begin(),x.end()

struct point
{
	bool b[4];
};



int main()
{
	point a[5][5];
	for (int i = 0; i < 5; i++)
	{
		for (int l = 0; l < 5; l++)
		{
			for (int k = 0; k < 4; k++)
			{
				a[i][l].b[k] = false;
			}
		}
	}

	for (int i = 0; i < 5; i++)
	{
		string str;
		cin >> str;
		for (int l = 0; l < 4; l++)
		{
			a[i][l].b[1] = a[i][l + 1].b[3] = str[l] - '0';
		}

		if (i != 5 - 1)
		{
			cin >> str;
			for (int l = 0; l < 5; l++)
			{
				a[i][l].b[2] = a[i + 1][l].b[0] = str[l] - '0';
			}
		}
	}
	int x, y, v;
	x = y = 0;
	v = 1;
	while (1)
	{
		int d[4] = { -1 + 4,0 + 4,+1 + 4,+2 + 4 };
		int dx[4] = { 0,1,0,-1 };
		int dy[4] = { -1,0,1,0 };
		char dc[5] = "URDL";
		for (int i = 0; i < 4; i++)
		{
			int di = (v + d[i]) % 4;
			if (a[y][x].b[di])
			{
				x += dx[di];
				y += dy[di];
				v = di;
				cout << dc[di];
				break;
			}
		}
		if (x == y&&x == 0)
		{
			cout << endl;
			return 0;
		}
	}



}