#include using namespace std; int dirx[6] = {-2, -2, 0, 2, 2, 0}; int diry[6] = {-1, 1, 2, 1, -1, -2}; string result[6] = {"UL", "UR", "R", "LR", "LL", "L"}; const int N = 220; int a, b, c, d; int n; int path[N][N]; int preDirect[N][N]; pair < int, int > pre[N][N]; void trace(int u, int v){ if(u == a && v == b) return; trace(pre[u][v].first, pre[u][v].second); cout << result[preDirect[u][v]] << " "; } int main(){ if(fopen("1.inp", "r")){ freopen("1.inp", "r", stdin); } cin >> n; cin >> a >> b >> c >> d; memset(path, 60, sizeof path); path[a][b] = 0; queue < pair < int, int > > bfs; bfs.emplace(a, b); while(!bfs.empty()){ auto p = bfs.front(); bfs.pop(); for(int d = 0; d < 6; ++d){ int x = p.first + dirx[d]; int y = p.second + diry[d]; if(x < 0 || x >= n) continue; if(y < 0 || y >= n) continue; if(path[x][y] != path[n][n]) continue; path[x][y] = path[p.first][p.second] + 1; pre[x][y] = p; preDirect[x][y] = d; bfs.emplace(x, y); } } if(path[c][d] == path[n][n]) cout << "Impossible"; else{ cout << path[c][d] << endl; trace(c, d); } return 0; }