#include using namespace std; const int dx[] = {-2, -2, 0, 2, 2, 0}; const int dy[] = {-1, 1, 2, 1, -1, -2}; const string dirs[] = {"UL", "UR", "R", "LR", "LL", "L"}; int a[205][205]; int main() { #ifdef LOCAL freopen("a.in", "r", stdin); freopen("a.out", "w", stdout); #endif cin.tie(0); ios_base::sync_with_stdio(false); int n; cin >> n; int xs, ys, xf, yf; cin >> xs >> ys >> xf >> yf; queue< pair > que; que.push({xs, ys}); a[xs][ys] = -1; bool found = false; while (!que.empty() && !found) { int x, y; tie(x, y) = que.front(); que.pop(); for (int d = 0; d < 6; ++d) { int nx = x + dx[d]; int ny = y + dy[d]; if (nx < 0 || nx >= n || ny < 0 || ny >= n || a[nx][ny] != 0) continue; a[nx][ny] = d + 1; que.push({nx, ny}); } } if (a[xf][yf] == 0) { cout << "Impossible\n"; } else { vector< int > sol; int x, y; x = xf, y = yf; while (x != xs || y != ys) { sol.push_back(a[x][y] - 1); int nx = x - dx[a[x][y] - 1]; int ny = y - dy[a[x][y] - 1]; x = nx, y = ny; } reverse(sol.begin(), sol.end()); cout << sol.size() << endl; for (int it : sol) cout << dirs[it] << ' '; cout << endl; } } //Trust me, I'm the Doctor!