#define _USE_MATH_DEFINES
 
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>

using namespace std;

char tate[4][5];
char yoko[5][4];
bool flag = false;

void test(int x, int y, int j){
	//cout<<x<<" "<<y<<" "<<endl;
	int i;
	//cin>>i;
	if(x==0&&y==0){
		cout<<endl;
		return;
	}

	if(j==0){                                  //右に動いた時
		if(x-1>=0 && tate[x-1][y]=='1'){       //行き止まり　上に
			cout<<"U";
			test(x-1, y, 1);
		}
		else if(y+1<5 && yoko[x][y]=='1'){     //右に行ける
			cout<<"R";
			test(x, y+1, 0);                   
		}
		else if(/*x+1<5 && */tate[x][y]=='1'){     //行き止まり　下に
			cout<<"D";
			test(x+1, y, 3);    //下に
		}
	}
	else if(j==1){                             //上に動いた時
		if(y-1>=0 && yoko[x][y-1]=='1'){       //行き止まり　左に
			cout <<"L";
			test(x, y-1, 2);
		}
		else if(x-1>=0 && tate[x-1][y]=='1'){  //上に行ける
			cout <<"U";
			test(x-1, y, 1);
		}
		else if(/* y+1<5 && */ yoko[x][y]=='1'){     //行き止まり　右に
			cout <<"R";
			test(x, y+1, 0);
		}
	}
	else if(j==2){                             //左に動いた時
		if(x+1<5 && tate[x][y]=='1'){          //行き止まり　下に
			cout<<"D";
			test(x+1, y, 3);
		}
		else if(y-1>=0 && yoko[x][y-1]=='1'){  //左に行けるなら
			cout<<"L";
			test(x, y-1, 2);
		}
		else if(x-1>=0 && tate[x-1][y]=='1'){  //行き止まり　上に
			cout<<"U";
			test(x-1, y, 1);
		}
	}
	else if(j==3){                             //下に動いた時
		if(y+1<5 && yoko[x][y]=='1'){          //行き止まり　右に
			cout <<"R";
			test(x, y+1, 0);
		}
		else if(x+1<5 && tate[x][y]=='1'){     //下に行けるなら
			cout <<"D";
			test(x+1, y, 3);
		}
		else if(y-1>=0 && yoko[x][y-1]=='1'){  //行き止まり　左に
			cout <<"L";
			test(x, y-1, 2);
		}
	}
}

int main(){

	for(int i=0;i<4;i++){
		cin >> yoko[i][0] >> yoko[i][1] >> yoko[i][2] >> yoko[i][3];
		cin >> tate[i][0] >> tate[i][1] >> tate[i][2] >> tate[i][3] >> tate[i][4];
	}
	cin >> yoko[4][0] >> yoko[4][1] >> yoko[4][2] >> yoko[4][3];
	
	cout << "R";
	test(0, 1, 0);
	
	return 0;
}