#include using namespace std; void printShortestPath(int n, int i_start, int j_start, int i_end, int j_end) { // Print the distance along with the sequence of moves. int a,b,h_axis,v_axis; if((i_start - i_end)%2 != 0){ cout << "Impossible"; } else { a = abs(i_end - i_start) ; if(i_end < i_start) a = a * -1; b = abs(j_start - j_end) ; if(j_end < j_start) b = b * -1; v_axis = abs(a/2); h_axis = abs(b); if((v_axis - h_axis)%2!=0) cout << "Impossible"; else{ int ans = 0; if(b!=0) ans = v_axis + (h_axis - v_axis)/2; else ans = v_axis; cout << ans << "\n"; while(a!=0 || b!=0) { if(a>0 && b>=0){ b-=1;a-=2; cout << "LR" << " "; } else if(a>0 && b<=0){ b+=1;a-=2; cout << "LL" << " "; } else if(a<0 && b>=0){ b-=1;a+=2; cout << "UR" << " "; } else if(a<0 && b<=0){ b+=1;a+=2; cout << "UL" << " "; } else if(a == 0 && b > 0){ while(b!=0){ cout << 'R' << " "; b -= 2; } } else if(a == 0 && b < 0){ while(b<0){ cout << 'L' << " "; b += 2; } } } } } } int main() { int n; cin >> n; int i_start; int j_start; int i_end; int j_end; cin >> i_start >> j_start >> i_end >> j_end; printShortestPath(n, i_start, j_start, i_end, j_end); return 0; }