// Miroslaw #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long LL; typedef vector VI; #define REP(i,n) for(int i=0;i<(n);i++) #define FOR(i,a,b) for(int i=(a);i<=(b);i++) #define FORD(i,a,b) for(int i=(a);i>=(b);i--) #define FOREACH(i,c) for(__typeof((c).begin())i = (c).begin();i!=(c).end(); ++i) int cond = 1; #define DB(X) {if(cond){cerr<<"Line:"<<__LINE__<<", "<<#X<<" = "<> moves{{-2, -1}, {-2, 1}, {0, 2}, {2, 1}, {2, -1}, {0, -2}}; vector names = {"UL", "UR", "R", "LR", "LL", "L"}; int main() { int n; scanf("%d", &n); int x, y, xx, yy; scanf("%d%d%d%d", &xx, &yy, &x, &y); REP(i, MAXN) REP(j, MAXN) t[i][j] = 1000000000; t[xx][yy] = 0; queue> q; q.push({xx, yy}); while (!q.empty()) { auto wz1 = q.front(); q.pop(); int a = wz1.first, b = wz1.second; for (int i = 0; i < moves.size(); ++i) { int nx = a + moves[i][0], ny = b + moves[i][1]; if (nx >= 0 && nx < n && ny >= 0 && ny < n && t[nx][ny] > t[a][b] + 1) { t[nx][ny] = t[a][b] + 1; ans[nx][ny] = ans[a][b].empty() ? "" : ans[a][b] + " "; ans[nx][ny] += names[i]; q.push({nx, ny}); } } } if (t[x][y] != 1000000000) { printf("%d\n", t[x][y]); printf("%s\n", ans[x][y].c_str()); } else { printf("Impossible\n"); } return 0; }