#include #include #include #include #include using namespace std; // UL UR // //R L // // LL LR int main() { int n; int x,y; int x2,y2; cin >> n >> y >> x >> y2 >> x2; std::vector path; while(true) { if (y == y2) { if (x2 == x) break; if (abs(x2 - x) % 2 != 0) { std::cout << "Impossible" << std::endl; return 0; } else if (x2 - 2 >= x) { x = x + 2; path.push_back(3); } else if (x2 + 2 <= x) { x = x - 2; path.push_back(6); } else { std::cout << "Impossible" << std::endl; return 0; } } else if (abs(y - y2) % 2 == 0) { if (y - y2 > 0) { if (x >= x2) { path.push_back(1); y-=2; x-=1; } else { y-=2; x+=1; path.push_back(2); } //UL UR } else if (y - y2 < 0) { //LL LR if (x <=x2) { path.push_back(4); y+=2; x+=1; } else { y+=2; x-=1; path.push_back(5); } } } else { std::cout << "Impossible" << std::endl; return 0; } } //1 2 3 4 5 6 //UL, UR, R, LR, LL, L std::cout << path.size() << std::endl; std::sort(path.begin(),path.end()); for (int p : path ) { std::string jancsi; switch (p) { case 1: jancsi = "UL"; break; case 2: jancsi = "UR"; break; case 3: jancsi = "R"; break; case 4: jancsi = "LR"; break; case 5: jancsi = "LL"; break; case 6: jancsi = "L"; break; } std::cout << jancsi << " "; } return 0; }