#include using namespace std; void printShortestPath(int n, int y1, int x1, int y2, int x2) { if(x1==x2 && y1==y2){ cout << 0; return; } int a[n][n]; int b[n][n]; for(int i=0;i=0 && a[y][x-2]==0){ a[y][x-2] = step+1; ch = true; } if(y+2=0 && a[y+2][x-1]==0){ a[y+2][x-1] = step+1; ch = true; } if(y-2>=0 && x+1=0 && x-1>=0 && a[y-2][x-1]==0){ a[y-2][x-1] = step+1; ch = true; } } if(b[y][x]==step){ if(x+2=0 && b[y][x-2]==0){ b[y][x-2] = step+1; ch = true; } if(y+2=0 && b[y+2][x-1]==0){ b[y+2][x-1] = step+1; ch = true; } if(y-2>=0 && x+1=0 && x-1>=0 && b[y-2][x-1]==0){ b[y-2][x-1] = step+1; ch = true; } } } if(a[y2][x2]>0 && b[y1][x1]>0){ int x = x1; int y = y1; int s1 = 2; int s2 = step; cout<=0 && x-1>=0 && a[y-2][x-1]==s1 && b[y-2][x-1]==s2){ cout<<"UL "; y -= 2; x -= 1; } else if(y-2>=0 && x+1=0 && a[y+2][x-1]==s1 && b[y+2][x-1]==s2){ cout<<"LL "; y += 2; x -= 1; } else if(x-2>=0 && a[y][x-2]==s1 && b[y][x-2]==s2){ cout<<"L "; x -= 2; } if(x==x2 && y==y2){ return; } s1++; s2--; } } step++; } cout<<"Impossible"; } 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; }