#include<bits/stdc++.h>
using namespace std;
using LL=long long;
using ULL=unsigned long long;
#define rep(i,n) for(int i=0;i<(n);i++)

struct Pos{ int x,y; };

Pos id_to_pos(int id){
  if(id==1) return {0,0};
  id--;
  for(int i=1;; i++){
    int shed=2*i;
    int off=(shed-1)*(shed-1);
    int minp=-i+1;
    if(id-off<shed) return { i,(minp+(id-off)) };
    if(id-off-shed<shed) return { -(minp+(id-off-shed)),i };
    if(id-off-shed*2<shed) return { -i,-(minp+(id-off-shed*2)) };
    if(id-off-shed*3<shed) return { (minp+(id-off-shed*3)),-i };
  }
}

const string dirs="ULDR";

string reverse_moving(const string& src){
  string res = src;
  reverse(res.begin(),res.end());
  for(char& c:res) c=dirs[dirs.find(c)^2];
  return move(res);
}

string move_to_origin(Pos x){
  string res;
  res+="RLR"; x.x++;
  while(x.x>1){ res+="LLRL"; x.x-=2; }
  while(x.x<0){ res+="RRLR"; x.x+=2; }
  while(x.y>1){ res+="DDUD"; x.y-=2; }
  while(x.y<0){ res+="UUDU"; x.y+=2; }
  if(x.x==1 && x.y==1){ res+="DLRL"; x={0,0}; }
  if(x.x==0 && x.y==1){ res+="DRLR"; x={1,0}; }
  if(x.x==1){ res+="UDL"; x={0,0}; }
  return move(res);
}

int main(){
  Pos S,T;
  { int s,t; cin>>s>>t; S=id_to_pos(s); T=id_to_pos(t); }
  string ans = move_to_origin(S) + "URDLUD" + reverse_moving(move_to_origin(T));
  cout<<0<<endl;
  cout<<ans.size()<<endl;
  cout<<ans<<endl;
  return 0;
}