ll h,w,k,l,r; char s[512][512]; char z[3d5]; ll d[512][512]; ll q[1d6]; void f(ll sy,ll sx){ d[sy][sx]=1; ll i=0,j=0; q[j++]=sy; q[j++]=sx; while(i=0&&y2=0&&x20&&y0&&x=0&&y3=0&&x30&&y>1){ z[p++]='D'; z[p++]='U'; } }else{ rep(r-l+1>>1){ z[p++]='R'; z[p++]='L'; } } d[0...511][0..511]=0; f(y,x); p=0; y2=0; x2=0; while(!(y2==y&&x2==x)){ rep(a,5){ if(a==4)exit(3); ll y3=y2-(a==0)+(a==1); ll x3=x2-(a==2)+(a==3); if(y3>=0&&y3=0&&x3