#include using namespace std; #define F first #define S second #define mp make_pair #define pb push_back #define MAXN 101010 typedef long long int ll; int dx[]={-2, -2, 0, 2, 2, 0}; int dy[]={-1, 1, 2, 1,-1,-2}; char vis[250][250]; string str[]={"UL", "UR", "R", "LR", "LL", "L"}; int n; struct state{ int qtd, x, y; vector path; state(){} state(int a, int b, int c){ qtd = a; x = b; y = c; path.clear(); } }; bool pode(int x, int y){ return x>=0 && x=0 && y q; q.push(state(0, xi, yi)); int x, y, qtd; vector nw; state s; state aux; while (!q.empty()) { s = q.front(); q.pop(); x = s.x; y = s.y; if(x == xf && y == yf){ cout << s.path.size() << "\n"; for (int i = 0; i < s.path.size(); i++) { if(i > 0) cout << " "; cout << s.path[i]; } cout << "\n"; return; } if(vis[x][y]) continue; vis[x][y] = 1; aux = s; aux.qtd++; for (int i = 0; i < 6; i++) { if(pode(x+dx[i], y+dy[i])){ aux.path.pb(str[i]); aux.x = x+dx[i]; aux.y = y+dy[i]; q.push(aux); aux.path.pop_back(); } } } cout << "Impossible\n"; } int main(){ ios_base::sync_with_stdio(0); cin.tie(0); int a, b, c, d; cin >> n; cin >> a >> b >> c >> d; solve(a, b, c, d); return 0; }