#include #include using namespace std; struct p{int x,y,l;string m;}; string t[202][202]; int main() { ios_base::sync_with_stdio(false); int n; cin >> n; int x,y,xf,yf; cin >> x >> y >> xf >> yf; queue

q; q.push({x,y,0,"N"}); int ans = -1; while(!q.empty()) { int xc = q.front().x; int yc = q.front().y; int lc = q.front().l; string mc = q.front().m; q.pop(); if(xc > n-1 || yc > n-1 || xc < 0 || yc <0 ) continue; if(t[xc][yc] != "") continue; t[xc][yc] = mc; if(xc == xf && yc == yf) { ans = lc; break; } q.push({xc-2,yc-1,lc+1,"UL"}); q.push({xc-2,yc+1,lc+1,"UR"}); q.push({xc,yc+2,lc+1,"R"}); q.push({xc+2,yc+1,lc+1,"LR"}); q.push({xc+2,yc-1,lc+1,"LL"}); q.push({xc,yc-2,lc+1,"L"}); } if(ans !=-1) { cout << ans << endl; vector s; while(t[xf][yf] != "N") { s.push_back(t[xf][yf]); if(t[xf][yf] == "UL") xf+=2,yf+=1; else if(t[xf][yf] == "UR") xf+=2,yf-=1; else if(t[xf][yf] == "R") yf-=2; else if(t[xf][yf] == "L") yf+=2; else if(t[xf][yf] == "LL") xf-=2,yf+=1; else if(t[xf][yf] == "LR") xf-=2,yf-=1; } for(int i =s.size()-1;i>-1;i--) cout << s[i] << " "; } else cout << "Impossible"; return 0; }