#include #include #include #include #include using namespace std; int main() { /* Enter your code here. Read input from STDIN. Print output to STDOUT */ int startx, starty, endx, endy, n, i, j, k, tx, ty; cin >> n; cin >> starty >> startx >> endy >> endx; if((2*endx + endy) % 4 != (2*startx + starty) % 4) { cout << "Impossible"; return 0; } j = abs(endy - starty) / 2; i = max(0, (abs(startx - endx) - j) / 2); cout << i + j << endl; tx = startx; ty = starty; while(tx != endx || ty != endy){ if(ty > endy) { if(tx > 0 && (ty - endy) > 2*(endx - tx)){ cout << "UL "; tx--; ty -= 2; } else { cout << "UR "; tx++; ty -= 2; } } else if(endy == ty){ if(tx > endx){ cout << "L "; tx -= 2; } else { cout << "R "; tx += 2; } } else if( (endy - ty) < 2*(endx - tx) ){ cout << "R "; tx += 2; } else if( (tx < n - 1) && (endy - ty) > 2*(tx - endx) ){ cout << "LR "; tx++; ty += 2; } else { cout << "LL "; tx--; ty += 2; } } cout << endl; return 0; }