#include #define MOD 1000000007ll #define PI 3.1415926535897932384626433832795 #define ll long long #define INF 1000000000000000000ll using namespace std; struct node { string path; int x,y; }; int main() { //freopen("exam.out","w",stdout); int a[205][205] = {0}; string path[205][205]; int n,x1,y1,x2,y2,s = 0; cin>>n>>x1>>y1>>x2>>y2; if(x1 == x2 && y1 == y2 ) return !printf("0"); queue q; node t; t.path = ""; t.x = x1; t.y = y1; q.push(t); while(!q.empty()){ s ++; int sz = q.size(); for(int i = 1; i <= sz; i ++){ t = q.front(); q.pop(); int x = t.x; int y = t.y; if(x - 2 >= 0){ if(y - 1 >= 0) { if(a[x - 2][y - 1] == 0) { node tt; tt.x = x - 2; tt.y = y - 1; tt.path = t.path + "UL."; q.push(tt); a[x - 2][y - 1] = s; path[x - 2][y - 1] = tt.path; //cout<< x - 2 << " " << y - 1 << endl; } } if(y + 1 < n){ if(a[x - 2][y + 1] == 0) { node tt; tt.x = x - 2; tt.y = y + 1; tt.path = t.path + "UR."; q.push(tt); a[x - 2][y + 1] = s; path[x - 2][y + 1] = tt.path; //cout<< x - 2 << " " << y + 1 << endl; } } } if(x + 2 < n){ if(y - 1 >= 0) { if(a[x + 2][y - 1] == 0) { node tt; tt.x = x + 2; tt.y = y - 1; tt.path = t.path + "LL."; q.push(tt); a[x + 2][y - 1] = s; path[x + 2][y - 1] = tt.path; //cout<< x + 2 << " " << y - 1 << endl; } } if(y + 1 < n){ if(a[x + 2][y + 1] == 0) { node tt; tt.x = x + 2; tt.y = y + 1; tt.path = t.path + "LR."; q.push(tt); a[x + 2][y + 1] = s; path[x + 2][y + 1] = tt.path; //cout<< x + 2 << " " << y + 1 << endl; } } } if(y - 2 >= 0){ if(a[x][y - 2] == 0){ node tt; tt.x = x; tt.y = y - 2; tt.path = t.path + "L."; q.push(tt); a[x][y - 2] = s; path[x][y - 2] = tt.path; //cout<< x << " " << y - 2 << endl; } } if(y + 2 < n){ if(a[x][y + 2] == 0){ node tt; tt.x = x; tt.y = y + 2; tt.path = t.path + "R."; q.push(tt); a[x][y + 2] = s; path[x][y + 2] = tt.path; //cout<< x << " " << y + 2 << endl; } } } //cout<