#include<iostream>
#include<bitset>
#include<string>
#include<algorithm>
#define UP_DIRECTION 3
#define RIGHT_DIRECTION 2
#define DOWN_DIRECTION 1
#define LEFT_DIRECTION 0
using namespace std;
int dy[]={0,1,0,-1},dx[]={-1,0,1,0};
int main(){
    bitset<4>Square[5][5];
    string Wall[9];
    char For_Output[]="LDRU";
    for(int i=0;i<9;i++)cin>>Wall[i];

    for(int i=0;i<9;i+=2){
        Wall[i]="0"+Wall[i]+"0";
        for(int j=0;j<5;j++){
            Square[i/2][j][LEFT_DIRECTION]=(Wall[i][j]-'0');
            Square[i/2][j][RIGHT_DIRECTION]=(Wall[i][j+1]-'0');
        }
    }

    for(int i=1;i<9;i+=2){
        for(int j=0;j<5;j++){
            Square[i/2][j][DOWN_DIRECTION]=(Wall[i][j]-'0');
            Square[i/2+1][j][UP_DIRECTION]=(Wall[i][j]-'0');
        }
    }
    int Direction=RIGHT_DIRECTION;
    int y=0,x=0;

    do{
        int R=Direction-1;
        int L=Direction+1;
        int B=Direction-2;
        if(R<0)R=3;
        if(B<0)B+=4;
        L%=4;
        if(Square[y][x][L])
            Direction=L;

        else if(Square[y][x][Direction]);
        else if(Square[y][x][R])
            Direction=R;
        else Direction=B;

        y+=dy[Direction];
        x+=dx[Direction];
        cout<<For_Output[Direction];
    }while(y!=0||x!=0);
    cout<<endl;
}