#include <cstdio>
#include <complex>
using namespace std;

int dir = 0;
int cur_x;
int cur_y;
int cur_side;

int refd[] = {0, 1, 0, 1};
int refx[] = {0, 0, -1, 0};
int refy[] = {0, 0, 0, -1};

int dx[] = {1, 0, -1, 0};
int dy[] = {0, 1, 0, -1};

char ans[] = "RDLU";

bool WithinRange(int d, int y, int x) {
  if (x < 0) return false;
  if (y < 0) return false;

  if (d == 0) { 
    if (x >= 4) return false;
    if (y >= 5) return false;
  } else {
    if (x >= 5) return false;
    if (y >= 4) return false;
  }
  return true;
}

char walls[2][5][5];

int main() {
  for (int i=0; i<9; i++) {
    int n = i%2 ? 5: 4;
    for (int j=0; j<n; j++) {
      scanf(" %c", &walls[i%2][i/2][j]);
    }
  }

  cur_side = -1;
  while (1) {
    int a, b, c;

    for (int i=0; i<4; i++) {
      int ndir = (dir+3+i)%4;

      a = refd[ndir];
      b = cur_y + refy[ndir];
      c = cur_x + refx[ndir];
      if (WithinRange(a, b, c) && walls[a][b][c] == '1') {
        cur_y += dy[ndir];
        cur_x += dx[ndir];
        printf("%c", ans[ndir]);
        dir = ndir;
        break;
      }
    }

    //printf("(%d, %d)\n", cur_y, cur_x);
    if (cur_y == 0 && cur_x == 0) break;
  }
  puts("");
}