#include using namespace std; const int OO = 1e6; int n, xs, ys, xe, ye, vis[205][205], path[205][205]; string str[6] = {"UL", "UR", "R", "LR", "LL", "L"}; pair a[6] = {{ -2, -1}, { -2, 1}, {0, 2}, {2, 1}, {2, -1}, {0, -2}}; int main() { cin >> n >> xs >> ys >> xe >> ye; memset(vis, 0, sizeof vis); queue< pair > q; q.push({xs, ys}); vis[xs][ys] = 1; int counter = 1, ans = 0, x, y; while (q.size()) { while (counter--) { auto m = q.front(); q.pop(); x = m.first; y = m.second; if (x == xe && y == ye) goto BUILD; for (int i = 0; i < 6; i++) { int xn = x + a[i].first; int yn = y + a[i].second; if (xn < 0 || xn >= n || yn < 0 || yn >= n || vis[xn][yn]) continue; path[xn][yn] = i; vis[xn][yn] = 1; q.push({xn, yn}); } } counter = q.size(); ans++; } cout << "Impossible" << endl; return 0; BUILD: cout << ans << endl; vector v; while (xs != xe || ys != ye) { int i = path[xe][ye]; v.push_back(str[i]); xe -= a[i].first; ye -= a[i].second; } reverse(v.begin(), v.end()); for (int i = 0; i < v.size(); i++) cout << v[i] << " "; cout << endl; return 0; }