#include #define pb push_back #define mp make_pair #define fi first #define se second #define eb emplace_back #define mt make_tuple using namespace std; typedef long long ll; typedef pair ii; const int N = 210; int dir[6][2] = {{-2, -1}, {-2, 1}, {0, 2}, {2, 1}, {2, -1}, {0, -2}}; char dirname[6][3] = {"UL", "UR", "R", "LR", "LL", "L"}; int prv[N][N]; int main() { int n, is, js, ie, je; scanf("%d %d %d %d %d", &n, &is, &js, &ie, &je); memset(prv, -1, sizeof(prv)); prv[is][js] = -2; queue q; q.push(ii(is, js)); while (!q.empty()) { int ci = q.front().fi; int cj = q.front().se; q.pop(); if (ci == ie and cj == je) break; for (int d = 0; d < 6; d++) { int ai = ci + dir[d][0]; int aj = cj + dir[d][1]; if (ai >= 0 and ai < n and aj >= 0 and aj < n and prv[ai][aj] == -1) { prv[ai][aj] = d; q.push(ii(ai, aj)); } } } if (prv[ie][je] == -1) { printf("Impossible\n"); return 0; } vector ans; int ci = ie, cj = je; while (ci != is or cj != js) { int d = prv[ci][cj]; ans.pb(d); ci -= dir[d][0]; cj -= dir[d][1]; } reverse(ans.begin(), ans.end()); printf("%d\n", (int)ans.size()); for (int i = 0; i < ans.size(); i++) { printf("%s%c", dirname[ans[i]], " \n"[i == ans.size()-1]); } return 0; }