#include using namespace std; typedef long long int ll; typedef pair P; typedef vector VI; typedef vector VVI; #define REP(i,n) for(int i=0;i point(int n){ if(n==1) return {0,0}; ll k; for(k=1;1;k+=2){ if(k*k>n){ k-=2; break; } } int now=k*k; int x=(k+1)/2, y=(k+1)/2; REP(i,k+1){ y--; now++; if(now==n) return {x,y}; } REP(i,k+1){ x--; now++; if(now==n) return {x,y}; } REP(i,k+1){ y++; now++; if(now==n) return {x,y}; } REP(i,k+1){ x++; now++; if(now==n) return {x,y}; } } string path(int dx, int dy){ string ret=""; if(dx>0){ REP(i,dx/2) ret+="RRLR"; } else{ REP(i,-dx/2) ret+="LLRL"; } if(dy>0){ REP(i,dy/2) ret+="DDUD"; } else{ REP(i,-dy/2) ret+="UUDU"; } return ret; } int main(){ int s, t; cin >> s >> t; pair sp=point(s), tp=point(t); string ans="RLR"; sp.first++; int dx=tp.first-sp.first, dy=tp.second-sp.second; if(abs(dx)%2==0&&abs(dy)%2==0){ ans+=path(dx,dy); } else{ if(abs(sp.second)%2!=abs(tp.second)%2){ ans+="RDUD"; sp.first++; sp.second++; } if(abs(sp.first)%2!=abs(tp.first)%2){ if(abs(sp.second)%2==0){ if(abs(sp.first)%2==0){ dx=-2-sp.first; dy=-sp.second; ans+=path(dx,dy); ans+="UUR"; sp.first+=dx+1; sp.second+=dy-2; } else{ dx=-1-sp.first; dy=-2-sp.second; ans+=path(dx,dy); ans+="LDD"; sp.first+=dx-1; sp.second+=dy+2; } } else{ if(abs(sp.first)%2==0){ dx=-sp.first; dy=-1-sp.second; ans+=path(dx,dy); ans+="LDD"; sp.first+=dx-1; sp.second+=dy+2; } else{ dx=-1-sp.first; dy=1-sp.second; ans+=path(dx,dy); ans+="UUR"; sp.first+=dx+1; sp.second+=dy-2; } } } dx=tp.first-sp.first; dy=tp.second-sp.second; ans+=path(dx,dy); } cout << 0 << endl; cout << ans.size() << endl; cout << ans << endl; return 0; }