#include using namespace std; const int Nmax = 505, inf = 2e9; int A, B, a, b, X, Y, x, y, dist[Nmax][Nmax], n, i, j; int dx[] = {-2, -2, 0, 2, 2, 0}; int dy[] = {-1, 1, 2, 1, -1, -2}; string str[] = {"UL", "UR", "R", "LR", "LL", "L"}; queue< pair > q; int main() { cin >> n >> A >> B >> a >> b; for(i=0; i= n || Y >= n) continue; if(dist[X][Y] != inf) continue; dist[X][Y] = dist[x][y] + 1; q.push({X, Y}); } } if(dist[A][B] == inf) { cout << "Impossible\n"; return 0; } cout << dist[A][B] << '\n'; x = A; y = B; while(dist[x][y]) { for(i=0; i<6; ++i) { X = x + dx[i]; Y = y + dy[i]; if(X < 0 || Y < 0 || X >= n || Y >= n) continue; if(dist[X][Y] != dist[x][y] - 1) continue; cout << str[i] << ' '; break; } x = X; y = Y; } cout << '\n'; return 0; }