#include using namespace std; int main() { vector moveNames = {"UL", "UR", "R", "LR", "LL", "L"}; int n; cin >> n; int i_start; int j_start; int i_end; int j_end; cin >> i_start >> j_start >> i_end >> j_end; vector parent(n * n, -1); vector edgeToParent(n * n); vector dx = {-1, 1, 2, 1, -1, -2}; vector dy = {-2, -2, 0, 2, 2, 0}; vector visited(n * n, false); list q; q.push_back(i_start * n + j_start); visited[i_start * n + j_start] = true; while (!q.empty()) { int cur = q.front(); q.pop_front(); int curi = cur / n; int curj = cur % n; for (int i = 0; i < 6; ++i) { if ( (curj + dx[i] >= 0) && (curj + dx[i] < n) && (curi + dy[i] >= 0) && (curi + dy[i] < n) && !visited[(curi + dy[i]) * n + curj + dx[i]]) { visited[(curi + dy[i]) * n + curj + dx[i]] = true; q.push_back((curi + dy[i]) * n + curj + dx[i]); parent[(curi + dy[i]) * n + curj + dx[i]] = cur; edgeToParent[(curi + dy[i]) * n + curj + dx[i]] = i; } } } if (parent[i_end * n + j_end] == -1) { cout << "Impossible"; } else { list moves; int cur = i_end * n + j_end; do { moves.push_front(moveNames[edgeToParent[cur]]); cur = parent[cur]; } while (parent[cur] != -1); cout << moves.size() << "\n"; for (auto it = moves.begin(); it != moves.end(); ++it) { cout << *it << " "; } } return 0; }