#include using namespace std; int printShortestPath(int n, int i_start, int j_start, int j_end, int i_end) { int c = 0; string str; bool flag = 0; while(j_start != j_end || i_start != i_end) { if(j_start > j_end) { j_start -= 2; if(i_start > i_end) { str = str + "UL "; i_start -= 1; if(i_start < i_end) { cout <<"Impossible"; return 0; } } else if(i_start < j_end) { str = str + "UR "; i_start += 1; if(i_start > j_end) { cout <<"Impossible"; return 0; } } if(j_start < j_end) { cout <<"Impossible"; return 0; } } else if(j_start < j_end) { j_start += 2; if(i_start > i_end) { str = str + "LL "; i_start -= 1; if(i_start < i_end) { cout <<"Impossible"; return 0; } } else if(i_start < j_end) { str = str + "LR "; i_start += 1; if(i_start > j_end) { cout <<"Impossible"; return 0; } } if(j_start > j_end) { cout <<"Impossible"; return 0; } } else if(j_start == j_end) { if(i_start > i_end) { str = str + "L "; i_start -= 2; } else if(i_start < j_end) { str = str + "R "; i_start += 2; } } c++; if(i_start > (n - 1) || j_start > (n - 1)) { cout <<"Impossible"; return 0; } if(i_start < 0 || j_start < 0) { cout <<"Impossible"; return 0; } } cout << c<< endl << str; return 0; } int main(void) { 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; }