#include #define F first #define S second #define mp make_pair #define pb push_back #define sz(x) (int)x.size() #define all(x) x.begin(), x.end() #define y1 y_left #define x1 LLOLOLO #define y2 kek_lol #define x2 lol_kek using namespace std; typedef long long ll; typedef long double ld; typedef unsigned long long ull; const int N = 2e5 + 123; const int inf = 1e9 + 1; const int mod = 1e9 + 7; const ll infl = 3e18 + 1; const double pi = acos(-1.0); inline void boost () { ios_base::sync_with_stdio (0); cin.tie (0); cout.tie (0); } inline void SmartRandom228 () { unsigned int key; asm ("rdtsc" : "=A"(key)); srand (key); } pair < int , int > D[] = {{-2, -1}, {-2, 1}, {0, 2}, {2, 1}, {2, -1}, {0, -2}}; int n, d[205][205]; int x1, y1, x2, y2; queue < pair < int , int > > q; bool used[205][205]; bool is (int x, int y) { return (x >= 0 && y >= 0 && x < n && y < n); } string ans[205][205]; pair < int , int > pr[205][205]; string kek[] = {"UL", "UR", "R", "LR", "LL", "L"}; map < string , int > pos; string get (int i) { return kek[i]; } int main () { boost (); for (int i = 0;i < 6;i ++) pos[kek[i]] = i; pos[""] = -1; cin >> n >> x1 >> y1 >> x2 >> y2; if (abs (x1 - x2) % 2) return cout << "Impossible", 0; for (int i = 0;i <= n;i ++) for (int j = 0;j <= n;j ++) d[i][j] = inf + inf, pr[i][j] = mp (-69, -69); q.push (mp (x1, y1)); d[x1][y1] = 0; while (!q.empty ()) { pair < int , int > v = q.front (); q.pop (); used[v.F][v.S] = 1; if (v.F == x2 && v.S == y2) break; for (int i = 0;i < 6;i ++) { int nx = v.F + D[i].F; int ny = v.S + D[i].S; if (!is (nx, ny) ) continue; if (d[v.F][v.S] + 1 == d[nx][ny]) { if (pos[kek[i]] < pos[ans[nx][ny]]) { pr[nx][ny] = mp (v.F, v.S); ans[nx][ny] = kek[i]; q.push (mp (nx, ny)); } } if (d[v.F][v.S] + 1 < d[nx][ny]) { d[nx][ny] = d[v.F][v.S] + 1; pr[nx][ny] = mp (v.F, v.S); ans[nx][ny] = get (i); q.push (mp (nx, ny)); } } } if (d[x2][y2] == inf + inf) cout << "Impossible"; else { //cout << d[x2][y2] << endl; pair < int , int > cur = mp (x2, y2), prev = mp (x2, y2); vector < string > res[7]; int xx = x2, yy = y2; while (1) { if (ans[cur.F][cur.S] == "UL") res[0].pb ("UL"); if (ans[cur.F][cur.S] == "UR") res[1].pb ("UR"); if (ans[cur.F][cur.S] == "R") res[2].pb ("R"); if (ans[cur.F][cur.S] == "LR") res[3].pb ("LR"); if (ans[cur.F][cur.S] == "LL") res[4].pb ("LL"); if (ans[cur.F][cur.S] == "L") res[5].pb ("L"); if (cur.F == x1 && cur.S == y2) break; prev = cur; cur = pr[cur.F][cur.S]; if (cur.F < 0 || cur.S < 0) { if (prev.F != x1 || prev.S != y1) return cout << "Impossible", 0; break; } } //cout << d[x2][y2] << endl; for (int i = 0;i < 6;i ++) for (auto it : res[i]) if (it == kek[i]) { //cout << it << ' '; x1 += D[pos[it]].F; y1 += D[pos[it]].S; } if (xx != x1 || yy != y1) return cout << "Impossible", 0; cout << d[xx][yy] << endl; for (int i = 0;i < 6;i ++) for (auto it : res[i]) if (it == kek[i]) cout << it << ' '; } return 0; }