#include "iostream" #include "climits" #include "list" #include "queue" #include "stack" #include "set" #include "functional" #include "algorithm" #include "string" #include "map" #include "unordered_map" #include "iomanip" #include "cmath" using namespace std; const long long int MOD = 1000000007; long long int N, M, K, H, W, L, R; int main() { ios::sync_with_stdio(false); cin.tie(0); cin >> N; int sy, sx, gy, gx; cin >> sy >> sx >> gy >> gx; if (abs(gy - sy) % 2) { cout << "Impossible\n"; return 0; } M = abs(gy - sy) / 2; if ((abs(gx - sx) + M) % 2) { cout << "Impossible\n"; return 0; } vector ans; while (sy != gy || sx != gx) { if (sy < gy) { sy += 2; if (sx > gx) { ans.push_back("LL"); sx--; } else { ans.push_back("LR"); sx++; } } else if (sy > gy) { sy -= 2; if (sx >= gx) { ans.push_back("UL"); sx--; } else { ans.push_back("UR"); sx++; } } else { if (sx > gx) { ans.push_back("L"); sx -= 2; } else { ans.push_back("R"); sx += 2; } } } mapm; for (auto i : ans) { m[i]++; } ans.clear(); for (int i = 0; i < m["UL"]; i++) { ans.push_back("UL"); } for (int i = 0; i < m["UR"]; i++) { ans.push_back("UR"); } for (int i = 0; i < m["R"]; i++) { ans.push_back("R"); } for (int i = 0; i < m["LR"]; i++) { ans.push_back("LR"); } for (int i = 0; i < m["LL"]; i++) { ans.push_back("LL"); } for (int i = 0; i < m["L"]; i++) { ans.push_back("L"); } cout << ans.size() << endl; for (int i = 0; i < ans.size(); i++) { if (i) { cout << " "; } cout << ans[i]; } cout << endl; return 0; }