#include using namespace std; #define rep(i, n) for(int i = 0; i < n; i++) #define rep2(i, x, n) for(int i = x; i <= n; i++) #define rep3(i, x, n) for(int i = x; i >= n; i--) #define each(e, v) for(auto &e: v) #define pb push_back #define eb emplace_back #define all(x) x.begin(), x.end() #define rall(x) x.rbegin(), x.rend() #define sz(x) (int)x.size() using ll = long long; using pii = pair; using pil = pair; using pli = pair; using pll = pair; const int MOD = 1000000007; //const int MOD = 998244353; const int inf = (1<<30)-1; const ll INF = (1LL<<60)-1; template bool chmax(T &x, const T &y) {return (x < y)? (x = y, true) : false;}; template bool chmin(T &x, const T &y) {return (x > y)? (x = y, true) : false;}; struct io_setup{ io_setup(){ ios_base::sync_with_stdio(false); cin.tie(NULL); cout << fixed << setprecision(15); } } io_setup; pii pos(int x){ if(x == 1) {return pii(0, 0);} int r = ceil(sqrt(x)-0.000001); if(r%2 == 0) ++r; int k = x-(r-2)*(r-2)-1; int a = (r-1)/2, b = k%(r-1); if(k/(r-1) == 0){ return pii(a, -a+1+b); } if(k/(r-1) == 1){ return pii(a-1-b, a); } if(k/(r-1) == 2){ return pii(-a, a-1-b); } if(k/(r-1) == 3){ return pii(-a+1+b, -a); } return pii(0, 0); } char inv(char x){ if(x == 'R') return 'L'; if(x == 'L') return 'R'; if(x == 'U') return 'D'; if(x == 'D') return 'U'; return '.'; } string move(int sx, int sy, int tx, int ty){ assert((abs(sx-tx)+abs(sy-ty))%2 == 0); string tmp, ret; if(sx < tx){ rep(i, tx-sx) tmp += 'R'; } else{ rep(i, sx-tx) tmp += 'L'; } if(sy < ty){ rep(i, ty-sy) tmp += 'U'; } else{ rep(i, sy-ty) tmp += 'D'; } rep(i, sz(tmp)/2){ ret += tmp[2*i], ret += tmp[2*i+1]; ret += inv(tmp[2*i+1]); ret += tmp[2*i+1]; } return ret; } int main(){ int S, T; cin >> S >> T; int sx, sy, tx, ty; tie(sx, sy) = pos(S), tie(tx, ty) = pos(T); //cout << sx << ' ' << sy << ' ' << tx << ' ' << ty << '\n'; string ans; ans += "RLR"; sx++; int a = abs(sx)+abs(sy), b = abs(tx)+abs(ty); a &= 1, b &= 1; if(a == b){ ans += move(sx, sy, tx, ty); } else if(a == 0){ ans += move(sx, sy, 0, 0); ans += "RLRUD"; ans += move(1, 0, tx, ty); } else{ ans += move(sx, sy, -1, 0); ans += "URD"; ans += move(0, 0, tx, ty); } cout << 0 << '\n' << sz(ans) << '\n' << ans << '\n'; }