#pragma GCC optimize("Ofast") #pragma GCC target("avx2") #define RD(v) int v=0;{int _c;while(_c=*rp++-48,_c>=0)v=v*10+_c;} void locate(int s,int*px,int*py){ int r=(int)sqrt(s-1)+1&~1; int r1=r>>1; int t=(r+1)*(r+1)-s; if(t0){ *(int*)wp='RRLR'; wp+=4; x-=2; } while(x<0){ *(int*)wp='LLRL'; wp+=4; x+=2; } if(x){ wp[-1]='U';++y; } while(y>0){ *(int*)wp='DDUD'; wp+=4; y-=2; } while(y<0){ *(int*)wp='UUDU'; wp+=4; y+=2; } --wp; } int main(){ read(0,buf,32); char*rp=buf; RD(s); RD(t); int sx,sy,tx,ty; locate(s,&sx,&sy); locate(t,&tx,&ty); wp=buf+32; if(s+t&1){ move(tx-sx,ty-sy); }else if(s&1){ move(1-sx,0-sy); *(int*)wp='LURL'; wp+=4; move(tx-0,ty+1); }else{ move(0-sx,0-sy); *(int*)wp='DLUR'; wp+=4; *(int*)wp='DU'; wp+=2; move(tx-0,ty-0); } char*wp2=buf+32; int n=wp-wp2; *wp++='\n'; *--wp2='\n'; while(*--wp2=n%10+'0',n/=10); *--wp2='\n'; *--wp2='0'; write(1,wp2,wp-wp2); _exit(0); }