#include using namespace std; const int MAXN = 200; int used[MAXN][MAXN]; int from[MAXN][MAXN]; void solve() { int n; cin >> n; int x0, y0, x1, y1; cin >> x0 >> y0 >> x1 >> y1; queue > q; q.push({x0, y0}); used[x0][y0] = 1; int dx[] = {-2,-2, 0, 2, 2, 0}; int dy[] = {-1, 1, 2, 1, -1, -2}; string moves[] = {"UL", "UR", "R", "LR", "LL", "L"}; while (!q.empty()) { int x = q.front().first, y = q.front().second; q.pop(); for (int k = 0; k < 6; k++) { int nx = x + dx[k], ny = y + dy[k]; if (nx < 0 || nx >= n || ny < 0 || ny >= n || used[nx][ny]) continue; used[nx][ny] = 1; from[nx][ny] = k; q.push({nx, ny}); } } if (!used[x1][y1]) { cout << "Impossible"; return; } vector v; while (x1 != x0 || y1 != y0) { int k = from[x1][y1]; v.push_back(moves[k]); x1 -= dx[k]; y1 -= dy[k]; } cout << v.size() << endl; reverse(v.begin(), v.end()); for (auto val: v) cout << val << " "; } int main() { int t = 1; while (t--) { solve(); cout << endl; } }