#include using namespace std; int dl[6]={-2,-2,0,2,2,0}; int dr[6]={-1,1,2,1,-1,-2}; void printShortestPath(int n, int i_s, int j_s, int i_e, int j_e) { vector > > v(n,vector >(n,{-1,-1})); v[i_s][j_s]={0,0}; queue > q; q.push({i_s,j_s}); bool f=false; while(!q.empty() && f==false){ auto it=q.front(); q.pop(); for(int i=0;i<6;i++){ int x=it.first+dl[i],y=it.second+dr[i]; if(x>=0 && x=0 && y s; while(x!=i_s || y!=j_s){ if(v[x][y].first==-2 && v[x][y].second==-1){ s.push("UL"); x+=2;y+=1; } else if(v[x][y].first==-2 && v[x][y].second==1){ s.push("UR"); x+=2;y-=1; } else if(v[x][y].first==0 && v[x][y].second==2){ s.push("R"); y-=2; } else if(v[x][y].first==2 && v[x][y].second==1){ s.push("LR"); x-=2;y-=1; } else if(v[x][y].first==2 && v[x][y].second==-1){ s.push("LL"); x-=2;y+=1; } else if(v[x][y].first==0 && v[x][y].second==-2){ s.push("L"); y+=2; } } cout << s.size() << endl; while(!s.empty()){ cout << s.top() << " "; s.pop(); } cout << endl; } } int main() { 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; printShortestPath(n, i_start, j_start, i_end, j_end); return 0; }