#include using namespace std; const int MAXN = 200; int mat[MAXN + 1][MAXN + 1]; int dl[] = {-2, -2, 0, 2, 2, 0}, dc[] = {-1, 1, 2, 1, -1, -2}; pair q[MAXN * MAXN + 1]; int from[MAXN + 1][MAXN + 1]; vector sol; int main() { int n, l1, c1, l2, c2, i; cin >> n >> l1 >> c1 >> l2 >> c2; l1++; c1++; l2++; c2++; int b = 0, e = 1; q[0] = {l1, c1}; mat[l1][c1] = 1; while(b < e) { for(i = 0; i < 6; i++) { int l = q[b].first + dl[i]; int c = q[b].second + dc[i]; if(l > 0 && l <= n && c > 0 && c <= n && mat[l][c] == 0) { q[e++] = {l, c}; from[l][c] = i; mat[l][c] = mat[q[b].first][q[b].second] + 1; } } b++; } if(mat[l2][c2] == 0) { cout << "Impossible"; return 0; } else { cout << mat[l2][c2] - 1 << endl; int l = l2; int c = c2; while(!(l == l1 && c == c1)) { int auxl = l - dl[from[l][c]]; int auxc = c - dc[from[l][c]]; int x = from[l][c]; sol.push_back(x); l = auxl; c = auxc; } for(i = sol.size() - 1; i >= 0; i--) { int x = sol[i]; if(x == 0) { cout << "UL"; } if(x == 1) { cout << "UR"; } if(x == 2) { cout << "R"; } if(x == 3) { cout << "LR"; } if(x == 4) { cout << "LL"; } if(x == 5) { cout << "L"; } cout << " "; } } return 0; }