#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 max_i = max(i_start, i_end); int min_i = min(i_start, i_end); int max_j = max(j_start, j_end); int min_j = min(j_start, j_end); if((max_i - min_i)%2 || ((max_i-min_i)/2 + (max_j-min_j))%2 ){ cout << "Impossible"; }else{ int steps = 0; string str = ""; while( i_start != i_end || j_start != j_end){ steps++; if(i_start < i_end){ if(j_start == j_end){ i_start += 2; j_start -=1; str += "LR "; }else if(j_start < j_end){ i_start += 2; j_start +=1; str += "LL "; }else{ i_start += 2; j_start -=1; str += "LR "; } }else if(i_start > i_end){ if(j_start == j_end){ i_start += 2; j_start -=1; str += "UL "; }else if(j_start < j_end){ i_start -= 2; j_start +=1; str += "UR "; }else{ i_start -= 2; j_start -=1; str += "UL "; } }else if( j_start > j_end){ j_start -= 2; str += "L "; }else{ j_start += 2; str += "R "; } } cout << steps << endl << str; } } 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; }