#include<iostream>
#include<string>
using namespace std;

#define RIGHT 0
#define DOWN 1
#define LEFT 2
#define UP 3

int main(){
	bool cross[5][5][4];	// x,y,dir
	int px=0, py=0, dir = RIGHT;
	int d[4][2] = {{1,0}, {0,1}, {-1,0}, {0,-1}};
	string str;
	memset( cross, 0, sizeof(cross) );
	for( int i=0; i<4; i++ ){
		getline( cin, str );
		for( int j=0; j<4; j++ ){
			cross[j][i][RIGHT] = cross[j+1][i][LEFT] = (str[j]=='1');
		}
		getline( cin, str );
		for( int j=0; j<5; j++ ){
			cross[j][i][DOWN] = cross[j][i+1][UP] = (str[j]=='1');
		}
	}
	getline( cin, str );
	for( int j=0; j<4; j++ ){
		cross[j][4][RIGHT] = cross[j+1][4][LEFT] = (str[j]=='1');
	}
	do{
		for( int i=0; i<4; i++ ){
			if( cross[px][py][(dir+3+i)%4] ){
				dir = (dir+3+i)%4;
				px += d[dir][0];
				py += d[dir][1];
//				cout << (dir==RIGHT)?"R":((dir==DOWN)?"D":((dir==LEFT)?"L":"U"));
				if( dir == RIGHT ){
					cout << 'R';
				}else if( dir == DOWN ){
					cout << 'D';
				}else if( dir == LEFT ){
					cout << 'L';
				}else if( dir == UP ){
					cout << 'U';
				}
				break;
			}
		}
	}while( px!=0 || py!=0 );
	cout << endl;
	return 0;
}