#include using namespace std; const int dcol[] = {-1, 1, 2, 1, -1, -2}; const int drow[] = {-2, -2, 0, 2, 2, 0}; const string types[] = {"UL", "UR", "R", "LR", "LL", "L"}; int n; const int MAXN = 205; const int INF = 2000000010; const int DIRECTIONS = 6; int dist[MAXN][MAXN]; int how[MAXN][MAXN]; bool valid(int row, int col){ return row >= 1 && row <= n && col >= 1 && col <= n; } void bfs(int start_row, int start_col){ for(int i = 1; i <= n; i++){ for(int j = 1; j <= n; j++){ if(i == start_row && j == start_col) dist[i][j] = 0; else dist[i][j] = INF; } } queue qrow, qcol; qrow.push(start_row); qcol.push(start_col); while(!qrow.empty()){ int crow = qrow.front(); qrow.pop(); int ccol = qcol.front(); qcol.pop(); for(int direction = 0; direction < DIRECTIONS; direction++){ int nrow = crow + drow[direction]; int ncol = ccol + dcol[direction]; if(!valid(nrow, ncol)) continue; if(dist[nrow][ncol] != INF) continue; dist[nrow][ncol] = dist[crow][ccol] + 1; how[nrow][ncol] = direction; qrow.push(nrow); qcol.push(ncol); } } } int main(){ scanf("%d", &n); int row_start, col_start, row_end, col_end; scanf("%d %d %d %d", &row_start, &col_start, &row_end, &col_end); row_start++, col_start++, row_end++, col_end++; bfs(row_start, col_start); if(dist[row_end][col_end] == INF){ puts("Impossible"); return 0; } vector ans_indices; int ans = dist[row_end][col_end]; //printf("%d\n", ans); while(!(row_start == row_end && col_start == col_end)){ int direction = how[row_end][col_end]; ans_indices.push_back(direction); row_end -= drow[direction]; col_end -= dcol[direction]; } assert(ans_indices.size() == ans); printf("%d\n", ans); reverse(ans_indices.begin(), ans_indices.end()); for(auto x : ans_indices) cout << types[x] << " "; cout << endl; return 0; }