#include using namespace std; #define ll long long #define ull unsigned long long #define ld long double #define fi first #define se second #define pb push_back #define mp make_pair #define sz(a) int(a.size()) #define all(v) v.begin(), v.end() #define bpc(v) __builtin_popcountll(v) #define IOS ios_base :: sync_with_stdio(false); cin.tie(NULL); #define sc scanf #define pr printf #define itr iterator #define ioi(i, a, b) for (int i = a; i <= b; ++i) #define IOI(i, a, b) for (int i = a; i >= b; --i) #define ub upper_bound #define lb lower_bound const int N = 2e2 + 5; const int inf = 1e9 + 1; const int mod = 1e9 + 9; const double eps = 1e-15; const int pw = 257; int d1[] = {-2, -2, 0, 2, 2, 0}; int d2[] = {-1, 1, 2, 1, -1, -2}; string s[] = {"UL", "UR", "R", "LR", "LL", "L"}; vector v; int d[N][N], n, p[N][N]; bool check(int x, int y) { if (x >= 0 && y >= 0 && x < n && y < n) return 1; return 0; } int main() { #ifdef Madi freopen(".in", "r", stdin); //freopen(".out", "w", stdout); #endif IOS cin >> n; for (int i = 0; i < n; ++i) for (int j = 0; j < n; ++j) d[i][j] = -1; int sx, sy; cin >> sx >> sy; int fx, fy; cin >> fx >> fy; queue > q; q.push({sx, sy}); d[sx][sy] = 0; while (!q.empty()) { int curx = q.front().fi , cury = q.front().se; q.pop(); for (int i = 0; i < 6; ++i) { if (check(curx + d1[i], cury + d2[i]) && d[curx + d1[i]][cury + d2[i]] == -1) { q.push({curx + d1[i], cury + d2[i]}); d[curx + d1[i]][cury + d2[i]] = d[curx][cury] + 1; p[curx + d1[i]][cury + d2[i]] = i; } } } if (d[fx][fy] == -1) return cout << "Impossible", 0; cout << d[fx][fy] << "\n"; while (fx != sx || fy != sy) { v.pb(s[p[fx][fy]]); int X = d1[p[fx][fy]], Y = d2[p[fx][fy]]; fx -= X, fy -= Y; } reverse(all(v)); for (int i = 0; i < sz(v); ++i) cout << v[i] << ' '; return 0; }