#include using namespace std; const int N = 202; int n, d[N][N], sx, sy, gx, gy; int dx[] = {-2,-2, 0, 2, 2, 0}; int dy[] = {-1, 1, 2, 1,-1,-2}; string moves[] = {"UL", "UR", "R", "LR", "LL", "L"}; int main() { cin >> n >> sx >> sy >> gx >> gy; queue> cands; cands.push({gx, gy}); d[gx][gy] = 1; while (!cands.empty()) { int x = cands.front().first; int y = cands.front().second; cands.pop(); for (int k = 0; k < 6; ++k) { int i = x + dx[k]; int j = y + dy[k]; if (i >= 0 && i < n && j >= 0 && j < n && d[i][j] == 0) { d[i][j] = d[x][y] + 1; cands.push({i, j}); } } } if (d[sx][sy] == 0) { cout << "Impossible" << "\n"; } else { cout << d[sx][sy] - 1 << "\n"; int x = sx, y = sy, z = d[sx][sy]; while (z > 1) { for (int k = 0; k < 6; ++k) { int i = x + dx[k]; int j = y + dy[k]; if (d[i][j] + 1 == z) { x = i, y = j, z = d[i][j]; cout << moves[k] << " "; break; } } } } }