#include using namespace std; #define ll long long #define f(i, x, n) for(int i = x; i < (int)(n); ++i) int dy[6] = { -1, 1, 2, 1, -1, -2 }, dx[6] = { -2, -2, 0, 2, 2, 0 }, n, vis[201][201]; char out[6][3] = { "UL", "UR", "R", "LR", "LL", "L" }; struct P{ int x, y; P(){} P(int a, int b):x(a), y(b) {} P go(int i) { return P(x + dx[i], y + dy[i]); } bool operator ==(P o) { return x == o.x && y == o.y; } bool operator !=(P o) { return !(*this == o); } bool bad() { return x < 0 || x >= n || y < 0 || y >= n; } void sc() { scanf("%d%d", &x, &y); } void pr() { printf("%d %d\n", x, y); } }; int main(){ scanf("%d", &n); P st, ed; st.sc(); ed.sc(); queue > q; vis[st.x][st.y] = -1; q.push(make_pair(0, st)); bool ok = false; while (!q.empty()){ int d = q.front().first; P p = q.front().second; q.pop(); if (p == ed){ printf("%d\n", d); ok = true; break; } f(i, 0, 6){ P z = p.go(i); if (vis[z.x][z.y] || z.bad())continue; vis[z.x][z.y] = i + 1; q.push(make_pair(d + 1, z)); } } if (!ok) { printf("Impossible\n"); return 0; } stack s; while (ed != st){ s.push(vis[ed.x][ed.y] - 1); ed = ed.go((vis[ed.x][ed.y] + 2) % 6); } while (true){ printf("%s", out[s.top()]); s.pop(); if (s.empty())break; else printf(" "); } printf("\n"); }