#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i ) #define rep(i,n) REP(i,0,n) using ll = long long; constexpr int inf=1e9+7; constexpr ll longinf=1LL<<60 ; constexpr ll mod=1e9+7 ; vector square, ansx, ansy; pair get(int n){ if(n == 1)return {0, 0}; int idx = lower_bound(square.begin(),square.end(),n)-square.begin(); int len = (square[idx]-square[idx-1])/4; n -= square[idx-1]; if(n<=len){ return {idx, -idx+n}; } else if(n<=2*len){ return {idx-(n-len),idx}; } else if(n<=3*len){ return {-idx, idx-(n-2*len)}; } else { return {-idx+(n-3*len),-idx}; } } string root(vector ansx, vector ansy){ string res = ""; int n=ansx.size(); rep(i,n-1){ if(ansx[i]ansx[i+1])res+='L'; if(ansy[i]ansy[i+1])res+='D'; } return res; } void makeEvenRoot(int sx, int sy, int ex, int ey) { int cx = sx, cy = sy; vector xs, ys; xs.push_back(cx); ys.push_back(cy); while(cx!=ex||cy!=ey){ if(cx!=ex){ if(cx>s>>t; auto st = get(s), en = get(t); int sx = st.first, sy = st.second; int ex = en.first, ey = en.second; int dist = abs(ex-sx)+abs(ey-sy); if(dist%2 == 1){ makeEvenRoot(sx, sy, ex, ey); } else if((abs(sx)+abs(sy))%2 == 0){ makeEvenRoot(sx, sy, 0, 1); ansx.push_back(0);ansy.push_back(0); ansx.push_back(1);ansy.push_back(0); ansx.push_back(1);ansy.push_back(1); makeEvenRoot(0, 1, ex, ey); } else { makeEvenRoot(sx, sy, 0, 0); ansx.push_back(1);ansy.push_back(0); ansx.push_back(0);ansy.push_back(0); ansx.push_back(-1);ansy.push_back(0); ansx.push_back(0);ansy.push_back(0); ansx.push_back(0);ansy.push_back(1); makeEvenRoot(0, 0, ex, ey); } string ans = root(ansx, ansy); cout<<0<