#include #define IOS std::ios_base::sync_with_stdio(false); std::cin.tie(0); std::cout.tie(0); #define forn(i, n) for(int i = 0; i < int(n); ++i) #define forin(i, n) for(int i = n-1; i >= 0; --i) #define forab(i, a, b) for(int i = a; i < int(b); ++i) #define sz(x) ((ll) (x).size()) #define all(x) (x).begin(), (x).end() #define PI 2*acos(0.0) #define LSOne(S) (S & (-S)) using namespace std; typedef long long ll; typedef vector vi; typedef pair ii; typedef vector vii; int dx[6] = { -1, 1, 2, 1, -1, -2 }; int dy[6] = { -2, -2, 0, 2, 2, 0 }; string mov[6] = {"UL", "UR", "R", "LR", "LL", "L"}; bool vis[300][300]; ii pad[300][300]; int dpm[300][300]; int main() { memset(dpm, -1, sizeof dpm); int n; cin >> n; int sx, sy, fx, fy; cin >> sy >> sx >> fy >> fx; queue q; q.emplace(sx, sy); vis[sy][sx] = 1; while(!q.empty()) { int tx, ty; tie(tx, ty) = q.front(); q.pop(); // if(vis[ty][tx]) continue; for(int i = 0; i < 6; i++) { int tarx = tx+dx[i]; int tary = ty+dy[i]; if(tarx < 0 || tarx >= n || tary < 0 || tary >= n) continue; if(vis[tary][tarx]) continue; vis[tary][tarx] = 1; pad[tary][tarx] = ii(tx,ty); dpm[tary][tarx] = i; q.emplace(tarx, tary); } } if(dpm[fy][fx] == -1) { cout << "Impossible" << endl; return 0; } vector ans; while(fy != sy || fx != sx) { ans.push_back(dpm[fy][fx]); ii t = pad[fy][fx]; fy = t.second; fx = t.first; } reverse(ans.begin(), ans.end()); cout << ans.size() << endl; for(int i = 0; i < ans.size(); i++) { if(i) cout << " "; cout << mov[ans[i]]; } cout << endl; return 0; }