#include #define fi first #define se second #define y0 fff #define y1 kkk using namespace std; const int N = 200; typedef pair ii; const ii MOVE[] = {ii(-2,-1), ii(-2,1), ii(0,2), ii(2,1), ii(2,-1), ii(0,-2)}; const string NAME[] = {"UL", "UR", "R", "LR", "LL", "L"}; int n,x0,y0,x1,y1,trc[N][N]; int main() { cin >> n >> x0 >> y0 >> x1 >> y1; memset(trc,-1,sizeof(trc)); trc[x0][y0] = -2; queue que; for(que.push(ii(x0,y0)); !que.empty() && trc[x1][y1]==-1; que.pop()) { int x = que.front().fi; int y = que.front().se; for(int i=0; i<6; ++i) { int xx = x+MOVE[i].fi; int yy = y+MOVE[i].se; if (xx<0 || yy<0 || xx>=n || yy>=n || trc[xx][yy]!=-1) continue; trc[xx][yy] = i; que.push(ii(xx,yy)); } } if (trc[x1][y1]==-1) cout << "Impossible"; else { stack stk; while (x1!=x0 || y1!=y0) { int p = trc[x1][y1]; stk.push(p); x1 -= MOVE[p].fi; y1 -= MOVE[p].se; } cout << stk.size() << endl; for(;!stk.empty(); stk.pop()) cout << NAME[stk.top()] << ' '; } }