#include using namespace std; typedef pair pii; int d[205][205], lst[205][205]; const int cx[] = {-2, -2, +0, +2, +2, +0}; const int cy[] = {-1, +1, +2, +1, -1, -2}; const string cs[] = {"UL", "UR", "R", "LR", "LL", "L"}; void printShortestPath(int n, int i_start, int j_start, int i_end, int j_end) { queue q; q.push({i_start, j_start}); d[i_start][j_start] = 1; lst[i_start][j_start] = -1; while(!q.empty()) { int x = q.front().first; int y = q.front().second; q.pop(); for(int i = 0; i < 6; i++) { int nx = x + cx[i]; int ny = y + cy[i]; if(nx < 0 || ny < 0 || nx >= n || ny >= n) continue; if(d[nx][ny]) continue; d[nx][ny] = 1; lst[nx][ny] = i; q.push({nx, ny}); } } int x = i_end, y = j_end; if(d[x][y] == 0) { cout << "Impossible\n"; exit(0); } vector ans; while(lst[x][y] != -1) { ans.push_back(cs[ lst[x][y] ]); int nx = x - cx[ lst[x][y] ]; int ny = y - cy[ lst[x][y] ]; x = nx, y = ny; } reverse(ans.begin(), ans.end()); printf("%d\n", ans.size()); for(auto x: ans) printf("%s ", x.c_str()); } int main() { int n; cin >> n; int i_start; int j_start; int i_end; int j_end; cin >> i_start >> j_start >> i_end >> j_end; printShortestPath(n, i_start, j_start, i_end, j_end); return 0; }