#include using namespace std; void printShortestPath(int n, int i_start, int j_start, int i_end, int j_end) { if ((abs(i_end - i_start) % 2 != 0) || (abs(i_end - i_start) % 4 == 0 && abs(j_end - j_start) % 2 != 0) || (abs(i_end - i_start) % 4 == 2 && abs(j_end - j_start) % 2 != 1)) { cout << "Impossible"; return; } string s; int sn; for (sn = 0; i_start != i_end || j_start != j_end; ++sn) { if (i_start > i_end) { if (j_start + (i_start - i_end) / 2 <= j_end || j_start == 0) { s += "UR "; i_start -= 2; j_start += 1; } else { s += "UL "; i_start -= 2; j_start -= 1; } } else if (j_start + (i_end - i_start) / 2 < j_end) { s += "R "; j_start += 2; } else if (i_start < i_end) { if (j_start - (i_end - i_start) / 2 >= j_end || j_start == n - 1) { s += "LL "; i_start += 2; j_start -= 1; } else { s += "LR "; i_start += 2; j_start += 1; } } else { s += "L "; j_start -= 2; } } cout << sn << endl << s; } 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; }