#include #include #include #include #include using namespace std; const pair START = {-1, -1}; const int DIR[6][2] = {{-2, -1}, {-2, 1}, {0, 2}, {2, 1}, {2, -1}, {0, -2}}; const int DIRS = 6; const int N = 201; const char DIRDESC[6][3] = {"UL", "UR", "R", "LR", "LL", "L"}; bool vis[N][N]; pair _prev[N][N]; int _move[N][N]; int main() { ios_base::sync_with_stdio(0); int n, bx, by, ex, ey; cin >> n; cin >> bx >> by >> ex >> ey; vis[bx][by] = true; _prev[bx][by] = START; vector> q = {{bx, by}}; int beg = 0; while (beg < q.size() && !vis[ex][ey]) { int x = q[beg].first, y = q[beg].second; beg++; for (int d=0; d= n || ny < 0 || ny >= n || vis[nx][ny]) continue; vis[nx][ny] = true; _prev[nx][ny] = make_pair(x, y); _move[nx][ny] = d; q.emplace_back(nx, ny); } } if (!vis[ex][ey]) { cout << "Impossible\n"; return 0; } pair e = {ex, ey}; vector moves; while (_prev[e.first][e.second] != START) { moves.push_back(_move[e.first][e.second]); e = _prev[e.first][e.second]; } reverse(moves.begin(), moves.end()); cout << moves.size() << "\n"; for (int d: moves) cout << DIRDESC[d] << " "; cout << "\n"; return 0; }