#include #include // iteration and input/output stream #define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end))) #define srep(i, begin, end) for (__typeof(end) i = begin; i != end; i++) #define si(x) int x; scanf("%d", &x) #define sll(x) ll x; scanf("%lld", &x) #define pi(x) printf("%d", x) #define pll(x) printf("%lld", x) #define nl prinf("\n") #define tr(cont,it) \ for(typeof(cont.begin()) it = cont.begin(); it!= cont.end() ; it++) #define tc() int t; cin >> t ; while (t--) //STL shortcuts #define pb push_back #define pf push_front #define pob pop_back #define pof pop_front #define F first #define S second #define MP make_pair // Error detection #define trace1(x) cerr<<#x<<": "< vi; typedef vector vvi; typedef vector vll; typedef pair pii; typedef pair pill; inline void smax(int &x , int y) { x = max(x , y) ; } inline void smin(int &x , int y) { x = min(x , y) ; } int x1,yi,x2,y2; int n; vector d,vis; vector pre; int check(int x,int y,int m) { if(m==0) { if(x-2>=0 && y-1>=0) { if(!vis[x-2][y-1]) { vis[x-2][y-1]=1; d[x-2][y-1]= d[x][y]+1; pre[x-2][y-1] = 0; return 1;} return 0; } return 0; } else if(m==1) { if(x-2>=0 && y+1=0) { if(!vis[x+2][y-1]) { vis[x+2][y-1]=1; d[x+2][y-1] = d[x][y]+1; pre[x+2][y-1]=4; return 1;} return 0; } return 0; } else { if(y-2>=0) { if(!vis[x][y-2]) { vis[x][y-2]=1; d[x][y-2]= d[x][y]+1; pre[x][y-2] = 5; return 1;} return 0; } return 0; } } void bfs() { pre[x1][yi] = -1; deque pend; pend.pb(MP(x1,yi)); while(!pend.empty()) { int x = pend.front().F; int y = pend.front().S; if(x==x2 && y==y2) break; pend.pof(); rep(i,0,6) { if(check(x,y,i)==1) { if(i==0) pend.pb(MP(x-2,y-1)); else if(i==1) pend.pb(MP(x-2,y+1)); else if(i==2) pend.pb(MP(x,y+2)); else if(i==3) pend.pb(MP(x+2,y+1)); else if(i==4) pend.pb(MP(x+2,y-1)); else pend.pb(MP(x,y-2)); } } } } int main() { cin>>n; cin>>x1>>yi>>x2>>y2; d.resize(n,vi(n)); vis.resize(n,vi(n)); pre.resize(n,vi(n)); if(abs(x1-x2)%2==1) { cout<<"Impossible"< sol; int x = x2,y=y2; while(x!= x1 || y!= yi) { if(pre[x][y]==0) { x+= 2; y+= 1; sol.pb("UL"); } else if(pre[x][y]==1) { x+= 2; y-= 1; sol.pb("UR"); } else if(pre[x][y]==2) { y-= 2; sol.pb("R"); } else if(pre[x][y]==3) { x-=2; y-=1; sol.pb("LR"); } else if(pre[x][y]==4) { x-=2; y+=1; sol.pb("LL"); } else if(pre[x][y]==5) { y+=2; sol.pb("L"); } } cout<=0;i--) { cout<