#include using namespace std; typedef long long ll; typedef vector vi; typedef pair ii; #define pb push_back #define all(x) x.begin(),x.end() #define sz(x) (int)x.size() #define fill(a,x) memset(a,x,sizeof(a)) #define F first #define S second #define FOR(i,a,b) for(int i = a; i<=b; ++i) #define NFOR(i,a,b) for(int i = a; i>=b; --i) #define fast ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0) const ll INF = 1e18; const int mod = 1e9+7; const int N = 1e5 + 10; inline int add(int x,int y){ x += y; if(x >= mod) x -= mod; return x; } inline int mul(int x,int y){ x = (1LL * x * y) % mod; return x; } int dist[210][210]; ii last[210][210]; ii f(ii x,string s){ if(s == "UL"){ return {x.F - 2, x.S - 1}; } if(s == "UR"){ return {x.F - 2, x.S + 1}; } if(s == "R"){ return {x.F, x.S + 2}; } if(s == "LR"){ return {x.F + 2, x.S + 1}; } if(s == "LL"){ return {x.F + 2, x.S - 1}; } return {x.F, x.S - 2}; } int main(){ fast; int n;cin >> n; int stx,sty;cin >> stx >> sty;stx += 1;sty += 1; FOR(i,1,n){ FOR(j,1,n){ dist[i][j] = 2e9; } } dist[stx][sty] = 0; queue q; q.push({stx,sty}); string mov[6] = {"UL", "UR", "R", "LR", "LL", "L"}; while(sz(q)){ auto fr = q.front(); //cout << fr.F << " " << fr.S << "\n"; q.pop(); for(auto it : mov){ auto itt = f(fr, it); if(itt.F <= n and itt.F >= 1){ if(itt.S <= n and itt.S >= 1){ if(dist[itt.F][itt.S] > dist[fr.F][fr.S] + 1){ last[itt.F][itt.S] = fr; dist[itt.F][itt.S] = dist[fr.F][fr.S] + 1; q.push(itt); } } } } } int dstx,dsty;cin >> dstx >> dsty; dstx += 1; dsty += 1; int ans = dist[dstx][dsty]; if(ans == 2e9){ cout << "Impossible\n"; return 0; } cout << ans << "\n"; vector fans; while(dstx != stx or dsty != sty){ auto lst = last[dstx][dsty]; //cout << lst.F << " " << lst.S << "\n"; for(auto it : mov){ ii dst = {dstx, dsty}; if(dst == f(lst, it)){ fans.pb(it); break; } } dsty = lst.S; dstx = lst.F; } reverse(all(fans)); for(auto it : fans){ cout << it << " "; } return 0; }