#include using namespace std; const int N = 210; struct TV { int x, y, dir; TV(){}; TV(int x, int y, int dir) : x(x), y(y), dir(dir) {}; } prv[N][N]; int dp[N][N]; int dx[] = {-2, -2, 0, 2, 2, 0}; int dy[] = {-1, 1, 2, 1, -1, -2}; string s[] = {"UL", "UR", "R", "LR", "LL", "L"}; int main() { //freopen("csa.in", "r", stdin); int n; cin >> n; int xstart, ystart, xend, yend; cin >> xstart >> ystart >> xend >> yend; #define ii pair < int, int > #define inf 0x3f3f3f3f memset(dp, 0x3f, sizeof dp); dp[xstart][ystart] = 0; queue < ii > q; q.push({xstart, ystart}); while (!q.empty()) { int u = q.front().first, v = q.front().second; q.pop(); for(int dir = 0; dir < 6; ++dir) { int x = u + dx[dir], y = v + dy[dir]; if (x >= 0 && x < n && y >= 0 && y < n && dp[x][y] > dp[u][v] +1) { dp[x][y] = dp[u][v] +1; prv[x][y] = { u, v, dir }; q.push({x, y}); } } } if (dp[xend][yend] == inf) cout << "Impossible"; else { vector < string > res; while (xend != xstart || yend != ystart) { res.push_back(s[prv[xend][yend].dir]); int curx = prv[xend][yend].x, cury = prv[xend][yend].y; xend = curx; yend = cury; } reverse(res.begin(), res.end()); cout << res.size() << '\n'; for(int i = 0; i < res.size(); ++i) cout << res[i] << ' '; } }