#include using namespace std; typedef vector vi; typedef pair ii; const int INF = 20000000; int aux_r[6] = {-2, -2, 0, +2, +2, 0}; int aux_c[6] = {-1, +1, +2, +1, -1, -2}; int dis[205][205]; int par[205][205]; int n; int r,c,x,y; void bfs() { queue q; dis[r][c] = 0; par[r][c] = -1; q.push(ii(r,c)); while(!q.empty()) { int pr = q.front().first; int pc = q.front().second; q.pop(); for(int k = 0; k < 6; k++) { int nr = pr + aux_r[k]; int nc = pc + aux_c[k]; if(nr >= 0 && nr < n && nc >= 0 && nc < n && dis[nr][nc] == INF) { dis[nr][nc] = dis[pr][pc] + 1; par[nr][nc] = k; q.push(ii(nr,nc)); } } } } void print(int x, int y, bool first) { if(par[x][y] == -1) return; int val = par[x][y]; int nx = x, ny = y; string ans = ""; int aux_r[6] = {-2, -2, 0, +2, +2, 0}; int aux_c[6] = {-1, +1, +2, +1, -1, -2}; switch(val) { case 0: nx += 2; ny += 1; ans = "UL"; break; case 1: nx += 2; ny -= 1; ans = "UR"; break; case 2: nx += 0; ny -= 2; ans = "R"; break; case 3: nx -= 2; ny -= 1; ans = "LR"; break; case 4: nx -= 2; ny += 1; ans = "LL"; break; case 5: nx += 0; ny += 2; ans = "L"; break; } print(nx,ny,false); cout << ans; if(!first) cout << " "; } int main() { ios_base::sync_with_stdio(false); cin.tie(0); while(cin >> n) { cin >> r >> c >> x >> y; for(int i = 0; i < n; i++) for(int j = 0; j < n; j++) dis[i][j] = INF; bfs(); if(dis[x][y] == INF) cout << "Impossible" << '\n'; else { cout << dis[x][y] << '\n'; print(x, y, true); cout << '\n'; } } return 0; }