#include using namespace std; typedef long long LL; typedef pair pii; const int di[] = {-2,-2,0,2,2,0}; const int dj[] = {-1,1,2,1,-1,-2}; const char mes[][10] = {"UL","UR","R","LR","LL","L"}; const int N = 205; int iu, ju, iv, jv; int f[N][N], tr[N][N]; void truy(int i, int j) { if (f[i][j] == 1) return; int t = tr[i][j]; truy(i-di[t],j-dj[t]); printf("%s ", mes[t]); } void solve() { int n; scanf("%d", &n); scanf("%d%d%d%d", &iu, &ju, &iv, &jv); f[iu][ju] = 1; queue q; q.push(make_pair(iu,ju)); while (!q.empty()) { auto p = q.front(); q.pop(); for (int i = 0; i < 6; i++) { int ii = p.first + di[i]; int jj = p.second + dj[i]; if (ii < 0 || ii >= n || jj < 0 || jj >= n) continue; if (f[ii][jj] > 0) continue; f[ii][jj] = f[p.first][p.second] + 1; tr[ii][jj] = i; q.push(make_pair(ii,jj)); } } if (f[iv][jv] == 0) { puts("Impossible"); return; } printf("%d\n", f[iv][jv] - 1); truy(iv,jv); } int main() { int ct; ct = 1; while (ct--) solve(); }