#include using namespace std; #define ll long long #define sp ios_base::sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL) #define mp make_pair #define cps CLOCKS_PER_SEC #define mod (ll)1000000007 #define f first #define s second #define debug1(x) cout< #define pii pair #define pb push_back #define mxn 100005 int sx,sy,ex,ey,n; bool check(int x,int y){ if(x<0||x>=n||y<0||y>=n) return 0; return 1; } int main(){ //sp; cin>>n>>sx>>sy>>ex>>ey; int b[n][n],d[n][n]; for(int i=0; i q; q.push(mp(sx,sy)); b[sx][sy]=0; string c[6]; c[0]="UL"; c[1]="UR"; c[2]="R"; c[3]="LR"; c[4]="LL"; c[5]="L"; int x,y,dx,dy; while(!q.empty()){ x=q.front().f; y=q.front().s; q.pop(); for(int i=0; i<6; ++i){ dx=x+dir[i][0]; dy=y+dir[i][1]; if(check(dx,dy)&&b[dx][dy]>b[x][y]+1){ b[dx][dy]=b[x][y]+1; d[dx][dy]=i; q.push(mp(dx,dy)); } } } if(b[ex][ey]==1e9){ cout<<"Impossible"; return 0; } cout< st; while(1){ int z=d[x][y]; st.push(c[z]); x=x-dir[z][0]; y=y-dir[z][1]; if(x==sx&&y==sy) break; } while(!st.empty()){ cout<