#include using namespace std; using pii = pair; const int dx[] = { -2, -2, 0, 2, 2, 0 }; const int dy[] = { -1, 1, 2, 1, -1, -2 }; vector ss = { "UL", "UR", "R", "LR", "LL", "L" }; int n; int ti, tj; bool used[200][200]; void dfs(int x, int y, const vector>& d, vector& tmp, vector& res) { used[x][y] = true; if (x == ti && y == tj) { res = tmp; return; } for (int i = 0; i < 6; i++) { int tx = x + dx[i], ty = y + dy[i]; if (0 <= tx && tx < n && 0 <= ty && ty < n && d[tx][ty] > d[x][y] && !used[tx][ty]) { tmp.push_back(i); dfs(tx, ty, d, tmp, res); tmp.pop_back(); } if (!res.empty()) break; } } int main() { cin >> n; int si, sj; cin >> si >> sj >> ti >> tj; vector> d(n, vector(n, -1)); queue q; q.emplace(si, sj); d[si][sj] = 0; while (!q.empty()) { auto p = q.front(); q.pop(); for (int i = 0; i < 6; i++) { int tx = p.first + dx[i], ty = p.second + dy[i]; if (0 <= tx && tx < n && 0 <= ty && ty < n && d[tx][ty] == -1) { q.emplace(tx, ty); d[tx][ty] = d[p.first][p.second] + 1; } } } if (d[ti][tj] == -1) { puts("Impossible"); return 0; } vector tmp, res; dfs(si, sj, d, tmp, res); cout << res.size() << endl; for (int i = 0; i < (int)res.size(); i++) { cout << ss[res[i]] << " \n"[i + 1 == (int)res.size()]; } return 0; }