#include #include #include #include #include #include #include using namespace std; typedef pair pii; const int INF = 1e9, N = 205; int a[N][N]; string b[N][N]; pii opts[] = {{-2,-1},{-2,1},{0,2},{2,1},{2,-1},{0,-2}}; string path[] = {"UL","UR","R","LR","LL","L"}; struct tpl { int x,y,dist; string path; }; int n,x,y,p,q; void printShortestPath(int x,int y,int p,int q) { queue Q; Q.push({x,y,0,""}); while(!Q.empty()) { tpl _tpl = Q.front(); Q.pop(); int _x = _tpl.x, _y = _tpl.y; if(_x < 0 || _y < 0 || _x >= n || _y >= n || a[_x][_y] <= _tpl.dist) continue; a[_x][_y] = _tpl.dist; b[_x][_y] = _tpl.path; for(int i=0;i<6;i++) { Q.push({_x+opts[i].first,_y+opts[i].second,_tpl.dist+1,_tpl.path+path[i]+" "}); } } if(a[p][q] == INF) { cout << "Impossible"; } else { cout << a[p][q] << endl; cout << b[p][q]; } } int main() { for(int i=0;i> n; cin >> x >> y >> p >> q; printShortestPath(x,y,p,q); return 0; }