#include using namespace std; void printShortestPath(int n, int i_start, int j_start, int i_end, int j_end) { int i = i_start; int j = j_start; int id = i_end - i; int jd = j_end - j; if (abs(id) & 1 || (abs(id) / 2 + abs(jd)) & 1) { cout << "Impossible" << endl; } else { list seq; while (id < 0) { if (j - 1 >= 0 && (jd <= 0 || abs(id) / 2 - 1 >= abs(jd) + 1)) { seq.push_back("UL"); i -= 2; j -= 1; } else if (j + 1 < n) { seq.push_back("UR"); i -= 2; j += 1; } else { cout << "Impossible" << endl; return; } id = i_end - i; jd = j_end - j; } while (j + 2 < n && jd > 0 && abs(jd) > abs(id) / 2) { seq.push_back("R"); j += 2; jd = j_end - j; } while (id > 0) { if (j + 1 < n && (jd >= 0 || abs(id) / 2 - 1 >= abs(jd) + 1)) { seq.push_back("LR"); i += 2; j += 1; } else if (j - 1 >= 0) { seq.push_back("LL"); i += 2; j -= 1; } else { cout << "Impossible" << endl; return; } id = i_end - i; jd = j_end - j; } while (jd < 0) { seq.push_back("L"); j -= 2; jd = j_end - j; } cout << seq.size() << endl; for (string s : seq) { cout << s << " "; } cout << endl; } } 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; }