// Bismillahirohmanirohiim #include using namespace std; #define nl "\n" #define PB push_back #define SZ size() #define ios ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL) #define F first #define S second #define satu F.F #define dua F.S #define tiga S.F #define empat S.S.F #define lima S.S.S int n, a,b,aa,bb; void solve() { map < pair,int > um ; priority_queue ,pair > > > q ; q.push({{0,0},{"",{a,b}}});um[make_pair(a,b)]=1; while(!q.empty()) { int cost = q.top().first.first ; int pri = q.top().dua ; string s = q.top().tiga ; int x = q.top().empat ; int y = q.top().lima ; //cout << cost << ' ' << x << ' ' << y << ' '<< s << nl ; q.pop(); if(x==aa and y==bb) { cout << cost*-1 << nl ; cout << s << nl ; return ; } else { if(x>0 and y-1>0 and !um[{x-1,y-2}]) { um[{x-1,y-2}]=1; if(s.length()==0) q.push({{cost-1,-1},{s+"UL",{x-1,y-2}}}); else q.push({{cost-1,-1},{s+" UL",{x-1,y-2}}}); } if(x+10 and !um[{x+1,y-2}]) { um[{x+1,y-2}]=1; if(s.length()==0) q.push({{cost-1,-2},{s+"UR",{x+1,y-2}}}); else q.push({{cost-1,-2},{s+" UR",{x+1,y-2}}}); } if(x+20 and y+2=0 and !um[{x-2,y}]) { um[{x-2,y}]=1; if(s.length()==0) q.push({{cost-1,-6},{s+"L",{x-2,y}}}); else q.push({{cost-1,-6},{s+" L",{x-2,y}}}); } } } cout << "Impossible" << nl ; return ; } int main() { ios; cin >> n ; cin >> b >> a >> bb >> aa ; solve(); }