#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long LL; typedef unsigned long long ULL; #define MEM(a,b) memset((a),(b),sizeof(a)) const LL INF = 1e9 + 7; const int N = 2e2 + 10; int dx[] = { -2, -2, 0, 2, 2, 0 }; int dy[] = { -1, 1, 2, 1, -1, -2 }; int dis[N][N]; int flag[N][N]; vector vs = { "UL", "UR", "R", "LR", "LL", "L" }; int main() { //freopen("input.txt", "r", stdin); //freopen("output.txt", "w", stdout); int n; cin >> n; MEM(dis, 0x3f); int ax, ay, bx, by; cin >> ax >> ay >> bx >> by; queue> q; q.push({ ax, ay }); dis[ax][ay] = 0; while (!q.empty()) { int x, y; tie(x, y) = q.front(); q.pop(); for (int i = 0; i < 6; i++) { int tx = x + dx[i]; int ty = y + dy[i]; if (tx < 0 || tx >= n) continue; if (ty < 0 || ty >= n) continue; if (dis[tx][ty] > dis[x][y] + 1) { dis[tx][ty] = dis[x][y] + 1; q.push({ tx, ty }); flag[tx][ty] = i; } } } if (dis[bx][by] == 0x3f3f3f3f) { puts("Impossible"); return 0; } int x = bx, y = by; vector ans; while (x != ax || y != ay) { int o = flag[x][y]; ans.push_back(vs[o]); x -= dx[o]; y -= dy[o]; } reverse(ans.begin(), ans.end()); cout << ans.size() << endl; for (auto &s : ans) cout << s << ' '; return 0; }