#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define FOR(I,A,B) for(ll I = ll(A); I < ll(B); ++I)
const long double INF = 1e15;


int N = 30*30;
int L = 30;

// (i,j) i個下 , j個右
int ind(int a,int b){
	return a*L + b;
}
int Vi(int v){return v/L;}
int Vj(int v){return v%L;}

bool in(int i,int j,int si,int sj,int ti,int tj){
	if(i<min(si,ti) || max(si,ti)<i) return false;
	if(j<min(sj,tj) || max(sj,tj)<j) return false;
	return true;
}
int length(int v1,int v2){return abs(Vi(v1)-Vi(v2))+abs(Vj(v1)-Vj(v2));}

vector<int> VinRectangle(int si,int sj,int ti,int tj){
	// 四角形の中の頂点を始点からマンハッタン距離が小さい順に
	vector< pair<int,int> > Vs;
	FOR(i,min(si,ti),max(si,ti)+1){
		FOR(j,min(sj,tj),max(sj,tj)+1){
			Vs.push_back( { abs(i-si)+abs(j-sj) , ind(i,j) } );
		}
	}
	sort(Vs.begin(), Vs.end());
	vector<int> res;
	for(auto v:Vs) res.push_back(v.second);
	return res;
}


//vector< vector<string> > S(N,vector<string>(N));
vector< vector<long double> > Len(N,vector<long double>(N,INF));
//vector< vector<char> > C(N,vector<char>(N,'.'));
vector< vector<string> > route(N,vector<string>(N)); // Len の時のルートを示す文字列

void first_do_in_main(){
	FOR(i,0,N){
		int ai = Vi(i);		
		int aj = Vj(i);
		if( in(ai+1,aj,0,0,L-1,L-1) ){
			Len[i][ind(ai+1,aj)] = 5000.0;
			route[i][ind(ai+1,aj)] = "D";
		}
		if( in(ai-1,aj,0,0,L-1,L-1) ){
			Len[i][ind(ai-1,aj)] = 5000.0;
			route[i][ind(ai-1,aj)] = "U";
		}
		if( in(ai,aj+1,0,0,L-1,L-1) ){
			Len[i][ind(ai,aj+1)] = 5000.0;
			route[i][ind(ai,aj+1)] = "R";
		}
		if( in(ai,aj-1,0,0,L-1,L-1) ){
			Len[i][ind(ai,aj-1)] = 5000.0;
			route[i][ind(ai,aj-1)] = "L";
		}
	}
}
string rev_route(string s){
	reverse(s.begin(), s.end());
	FOR(i,0,s.size()){
		if(s[i] == 'U'){
			s[i] = 'D';
		}else if(s[i] == 'D'){
			s[i] = 'U';
		}else if(s[i] == 'R'){
			s[i] = 'L';
		}else if(s[i] == 'L'){
			s[i] = 'R';
		}
	}
	return s;
}

string do_calc(int si,int sj,int ti, int tj){
	int start,finish;
	vector<long double> d(N,INF); // startからiまでの距離 d[i]
	vector<int> pv(N); // pv[i]はiの前の頂点
	vector<string> rv(N); // pv[i]からiへどうやって来たか

	start = ind(si,sj);
	finish = ind(ti,tj);
	d[start] = 0;
	auto Vs = VinRectangle(si,sj,ti,tj);
	int Nvs = Vs.size();
	FOR(i,0,Nvs){
		FOR(j,0,i){
			// a -> b へのルート
			int a = Vs[j];
			int b = Vs[i];
			if(route[a][b].size() > 0 && d[a]+Len[a][b] < d[b]){
				d[b] = d[a]+Len[a][b];
				pv[b] = a;
				rv[b] = route[a][b];
			}
		}
	}

	vector<string> s;
	while(finish != start){
		s.push_back(rv[finish]);
		finish = pv[finish];
	}

	string res;
	reverse(s.begin(), s.end());
	for(auto s_ : s) res += s_;
	return res;
}



bool check(string s,int si,int sj,int ti,int tj){
	for(char x:s){
		if(x=='U') si--;
		if(x=='D') si++;
		if(x=='R') sj++;
		if(x=='L') sj--;
	}
	return (si==ti)&&(sj==tj);
}



int main(){
	first_do_in_main();

	FOR(k,0,1000){
		int si,sj,ti,tj;
		cin >> si >> sj >> ti >> tj;
		string res = do_calc(si,sj,ti,tj);

		cout << res << endl;
		cout << flush;

		long double be;
		cin >> be;


		//assert(check(res,si,sj,ti,tj));
		//assert(check(rev_route(res),ti,tj,si,sj));

		/*int st = ind(si,sj);
		int fi = ind(ti,tj);
		route[st][fi] = res;
		Len[st][fi] = be;
		route[fi][st] = rev_route(res);
		Len[fi][st] = be;
		*/


	}


}
#include <bits/stdc++.h>

#define rep(i, n) for (int i = 0; i < (n); i++)

using ll = long long;
using namespace std;

const int INF = 1 << 30;

int main() {
  int a, b, c, d;
  cin >> a >> b >> c >> d;

  int ans = INF;
  ans = min(ans, a);
  ans = min(ans, b);
  ans = min(ans, c);
  ans = min(ans, d);
  cout << ans << endl;
}