#include #include #include #include #include #define pb push_back using namespace std; int parse(string a) { if (a == "UL") return 1; if (a == "UR") return 2; if (a == "R") return 3; if (a == "LR") return 4; if (a == "LL") return 5; if (a == "L") return 6; return 7; } bool comp(string a, string b) { return parse(b) > parse(a); } int main() { ios_base::sync_with_stdio(0); int n, x1, y1, x2, y2; cin >> n >> x1 >> y1 >> x2 >> y2; int height = abs(x1 - x2), width = abs(y1 - y2); bool isPossible = true; vector result; if (width % 2 == 0) { if (height % 4 != 0) isPossible = false; } else if (abs(height + 2) % 4 != 0) isPossible = false; if (isPossible) { int counter = 0; while(x1 != x2 || y1 != y2) { ++counter; if (x1 != x2) { if (x2 < x1) { if (y2 <= y1) { result.pb("UL"); x1 -= 2; y1 -= 1; } else { result.pb("UR"); x1 -= 2; y1 += 1; } } else { if (y2 >= y1) { result.pb("LR"); x1 += 2; y1 += 1; } else { result.pb("LL"); x1 += 2; y1 -= 1; } } } else if (y2 > y1) { result.pb("R"); y1 += 2; } else { result.pb("L"); y1 -= 2; } } cout << counter << "\n"; sort(result.begin(), result.end(), comp); for (auto i : result) cout << i << " "; cout << "\n"; } else { cout << "Impossible\n"; } return 0; }