#include #define xx second.first #define yy second.second #define pre first #define MP make_pair using namespace std; typedef long long LL; typedef unsigned long long u64; template inline bool cmin(T & a, const T & b) { return a > b ? a = b, 1 : 0;} template inline bool cmax(T & a, const T & b) { return a < b ? a = b, 1 : 0;} int read() { int x = 0, f = 1;char ch; for(ch = getchar(); !isdigit(ch); ch = getchar()) if(ch == '-') f = -1; for(; isdigit(ch); x = x * 10 + ch - '0', ch = getchar()); return x * f; } #define y1 shj int n, x1, y1, x2, y2, pr[233][233]; int vis[233][233]; queue > > q; int dx[] = {2, -2, 0, -2, 2, 0}; int dy[] = {1, 1, 2, -1, -1, -2}; string name[] = {"LR", "UR", "R", "UL", "LL", "L"}; int p[] = {3, 1, 2, 0, 4, 5}; void print(int x2, int y2) { if(x2 == x1 && y2 == y1) return; print(x2 - dx[pr[x2][y2]], y2 - dy[pr[x2][y2]]); cout << name[pr[x2][y2]] << " "; } int main() { int i; cin >> n >> x1 >> y1 >> x2 >> y2; vis[x1][y1] = 1; q.push(MP(-1, MP(x1, y1))); while(!q.empty()) { pair > c = q.front(); q.pop(); for(int _i = 0; _i < 6; _i++) { int i = p[_i]; int nx = c.xx + dx[i]; int ny = c.yy + dy[i]; if(nx >= 0 && nx < n && ny >= 0 && ny < n && !vis[nx][ny]) { q.push(MP(i, MP(nx, ny))); vis[nx][ny] = vis[c.xx][c.yy] + 1; pr[nx][ny] = i; } } } if(!vis[x2][y2]) return puts("Impossible"), 0; cout << vis[x2][y2] - 1 << endl; print(x2, y2); return 0; }