#include using namespace std; struct cell { int x, y; string s; cell() {} cell(int x, int y,string s) : x(x), y(y), s(s) {} }; bool isInside(int x, int y, int N) { if (x >= 0 && x < N && y >= 0 && y < N) return true; return false; } string minStepToReachTarget(int knightPos[], int targetPos[],int N) { int dx[] = {-1,1,2,1,-1,-2}; int dy[] = {-2,-2,0,2,2,0}; string path[]={" UL"," UR"," R"," LR"," LL"," L"}; queue q; q.push(cell(knightPos[0], knightPos[1],"")); cell t; int x, y; string s; bool visit[N][N]; for (int i = 0; i < N; i++) for (int j = 0; j < N; j++) visit[i][j] = false; visit[knightPos[0]][knightPos[1]] = true; while (!q.empty()) { t = q.front(); q.pop(); visit[t.x][t.y] = true; if (t.x == targetPos[0] && t.y == targetPos[1]) return (t.s+'P'); for (int i = 0; i < 6; i++) { x = t.x + dx[i]; y = t.y + dy[i]; s=t.s+path[i]; if (isInside(x, y, N) && !visit[x][y]) { q.push(cell(x, y,s)); } } } return "0"; } int main() { int n,knightPos[2],targetPos[2]; cin >> n; int i_start; int j_start; int i_end; int j_end; cin >> j_start >> i_start >> j_end >> i_end; knightPos[0]=i_start,knightPos[1]=j_start,targetPos[0]=i_end,targetPos[1]=j_end; string k=minStepToReachTarget(knightPos, targetPos,n); if(k=="0") { cout<<"Impossible"; } else { string fi=""; int count=0; for(int i=1;;i++) { if(k[i]==' ') { count++; } if(k[i]=='P') break; else { fi=fi+k[i]; } } cout<