#include using namespace std; #define REP(i, n) for (int i = 0; i < int(n); ++i) #define REPE(i, a, b) for (int i = (a); i <= int(b); ++i) #define SZ(x) ((int)(x).size()) #define ALL(x) x.begin(), x.end() #define PB push_back #define EB emplace_back using LL = long long; using PII = pair; #define F first #define S second void R(int &x) { scanf("%d", &x); } void R(LL &x) { scanf("%lld", &x); } void R(double &x) { scanf("%lf", &x); } template void R(T &t) { cin >> t; } template void R(vector &ar) { for (auto &it : ar) R(it); } template void R(T &t, Args &... args) { R(t); R(args...); } const int dx[] = {-2, 0, 2, 2, 0, -2}; const int dy[] = {-1, -2, -1, 1, 2, 1}; string dn[] = {"UL", "L", "LL", "LR", "R", "UR"}; tuple p[222][222]; int d[222][222]; int main() { int n, sx, sy, tx, ty; cin >> n >> sx >> sy >> tx >> ty; memset(d, -1, sizeof d); d[sx][sy] = 0; queue> q; q.emplace(sx, sy); while (q.size()) { int x, y; tie(x, y) = q.front(); q.pop(); REP(ii, 6) { int i = ii == 0 ? ii : 6 - ii; int nx = x + dx[i]; int ny = y + dy[i]; if (nx < 0 || ny < 0 || nx >= n || ny >= n || d[nx][ny] >= 0) { continue; } d[nx][ny] = d[x][y] + 1; p[nx][ny] = {x, y, i}; q.emplace(nx, ny); } } if (d[tx][ty] == -1) { puts("Impossible"); } else { int x = tx, y = ty; vector a; while (x != sx || y != sy) { int dir; tie(x, y, dir) = p[x][y]; a.PB(dir); } reverse(ALL(a)); printf("%d\n", SZ(a)); REP(i, SZ(a)) printf("%s%c", dn[a[i]].c_str(), " \n"[i + 1 == SZ(a)]); } return 0; }