#include using namespace std; string how[301][301]; pair pr[301][301]; queue > q; int u[301][301]; int dx[] = {-2, -2, 0, 2, 2, 0}; int dy[] = {-1, 1, 2, 1, -1, -2}; int n; string used[11]; bool check (int x, int y) { if (x >= 0 && x < n && y >= 0 && y < n) return 1; else return 0; } int main () { cin >> n; int si, sj, fi, fj; cin >> si >> sj >> fi >> fj; used[0] = "UL"; used[1] = "UR"; used[2] = "R"; used[3] = "LR"; used[4] = "LL"; used[5] = "L"; for (int i = 0;i <= n;i ++) for (int j = 0;j <= n;j ++) pr[i][j] = make_pair (-1, -1); q.push (make_pair (si, sj)); u[si][sj] = 1; while (!q.empty ()) { pair cur = q.front (); int i = cur.first; int j = cur.second; if (i == fi && j == fj) { vector ans; while (i != -1 && j != -1) { ans.push_back (how[i][j]); pair qwe = pr[i][j]; i = qwe.first; j = qwe.second; } reverse (ans.begin (), ans.end ()); cout << ans.size () - 1 << endl; int id = 0; for (auto to : ans) { if (id != 0) cout << to << ' '; id ++; } exit (0); } q.pop (); for (int k = 0;k < 6;k ++) { int nxti = i + dx[k]; int nxtj = j + dy[k]; if (!check (nxti, nxtj) || u[nxti][nxtj]) continue; u[nxti][nxtj] = 1; q.push (make_pair (nxti, nxtj)); how[nxti][nxtj] = used[k]; pr[nxti][nxtj] = make_pair (i, j); } } cout << "Impossible"; return 0; }