#include "bits/stdc++.h" using namespace std; int n; int X1, Y1, X2, Y2; int d[205][205]; int bd[205][205]; int dx[6] = {-2, -2, 0, 2, 2, 0}; int dy[6] = {-1, 1, 2, 1, -1, -2}; string moves[6] = {"UL", "UR", "R", "LR", "LL", "L"}; int valid(int x, int y) { if((x >= 1 && x <= n) && (y >= 1 && y <= n)) return 1; return 0; } int main() { scanf("%d", &n); scanf("%d %d %d %d", &X1, &Y1, &X2, &Y2); X1++, Y1++, X2++, Y2++; for(int i = 1 ; i <= n ; i++) { for(int j = 1 ; j <= n ; j++) d[i][j] = bd[i][j] = INT_MAX; } queue < pair < int , int > > q; q.push({X1, Y1}); d[X1][Y1] = 0; while(!q.empty()) { pair < int , int > p = q.front(); q.pop(); int x = p.first; int y = p.second; for(int i = 0 ; i < 6 ; i++) { int xx = x + dx[i]; int yy = y + dy[i]; if(valid(xx, yy) && (d[xx][yy] > (d[x][y] + 1))) { d[xx][yy] = d[x][y] + 1; q.push({xx, yy}); } } } q.push({X2, Y2}); bd[X2][Y2] = 0; while(!q.empty()) { pair < int , int > p = q.front(); q.pop(); int x = p.first; int y = p.second; for(int i = 0 ; i < 6 ; i++) { int xx = x + dx[i]; int yy = y + dy[i]; if(valid(xx, yy) && (bd[xx][yy] > (bd[x][y] + 1))) { bd[xx][yy] = bd[x][y] + 1; q.push({xx, yy}); } } } if(d[X2][Y2] == INT_MAX) { printf("Impossible"); return 0; } printf("%d\n", d[X2][Y2]); q.push({X1, Y1}); int fin = d[X2][Y2]; int fwd = 1; while(!q.empty()) { pair < int , int > p = q.front(); q.pop(); int x = p.first; int y = p.second; for(int i = 0 ; i < 6 ; i++) { int xx = x + dx[i]; int yy = y + dy[i]; if(valid(xx, yy) && ((fwd + bd[xx][yy]) == fin)) { q.push({xx, yy}); cout << moves[i] << " "; fwd++; break; } } } return 0; }