#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define ff first
#define ss second
#define int long long
const int n = 5;
bool mapp[n][n] = {};
bool vis[n][n] = {false};
int dx[4] = {-1, 0, 1, 0};
int dy[4] = {0, 1, 0, -1};
string steps = "URDL";
int previous_step[n][n]; // 0 = up, 1 = right, 2 = down, 3 = left
vector<int> bfs_returner(int startx, int starty, int endx, int endy){
int V = n*n;
vector<int> res;
queue<pair<int, int>> q;
for(int i=0; i<n; i++){
for(int j=0; j<n; j++){
vis[i][j] = false;
}
}
q.push({startx, starty});
vis[startx][starty] = true;
while (!q.empty()) {
pair<int, int> u = q.front();
q.pop();
for (int i = 0; i < 4; i++) {
pair<int, int> v = {u.first + dx[i], u.second + dy[i]};
if (v.first < 0 || v.first >= n || v.second < 0 || v.second >= n) continue;
if (mapp[v.first][v.second] == 1) continue;
if (vis[v.first][v.second] == 1) continue;
vis[v.first][v.second] = true;
previous_step[v.first][v.second] = i;
q.push(v);
}
}
if (vis[endx][endy]==1) {
while(startx!=endx or starty!=endy) {
int p = previous_step[endx][endy];
res.push_back(p);
endx = endx - dx[p];
endy = endy - dy[p];
}
}
reverse(res.begin(), res.end());
return res;
}
void test(){
//ifstream cin("perimeter.in");
//ofstream cout("perimeter.out");
for(int i=0; i<5; i++){
for(int j=0; j<5; j++){
cin >> mapp[i][j];
}
}
int startxx, startyy, endxx, endyy;
cin >> startxx >> startyy;
cin >> endxx >> endyy;
vector<int> ans = bfs_returner(startxx, startyy, endxx, endyy);
for(int i=0; i<ans.size(); i++) cout << steps[ans[i]] << " "; cout << endl;
}
int32_t main(){
std::ios::sync_with_stdio(false);
std::cin.tie(nullptr); std::cout.tie(nullptr);
//int t;
//cin >> t;
//while(t--)
test();
}