#include using namespace std; const int N = 505; int dx[] = {-1, 1, 2, 1, -1, -2}; int dy[] = {-2, -2, 0, 2, 2, 0}; string dir[] = {"UL", "UR", "R", "LR", "LL", "L"}; bool vis[N][N]; map, pair> prv; bool good(int x, int y, int n) { return x >= 0 and x < n and y >= 0 and y < n; } int bfs(pair from, pair to, int n) { queue> q; queue len; q.push(from); vis[from.first][from.second] = 1; len.push(0); prv[from] = {-1, -1}; while (!q.empty()) { pair cur = q.front(); q.pop(); int l = len.front(); len.pop(); if (cur == to) return l; for (int i = 0; i < 6; i++) { int x = cur.first + dx[i]; int y = cur.second + dy[i]; if (good(x, y, n) and !vis[x][y]) { q.push({x, y}); vis[x][y] = 1; len.push(l + 1); prv[{x, y}] = {cur.first, cur.second}; } } } return -1; } string move(pair from, pair to) { for (int i = 0; i < 6; i++) if (to.first - from.first == dx[i] and to.second - from.second == dy[i]) return dir[i]; return ""; } int main() { int n; cin >> n; int a[4]; for (int i = 0; i < n; i++) cin >> a[i]; pair from = {a[1], a[0]}; pair to = {a[3], a[2]}; int ans = bfs(from, to, n); if (ans == -1) { cout << "Impossible" << endl; return 0; } cout << ans << endl; pair path = to; vector trace; while (path != from) { trace.push_back(move(prv[path], path)); path = prv[path]; } for (int i = ans - 1; i > -1; i--) cout << trace[i] << " "; return 0; }