Problem:
 Score : 300 points    Problem Statement Dolphin resides in two-dimensional Cartesian plane, with the positive x -axis pointing right and the positive y -axis pointing up. Currently, he is located at the point (sx,sy) . In each second, he can move up, down, left or right by a distance of 1 . Here, both the x - and y -coordinates before and after each movement must be integers. He will first visit the point (tx,ty) where sx < tx and sy < ty , then go back to the point (sx,sy) , then visit the point (tx,ty) again, and lastly go back to the point (sx,sy) . Here, during the whole travel, he is not allowed to pass through the same point more than once, except the points (sx,sy) and (tx,ty) . Under this condition, find a shortest path for him.      Constraints  -1000 ≤ sx < tx ≤ 1000   -1000 ≤ sy < ty ≤ 1000   sx,sy,tx and ty are integers.         Input The input is given from Standard Input in the following format:  sx  sy  tx  ty       Output Print a string S that represents a shortest path for Dolphin. The i -th character in S should correspond to his i -th movement. The directions of the movements should be indicated by the following characters:   U : Up  D : Down  L : Left  R : Right   If there exist multiple shortest paths under the condition, print any of them.        Sample Input 1 0 0 1 2      Sample Output 1 UURDDLLUUURRDRDDDLLU  One possible shortest path is:   Going from (sx,sy) to (tx,ty) for the first time: (0,0) → (0,1) → (0,2) → (1,2)  Going from (tx,ty) to (sx,sy) for the first time: (1,2) → (1,1) → (1,0) → (0,0)  Going from (sx,sy) to (tx,ty) for the second time: (0,0) → (-1,0) → (-1,1) → (-1,2) → (-1,3) → (0,3) → (1,3) → (1,2)  Going from (tx,ty) to (sx,sy) for the second time: (1,2) → (2,2) → (2,1) → (2,0) → (2,-1) → (1,-1) → (0,-1) → (0,0)        Sample Input 2 -2 -2 1 1      Sample Output 2 UURRURRDDDLLDLLULUUURRURRDDDLLDL

Solution (Python):
sx, sy, tx, ty = map(int, input().split())
dx, dy = tx - sx, ty - sy
m1 = 'R' * dx + 'U' * dy
m2 = 'L' * dx + 'D' * dy
m3 = 'D' + 'R' * (dx + 1) + 'U' * (dy + 1) + 'L'
m4 = 'U' + 'L' * (dx + 1) + 'D' * (dy + 1) + 'R'
print(m1 + m2 + m3 + m4)

Solution (Python):
a,b,c,d=map(int,input().split())
A=""
for i in range(c-a):
  A=A+"R"
for i in range(d-b):
  A=A+"U"
for i in range(c-a):
  A=A+"L"
for i in range(d-b+1):
  A=A+"D"
for i in range(c-a+1):
  A=A+"R"
for i in range(d-b+1):
  A=A+"U"
A=A+"LU"
for i in range(c-a+1):
  A=A+"L"
for i in range(d-b+1):
  A=A+"D"
A=A+"R"
print(A)

Solution (Python):


Z = list(map(int, input().split()))
S, T = Z[:2], Z[2:]
dx, dy = [abs(T[i] - S[i]) for i in range(2)]

result = ""
result += "U"*dy
result += "R"*dx
result += "D"*dy
result += "L"*dx
result += "L"
result += "U"*(dy + 1)
result += "R"*(dx + 1)
result += "D"
result += "R"
result += "D"*(dy + 1)
result += "L"*(dx + 1)
result += "U"
print(result)

Solution (Python):
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SI(): return sys.stdin.readline()[:-1]

def main():
    sx,sy,tx,ty=MI()
    w=tx-sx
    h=ty-sy
    ans="D"
    ans+="R"*(w+1)
    ans+="U"*(h+1)
    ans+="L"
    ans+="D"*h
    ans+="L"*(w+1)
    ans+="U"*(h+1)
    ans+="R"*(w+1)
    ans+="D"
    ans+="L"*w
    ans+="D"*h
    print(ans)

main()

Solution (Python):
sx,sy,tx,ty=map(int,input().split())
ans='R'*(tx-sx)+'U'*(ty-sy)+'L'*(tx-sx)+'D'*(ty-sy+1)+'R'*(tx-sx+1)+'U'*(ty-sy+1)+'L'+'U'+'L'*(tx-sx+1)+'D'*(ty-sy+1)+'R'
print(ans)

Solution (Python):
S=list(map(int,input().split()))

sx=S[0]
sy=S[1]
tx=S[2]
ty=S[3]
answer=[]
for i in range(ty-sy):
    answer.append("U")
for i in range(tx-sx):
    answer.append("R")
for i in range(ty-sy):
    answer.append("D")
for i in range(tx-sx):
    answer.append("L")
answer.append("L")
for i in range(ty-sy+1):
    answer.append("U")
for i in range(tx-sx+1):
    answer.append("R")
answer.append("D")
answer.append("R")
for i in range(ty-sy+1):
    answer.append("D")
for i in range(tx-sx+1):
    answer.append("L")
answer.append("U")
for s in answer:
    print(s,end="")

Solution (Python):
a, b, c, d = map(int,input().split())

x = c - a
y = d - b

z = []
z += y * 'U'
z += x * 'R'
z += y * 'D'
z += (x + 1) * 'L'
z += (y + 1) * 'U'
z += (1 + x) * 'R'
z += 'D'
z += 'R'
z += (y + 1) * 'D'
z += (1 + x) *'L'
z += 'U'

print(''.join(z))

Solution (Python):
def sign(x):
    if x > 0:
        return 1
    if x == 0:
        return 0
    
    return -1

def solve():
    move_x = ["", "R", "L"]
    move_y = ["", "U", "D"]
    
    sx, sy, tx, ty = list(map(int, input().split()))
    
    dx = tx - sx
    dy = ty - sy

    outward = ""
    homeward = ""
    
    outward = move_x[sign(dx)] * abs(dx) + move_y[sign(dy)] * abs(dy)
    homeward = move_x[-sign(dx)] * abs(dx) + move_y[-sign(dy)] * abs(dy)
    
    fir_route = outward + homeward
    sec_route = move_y[-sign(dy)] + move_x[sign(dx)] + outward + move_y[sign(dy)] + move_x[-sign(dx)] + move_y[sign(dy)] + move_x[-sign(dx)] + homeward + move_y[-sign(dy)] + move_x[sign(dx)]

    print(fir_route, end="")
    print(sec_route)

if __name__ == "__main__":
    solve()

Solution (Python):




def sign(x):
    if x > 0:
        return 1
    if x == 0:
        return 0
    
    return -1

def solve():
    move_x = ["", "R", "L"]
    move_y = ["", "U", "D"]
    
    sx, sy, tx, ty = list(map(int, input().split()))
    
    dx = tx - sx
    dy = ty - sy

    outward = ""
    homeward = ""


    if dx == 0 and dy == 0:
        print()
        return
    
    if dx == 0:
        outward = move_y[sign(dy)] * abs(dy)
        homeward = move_y[-sign(dy)] * abs(dy)

        fir_route = outward + "R" + homeward + "L"
        sec_route = "L" + outward + "R" + move_y[sign(dy)] + "RR" + move_y[-sign(dy)] + homeward + move_y[-sign(dy)] + "LL" + move_y[sign(dy)]

        print(fir_route, end="")
        print(sec_route)

        return

    if dy == 0:
        outward = move_x[sign(dx)] * abs(dx)
        homeward = move_x[-sign(dx)] * abs(dx)

        fir_route = outward + "U" + homeward + "D"
        sec_route = "D" + outward + "U" + move_x[sign(dx)] + "UU" + move_x[-sign(dx)] + homeward + move_x[-sign(dx)] + "DD" + move_x[sign(dx)]

        print(fir_route, end="")
        print(sec_route)

        return
    
    outward = move_x[sign(dx)] * abs(dx) + move_y[sign(dy)] * abs(dy)
    homeward = move_x[-sign(dx)] * abs(dx) + move_y[-sign(dy)] * abs(dy)
    
    fir_route = outward + homeward
    sec_route = move_y[-sign(dy)] + move_x[sign(dx)] + outward + move_y[sign(dy)] + move_x[-sign(dx)] + move_y[sign(dy)] + move_x[-sign(dx)] + homeward + move_y[-sign(dy)] + move_x[sign(dx)]

    print(fir_route, end="")
    print(sec_route)

if __name__ == "__main__":
    solve()

Solution (Python):
sx,sy,tx,ty=map(int,input().split())

dx=tx-sx
dy=ty-sy

ans =      "U"*dy +          "R"*dx+"D"*dy+"L"*dx
ans+="L" + "U"*dy + "U"+"R"+"R"*dx+"D"
ans+="R"+"D"*dy+"D"+"L"+"L"*dx+"U"

print(ans)

Solution (Python):
sx, sy, tx, ty = map(int, input().split())
h, w = (ty-sy), (tx-sx)
inner_route = "U"*h+"R"*w+"D"*h+"L"*w
outer_route = "L"+"U"*(h+1)+"R"*(w+1)+"D"
outer_route += "R"+"D"*(h+1)+"L"*(w+1)+"U"
print(inner_route+outer_route)

Solution (Python):

sx,sy,tx,ty = map(int,input().split())
y = abs(ty-sy)
x = abs(tx-sx)
ans = ""

for i in range(y):
    ans += "U"
for i in range(x):
    ans += "R"
for i in range(y):
    ans += "D"
for i in range(x+1):
    ans += "L"
for i in range(y+1):
    ans += "U"
for i in range(x+1):
    ans += "R"
ans += "DR"
for i in range(y+1):
    ans += "D"
for i in range(x+1):
    ans += "L"
ans += "U"

print(ans)

Solution (Python):
import sys

input = sys.stdin.readline

sx, sy, tx, ty = list(map(int, input().split(' ')))

dfx = tx - sx
dfy = ty - sy

routes = ''

routes += 'U' * dfy
routes += 'R' * dfx
routes += 'D' * dfy
routes += 'L' * dfx

routes += 'L'
routes += 'U' * (dfy + 1)
routes += 'R' * (dfx + 1)
routes += 'D'

routes += 'R'
routes += 'D' * (dfy + 1)
routes += 'L' * (dfx + 1)
routes += 'U'

print(routes)

Solution (Python):
sx, sy, tx, ty = map(int, input().split())

x = tx - sx
y = ty - sy

ans = ''


for i in range(x):
    ans += 'R'
for i in range(y):
    ans += 'U'

for i in range(x):
    ans += 'L'
for i in range(y):
    ans += 'D'

ans += 'D'
for i in range(x + 1):
    ans += 'R'
for i in range(y + 1):
    ans += 'U'
ans += 'L'

ans += 'U'
for i in range(x + 1):
    ans += 'L'
for i in range(y + 1):
    ans += 'D'
ans += 'R'

print(ans)

Solution (Python):
sx, sy, tx, ty = map(int,input().split())
height = ty - sy
width = tx - sx 

path1 = ['U' for _ in range(height) ]
path1.extend([ 'R' for _ in range(width)])

path2 = ['D' for _ in range(height)]
path2.extend([ 'L' for _ in range(width)])

path3 = ['U' for _ in range(height+1)]
path3.extend([ 'R' for _ in range(width+1)])
path3.insert(0,'L')
path3.extend(['D'])

path4 = ['D' for _ in range(height+1)]
path4.extend([ 'L' for _ in range(width+1) ])
path4.insert(0,'R')
path4.extend(['U'])

path = path1
path.extend(path2)
path.extend(path3)
path.extend(path4)

print(''.join(path))

Solution (Python):
sx,sy,tx,ty = map(int,input().split())

x1 = tx-sx
y1 = ty-sy
print("U"*y1+"R"*x1+"D"*y1+"L"*x1+"L"+"U"*(1+y1)+"R"*(1+x1)+"D"+"R"+"D"*(1+y1)+"L"*(1+x1)+"U")

Solution (Python):
sx, sy, tx, ty = map(int, input().split())
dx = tx-sx
dy = ty-sy
ans = 'U'*dy + 'R'*dx + 'D'*dy + 'L'*dx
ans += 'L' + 'U'*(dy+1) + 'R'*(dx+1) + 'D'
ans += 'R' + 'D'*(dy+1) + 'L'*(dx+1) + 'U'
print(ans)

Solution (Python):
a, b, c, d = map(int, input().split())
ans = ''
ans += 'R' * (c - a) + 'U' * (d - b)
ans += 'L' * (c - a) + 'D' * (d - b)
ans += 'D' + 'R' * (c - a + 1) + 'U' * (d - b + 1) + 'L'
ans += 'U' + 'L' * (c - a + 1) + 'D' * (d - b + 1) + 'R'
print(ans)

Solution (Python):
sx, sy, tx, ty = map(int, input().split())
print(
    "U" * (ty - sy)
    + "R" * (tx - sx)
    + "D" * (ty - sy)
    + "L" * (tx - sx)
    + "L"
    + "U" * (ty - sy + 1)
    + "R" * (tx - sx + 1)
    + "DR"
    + "D" * (ty - sy + 1)
    + "L" * (tx - sx + 1)
    + "U"
)

Solution (Python):
import sys
input = sys.stdin.readline

def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

def main():
    mod=10**9+7
    sx,sy,tx,ty=MI()
    ans=[]
    
    for i in range(ty-sy):
        ans.append("U")
    for i in range(tx-sx+1):
        ans.append("R")
    for i in range(ty-sy+1):
        ans.append("D")
    for i in range(tx-sx+1):
        ans.append("L")
    ans.append("U")
    ans.append("L")
    for i in range(ty-sy+1):
        ans.append("U")
    for i in range(tx-sx+1):
        ans.append("R")
    for i in range(ty-sy+1):
        ans.append("D")
    for i in range(tx-sx):
        ans.append("L")
        
    print(''.join(map(str, ans)))
    

main()

Solution (Python):
sx, sy, tx, ty = map(int, input().split())
dx, dy = tx-sx, ty-sy
ans = 'U'*dy + 'R'*dx + 'D'*dy + 'L'*dx
ans += 'L' + 'U'*(dy+1) + 'R'*(dx+1) + 'D'
ans += 'R' + 'D'*(dy+1) + 'L'*(dx+1) + 'U'
print(ans)

Solution (Python):
sx,sy,tx,ty=map(int,input().split())

ans="U"*(ty-sy)+"R"*(tx-sx)+"D"*(ty-sy)+"L"*(tx-sx)+"L"+"U"*(ty-sy+1)+"R"*(tx-sx+1)+"D"+"R"+"D"*(ty-sy+1)+"L"*(tx-sx+1)+"U"
print(ans)

Solution (Python):
sx, sy, tx, ty = map(int, input().split())

u = 'U'
d = 'D'
r = 'R'
l = 'L'
x = tx - sx
y = ty - sy
result = []

result += [u]*y
result += [r]*x

result += [d]*y
result += [l]*x


result += [d]
result += [r]*(x+1)
result += [u]*(y+1)
result += [l]

result += [u]
result += [l]*(x+1)
result += [d]*(y+1)
result += [r]

print(''.join(result))

Solution (Python):
def resolve():
    s_x, s_y, t_x, t_y = map(int, input().split())

    d_x = t_x - s_x
    d_y = t_y - s_y
    p_1 = 'U'*d_y + 'R'*d_x
    p_2 = 'D'*d_y + 'L'*d_x
    p_3 = 'L' + 'U' * (d_y+1) + 'R' * (d_x+1) + 'D'
    p_4 = 'R' + 'D' * (d_y+1) + 'L' * (d_x + 1) + 'U'

    print(p_1+p_2+p_3+p_4)

if __name__ == '__main__':
    resolve()

Solution (Python):
sx, sy, tx, ty = map(int, input().split())

dx, dy = tx-sx, ty - sy

ans = ""
ans += "U" * dy
ans += "R" * dx
ans += "D" * dy
ans += "L" * dx

ans += "L"
ans += "U" * (dy+1)
ans += "R" * (dx+1)
ans += "DR"
ans += "D" * (dy+1)
ans += "L" * (dx+1)
ans += "U"

print(ans)

Solution (Python):
sx, sy, tx, ty = map(int, input().split())

ans = (abs(tx - sx)  * 'R') + (abs(ty - sy) * 'U')
ans += ((abs(tx - sx) * 'L') + (abs(ty - sy) * 'D'))
ans += 'L' + ((abs(ty - sy) + 1) * 'U') + ((abs(tx - sx) + 1) * 'R') + 'D'
ans += 'R' + ((abs(ty - sy) + 1) * 'D') + ((abs(tx - sx) + 1) * 'L') + 'U'
print(ans)

Solution (Python):
[sx,sy,tx,ty] = [int(i) for i in input().split()]
"""
cnt = 0

while cnt < 4:
    
    if cnt % 2 == 0:
"""




dx = tx-sx
dy = ty-sy
ans = ""

ans += "R" * dx + "U" * dy+"L" * dx + "D" * dy

ans += "D" + "R" *(dx+1) + "U" * (dy+1) +"L"

ans += "U" + "L" * (dx+1) + "D" * (dy+1) +"R"

print(ans)

Solution (Python):


sx,sy,tx,ty = list(map(int, input().rstrip().split()))


h = ty-sy
w = tx-sx

st1 = "U"*h + "R"*w
ts1 = "D"*h + "L"*w

st2 = "L" + "U"*(h+1) + "R"*(w+1) + "D"
ts2 = "R" + "D"*(h+1) + "L"*(w+1) + "U"

ans = st1 + ts1 + st2 + ts2
print(ans)

Solution (Python):

a,b,c,d = map(int,input().split())
print("R"*(c-a)+"U"*(d-b)+"L"*(c-a)+"D"*(d-b+1)+\
    "R"*(c-a+1)+"U"*(d-b+1)+"L"+"U"+"L"*(c-a+1)+"D"*(d-b+1)+"R")

Solution (Python):

inputVec = input().split(' ')
s_x = int(inputVec[0])
s_y = int(inputVec[1])
t_x = int(inputVec[2])
t_y = int(inputVec[3])


d_x = t_x - s_x
d_y = t_y - s_y


result = 'R' * d_x + 'U' * d_y


result += 'L' * d_x + 'D' * d_y


result += 'D' + 'R' * (d_x + 1) + 'U' * (d_y + 1) + 'L'


result += 'U' + 'L' * (d_x + 1) + 'D' * (d_y + 1) + 'R'

print(result)

Solution (Python):
sx, sy, tx, ty = map(int, input().split())
s = ""
dx, dy = abs(tx - sx), abs(ty - sy)
dxy = dx + dy
for a in range(dx):
  s += "R"
for b in range(dy):
  s += "U"
for c in range(dx):
  s += "L"
for d in range(dy):
  s += "D"
s += "D"
for e in range(dx + 1):
  s += "R"
for f in range(dy + 1):
  s += "U"
s += "L"
s += "U"
for g in range(dx + 1):
  s += "L"
for h in range(dy + 1):
  s += "D"
s += "R"
print(s)

Solution (Python):
sx,sy,tx,ty = map(int, input().split())

ans = []
for i in range(sy, ty):
    ans.append('U')
for i in range(sx, tx):
    ans.append('R')
for i in range(ty, sy, -1):
    ans.append('D')
for i in range(tx, sx-1, -1):
    ans.append('L')
for i in range(sy, ty+1):
    ans.append('U')
for i in range(sx-1, tx):
    ans.append('R')
for i in range(ty+1, ty, -1):
    ans.append('D')
for i in range(tx, tx+1):
    ans.append('R')
for i in range(ty, sy-1, -1):
    ans.append('D')
for i in range(tx+1, sx, -1):
    ans.append('L')
for i in range(sy-1, sy):
    ans.append('U')
print(''.join(ans))

Solution (Python):
route=''
sx,sy,tx,ty=map(int,input().split())
h=abs(ty-sy)
w=abs(tx-sx)
for i in range(h):
    route+=str("U")
for j in range(w):
    route+=str("R")
for i in range(h):
    route+=str("D")
for i in range(w+1):
    route+=str("L")
for i in range(h+1):
    route+=str("U")
for i in range(w+1):
    route+=str("R")
route+=str("D")
route+=str('R')
for i in range(h+1):
    route+=str("D")
for i in range((w+1)):
    route+=str("L")
route+=str("U")
print(route)

Solution (Python):
sx,sy,tx,ty=map(int,input().split())
print("R"*(tx-sx)+"U"*(ty-sy)+"L"*(tx-sx)+"D"*(ty-sy)+
      "D"+"R"*(tx-sx+1)+"U"*(ty-sy+1)+"L"+
      "U"+"L"*(tx-sx+1)+"D"*(ty-sy+1)+"R")

Solution (Python):
sx , sy , tx , ty = map(int,input().split())
a = []

for _ in range(tx - sx):
    a.append("R")
for _ in range(ty - sy):
    a.append("U")
for _ in range(tx - sx):
    a.append("L")
for _ in range(ty - sy):
    a.append("D")
    
a.append("D")

for _ in range(tx - sx + 1):
    a.append("R")
for _ in range(ty - sy + 1):
    a.append("U")
    
a.append("L")
a.append("U")

for _ in range(tx - sx + 1):
    a.append("L")
for _ in range(ty - sy + 1):
    a.append("D")
    
a.append("R")

print("".join(a))

Solution (Python):
a,b,c,d = map(int,input().split())
for _ in range(d-b):
  print('U', end='')
for _ in range(c-a):
  print('R', end='')
print('U', end='')
for _ in range(c-a+1):
  print('L', end='')
for _ in range(d-b+1):
  print('D', end='')
print('R', end='')  
for _ in range(c-a):
  print('R', end='')
for _ in range(d-b):
  print('U', end='')
print('R', end='')
for _ in range(d-b+1):
  print('D', end='')
for _ in range(c-a+1):
  print('L', end='')
print('U')

Solution (Python):
sx,sy,tx,ty = map(int, input().split())
ans = []
for _ in range(ty-sy):
  ans.append("U")
for i in range(tx-sx):
    ans.append("R")
for i in range(abs(sy-ty)):
    ans.append("D")
for i in range(abs(sx-tx)):
    ans.append("L")

ans.append("L")
for i in range(ty-sy+1):
    ans.append("U")
for i in range(tx-sx+1):
    ans.append("R")
ans.append("D")
ans.append("R")
for i in range(abs(sy-ty)+1):
    ans.append("D")
for i in range(abs(sx-tx)+1):
    ans.append("L")
ans.append("U")

print("".join(ans))

Solution (Python):
sx, sy, tx, ty = map(int, input().split())
route1, route2, route3, route4 = '', '', 'L', 'R'
dis_x = tx - sx
dis_y = ty - sy
route1 = 'U' * dis_y + 'R' * dis_x
route2 = 'D' * dis_y + 'L' * dis_x
route3 += 'U' * (dis_y+1) + 'R' * (dis_x+1) + 'D'
route4 += 'D' * (dis_y+1) + 'L' * (dis_x+1) + 'U'
print(route1 + route2 + route3 + route4)

Solution (Python):

sx,sy,tx,ty = list(map(int,input().split()))
x,y = [tx-sx,ty-sy]
s = "U"*y+"R"*x+"D"*y+"L"*x + "L"+"U"*(y+1)+"R"*(x+1)+"D"+"R"+"D"*(y+1)+"L"*(x+1)+"U"
print(s)

Solution (Python):
sx,sy,tx,ty = map(int, input().split())
y = ty-sy
x = tx-sx
print('U'*y+'R'*x+'D'*y+'L'*x+'D'+'R'*(x+1)+'U'*(y+1)+'LU'+'L'*(x+1)+'D'*(y+1)+'R')

Solution (Python):
sx, sy, tx, ty = map(int, input().split())
dx = tx - sx
dy = ty - sy

ans = dx*'R'+dy*'U'+dx*'L'+dy*'D'+'L'+(dy+1)*'U'+(dx+1)*'R'+'D'+'R'+(dy+1)*'D'+(dx+1)*'L'+'U'
print(ans)

Solution (Python):
sx,sy,tx,ty=map(int,input().split())
xd=tx-sx;yd=ty-sy
res='R'*xd+'U'*yd+'L'*xd+'D'*yd+'D'+'R'*(xd+1)+'U'*(yd+1)+'LU'+'L'*(xd+1)+'D'*(yd+1)+'R'
print(res)

Solution (Python):



sx, sy, tx, ty = map(int, input().split())
print('U'*abs(ty-sy),
        'R'*abs(tx-sx),
        'D'*abs(ty-sy),
        'L'*abs(tx-sx),
        'L',
        'U'*(abs(ty-sy)+1),
        'R'*(abs(tx-sx)+1),
        'DR',
        'D'*(abs(ty-sy)+1),
        'L'*(abs(tx-sx)+1),
        'U',
        sep='')

Solution (Python):
x1, y1, x2, y2 = map(int, input().split())

ans = ''

dx = x2 - x1
dy = y2 - y1

ans += 'R'*dx + 'U'*dy + 'R' + 'D'*(dy+1) + 'L'*(dx+1) + 'U'*(dy+1) + 'R'*dx + 'U' + 'L'*(dx+1) + 'D'*(dy+1) + 'R'

print(ans)

Solution (Python):
sx, sy, tx, ty = map(int, input().split())

xlen = tx - sx
ylen = ty - sy

ans1 = "U" * (ylen) + "R" * (xlen)
ans2 = "D" * (ylen) + "L" * (xlen)
ans3 = "L" + "U" * (ylen+1) + "R" * (xlen+1) + "D"
ans4 = "R" + "D" * (ylen+1) + "L" * (xlen+1) + "U"

print(ans1 + ans2 + ans3 + ans4)

Solution (Python):
sx, sy, tx, ty = map(int, input().split())
dx = tx - sx
dy = ty - sy

ans = ""
ans += "U" * dy
ans += "R" * dx
ans += "D" * dy
ans += "L" * (1 + dx)
ans += "U" * (1 + dy)
ans += "R" * (1 + dx)
ans += "DR"
ans += "D" * (1 + dy)
ans += "L" * (1 + dx)
ans += "U"
print(ans)

Solution (Python):
sx,sy,tx,ty=map(int,input().split())
yoko=tx-sx
tate=ty-sy
print('U'*tate+'R'*yoko+'D'*tate+'L'*yoko+'L'+'U'*(tate+1)+'R'*(yoko+1)+'D'+'R'+'D'*(tate+1)+'L'*(yoko+1)+'U')

Solution (Python):
sx,sy,tx,ty=map(int,input().split())
dx,dy=tx-sx,ty-sy
route=["","","",""]
route[0]='U'*dy+'R'*dx
route[1]='D'*dy+'L'*dx
route[2]='L'+'U'*(dy+1)+'R'*(dx+1)+'D'
route[3]='R'+'D'*(dy+1)+'L'*(dx+1)+'U'
print("".join(route))

Solution (Python):
sx,sy,tx,ty=map(int,input().split())
dx,dy=tx-sx,ty-sy
st1='U'*dy+'R'*dx
ts1='D'*dy+'L'*dx
st2='L'+'U'*(dy+1)+'R'*(dx+1)+'D'
ts2='R'+'D'*(dy+1)+'L'*(dx+1)+'U'
print(st1+ts1+st2+ts2)

Solution (Python):

sx,sy,tx,ty=map(int,input().split())
dx,dy=tx-sx,ty-sy
st1='U'*dy+'R'*dx
ts1='D'*dy+'L'*dx
st2='L'+'U'*(dy+1)+'R'*(dx+1)+'D'
ts2='R'+'D'*(dy+1)+'L'*(dx+1)+'U'
print(st1+ts1+st2+ts2)

Solution (Python):
sx, sy, tx, ty = map(int, input().split())
ans = ''
ans += 'R' * (tx - sx) + 'U' * (ty - sy)
ans += 'L' * (tx - sx) + 'D' * (ty - sy)
ans += 'D' + 'R' * (tx - sx + 1) + 'U' * (ty - sy + 1) + 'L'
ans += 'U' + 'L' * (tx - sx + 1) + 'D' * (ty - sy + 1) + 'R'
print(ans)

Solution (Python):
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
import heapq

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))

sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

sx, sy, tx, ty = MAP()

W = tx - sx
H = ty - sy


A = "U" * H + "R" * W + "D" * H + "L" * W
B = "L" + "U" * (H + 1) + "R" * (W + 1) + "D" \
    + "R" + "D" * (H + 1) + "L" * (W + 1) + "U"
print(A+B)

Solution (Python):
sx, sy, tx, ty = map(int,input().split())

dx = (tx - sx)
dy = (ty - sy)

s = 'U' * dy + 'R' * dx

s += 'D' * dy + 'L' * dx

s += 'L' + 'U' * (dy+1) + 'R' * (dx+1) + 'D'

s += 'R' + 'D' * (dy+1) + 'L' * (dx+1) + 'U'

print(s)

Solution (Python):
sx,sy,tx,ty = map(int,input().split())
a = tx-sx
b = ty-sy

c = "R"*a + "U"*b
d = "L"*a + "D"*b
e = "D" + "R"*(a+1) + "U"*(b+1) + "L"
f = "U" + "L"*(a+1) + "D"*(b+1) + "R"

g = c + d + e + f
print(g)

Solution (Python):
a,b,c,d=map(int,input().split())
print("R"*(c-a)+"U"*(d-b)+"R"+"D"*(d-b+1)+"L"*(c-a+1)+"UL"+"U"*(d-b+1)+"R"*(c-a+1)+"D"+"L"*(c-a)+"D"*(d-b))

Solution (Python):




sx, sy, tx, ty = map(int, input().split())

dx = tx - sx
dy = ty - sy
U, D, L, R = 'UDLR'

ans = U * dy + R * dx + D * dy + L * dx  
ans += L + U * (1 + dy) + R * (1 + dx) + D + R + \
    D * (1 + dy) + L * (1 + dx) + U  
print(ans)

Solution (Python):
sx, sy, tx, ty = map(int, input().split())
x = tx-sx
y = ty-sy
first = "U"*y+"R"*x+"D"*y+"L"*x
second = "L"+"U"*(y+1)+"R"*(x+1)+"D"+"R"+"D"*(y+1)+"L"*(x+1)+"U"
print(first+second)

Solution (Python):
sx, sy, tx, ty = list(map(int, input().split()))

ans = "L"

dx = tx - sx
dy = ty - sy

ans += "U" * (dy + 1) + "R" * (dx + 1) + "D"
ans += "L" * dx + "D" * dy
ans += "R" * dx + "U" * dy
ans += "R" + "D" * (dy+1) + "L" * (dx+1) + "U"
print(ans)

Solution (Python):
sx,sy,tx,ty= map(int, input().split())
ux, uy = tx - sx, ty - sy
ans = ""
ans += 'R' * ux + 'U' * uy
ans += 'L' * ux + 'D' * uy
ans += 'D'
ans += 'R' * (ux + 1) + 'U' * (uy + 1)
ans += 'LU'
ans += 'L' * (ux + 1) + 'D' * (uy + 1)
ans += 'R'
print(ans)

Solution (Python):
sx, sy, tx, ty = map(int, input().split())
dx, dy = tx - sx, ty - sy
ans = ""
ans += 'R' * dx + 'U' * dy
ans += 'L' * dx + 'D' * dy
ans += 'D'
ans += 'R' * (dx + 1) + 'U' * (dy + 1)
ans += 'LU'
ans += 'L' * (dx + 1) + 'D' * (dy + 1)
ans += 'R'
print(ans)

Solution (Python):
sx,sy,tx,ty=map(int,input().split())
tx=tx-sx
ty=ty-sy
sx=0
sy=0
ans=[]
def add(num,d):
    global ans
    di=["U","D","L","R"]
    for i in range(num):
        ans.append(di[d])
y=ty-sy
x=tx-sx
add(y,0)
add(x,3)
add(y,1)
add(x,2)
add(1,2)
add(y+1,0)
add(x+1,3)
add(1,1)
add(1,3)
add(y+1,1)
add(x+1,2)
add(1,0)
print("".join(ans))

Solution (Python):
import sys
readline = sys.stdin.buffer.readline

if __name__ == "__main__":
    sx,sy,tx,ty = map(int,readline().split())
    ans = ""
    
    ans += "U"*(ty-sy)
    ans += "R"*(tx-sx)
    ans += "D"*(ty-sy)
    ans += "L"*(tx-sx)
    ans += "L"
    ans += "U"*(ty-sy+1)
    ans += "R"*(tx-sx+1)
    ans += "D"
    ans += "R"
    ans += "D"*(ty-sy+1)
    ans += "L"*(tx-sx+1)
    ans += "U"
    print(ans)

Solution (Python):
sx, sy, tx, ty = map(int, input().split())
dx = tx-sx
dy = ty-sy
ans = []
for i in range(dx):
    ans.append('R')

for i in range(dy):
    ans.append('U')

for i in range(dx):
    ans.append('L')

for i in range(dy+1):
    ans.append('D')

for i in range(dx+1):
    ans.append('R')

for i in range(dy+1):
    ans.append('U')

ans.append("LU")
for i in range(dx+1):
    ans.append('L')

for i in range(dy+1):
    ans.append('D')

ans.append('R')
print("".join(ans))

Solution (Python):
sx, sy, tx, ty = map(int, input().split())

nowx, nowy = sx, sy

ans = ''

for i in range(ty-sy):
    ans += 'U'
for i in range(tx-sx):
    ans += 'R'
for i in range(ty-sy):
    ans += 'D'
for i in range(tx-sx):
    ans += 'L'
ans += 'L'
for i in range(ty-sy):
    ans += 'U'
ans += 'U'
for i in range(tx-sx):
    ans += 'R'
ans += 'R'
ans += 'D'
ans += 'R'
for i in range(ty-sy):
    ans += 'D'
ans += 'D'
for i in range(tx-sx):
    ans += 'L'
ans += 'L'
ans += 'U'

print(ans)

Solution (Python):
def main():
    coordinates = list(map(int, input().split()))
    dx = coordinates[2] - coordinates[0]
    dy = coordinates[3] - coordinates[1]
    answer = "R" * dx + "U" * dy + "L" * dx + "D" * dy
    dx += 1
    dy += 1
    answer += "L" + "U" * dy + "R" * dx + "D" + "R" + "D" * dy + "L" * dx + "U"
    print(answer)


if __name__ == '__main__':
    main()

Solution (Python):
sx,sy,tx,ty=map(int,input().split())
ans=('R'*(tx-sx)+'U'*(ty-sy)+'L'*(tx-sx)+'D'*(ty-sy+1)+
     'R'*(tx-sx+1)+'U'*(ty-sy+1)+'L'+'U'+'L'*(tx-sx+1)+
     'D'*(ty-sy+1)+'R')
print(ans)

Solution (Python):
x, y, tx, ty = map(int, input().split())


dx = abs(tx - x)
dy = abs(ty - y)

s = ''


s += 'R'*dx + 'U'*dy + 'L'*dx + 'D'*dy




s += 'D' + 'R'*(dx+1) + 'U'*(dy+1) + 'L' + 'U' + 'L'*(dx+1) + 'D'*(dy+1) + 'R'

print(s)

Solution (Python):
sx,sy,tx,ty = [int(i) for i in input().split()]
ans = []
dx = tx - sx
dy = ty - sy
for i in range(dy):
    ans.append('U')
for i in range(dx):
    ans.append('R')
for i in range(dy):
    ans.append('D')
for i in range(dx):
    ans.append('L')
ans.append('L')
for i in range(dy+1):
    ans.append('U')
for i in range(dx+1):
    ans.append('R')
ans.append('D')
ans.append('R')
for i in range(dy+1):
    ans.append('D')
for i in range(dx+1):
    ans.append('L')
ans.append('U')
print(''.join(ans))

Solution (Python):
sx,sy,tx,ty=map(int,input().split())
def pans(l,c):
    for i in range(l):
        print(c,end="")
H=ty-sy
W=tx-sx
pans(H,"U")
pans(W,"R")
pans(H,"D")
pans(W+1,"L")
pans(H+1,"U")
pans(W+1,"R")
pans(1,"D")
pans(1,"R")
pans(H+1,"D")
pans(W+1,"L")
pans(1,"U")

Solution (Python):
sx, sy, tx, ty = map(int, input().split())

tx = tx - sx
ty = ty - sy

ans = "" 
ans += "U" * ty
ans += "R" * tx
ans += "D" * ty
ans += "L" * tx
ans += "L"
ans += "U" * (ty + 1)
ans += "R" * (tx + 1)
ans += "D"
ans += "R"
ans += "D" * (ty + 1)
ans += "L" * (tx + 1)
ans += "U"

print(ans)

Solution (Python):
sx,sy,tx,ty = list(map(int, input().split()))

result = ""
dy = ty-sy
dx = tx-sx

for i in range(dy):
    result += "U"
for i in range(dx):
    result += "R"
for i in range(dy):
    result += "D"
for i in range(dx):
    result += "L"

result += "L"
for i in range(dy+1):
    result += "U"
for i in range(dx+1):
    result += "R"
result += "D"

result += "R"
for i in range(dy+1):
    result += "D"
for i in range(dx+1):
    result += "L"
result += "U"
print(result)

Solution (Python):
Sx, Sy, Tx, Ty = map(int, input().split())

for i in range(2):
    print("L"*i, end="")
    print("U"*((Ty-Sy)+i), end="")
    print("R"*((Tx-Sx)+i), end="")
    print("D"*i, end="")
    print("R"*i, end="")
    print("D"*((Ty-Sy)+i), end="")
    print("L"*((Tx-Sx)+i), end="")
    print("U"*i, end="")

Solution (Python):
sx,sy,tx,ty=map(int,input().split())

s='U'*(ty-sy)
s+='R'*(tx-sx)
s+='D'*(ty-sy)
s+='L'*(tx-sx+1)
s+='U'*(ty-sy+1)
s+='R'*(tx-sx+1)
s+='DR'
s+='D'*(ty-sy+1)
s+='L'*(tx-sx+1)
s+='U'

print(s)

Solution (Python):
sx,sy,tx,ty = map(int,input().split())
a = tx-sx
b = ty-sy
r1 = "R"*a+"U"*b
r2 = "L"*a+"D"*b
r3 = "D"+"R"*(a+1)+"U"*(b+1)+"L"
r4 = "U"+"L"*(a+1)+"D"*(b+1)+"R"
print(r1+r2+r3+r4)

Solution (Python):
sx, sy, tx, ty = map(int, input().split())
x = tx - sx
y = ty - sy
ans = "U" * y + "R" * x + "D" * y + "L" * x
ans += "L" + "U" * (y+1) + "R" * (x+1) + "D"
ans += "R" + "D" * (y+1) + "L" * (x+1) + "U"
print(ans)

Solution (Python):
sx, sy, tx, ty = map(int, input().split())
print(
    'R' * (tx - sx) + \
    'U' * (ty - sy) + \
    'L' * (tx - sx) + \
    'D' * (ty - sy + 1) + \
    'R' * (tx - sx + 1) + \
    'U' * (ty - sy + 1) + \
    'L' + 'U' + \
    'L' * (tx - sx + 1) + \
    'D' * (ty - sy + 1) + \
    'R'
)

Solution (Python):
sx,sy,tx,ty=map(int,input().split())

x=tx-sx
y=ty-sy

for i in range(x):
    print("R",end="")

for i in range(y):
    print("U",end="")


for i in range(x):
    print("L",end="")

for i in range(y):
    print("D",end="")

print("D",end="")
for i in range(x+1):
    print("R",end="")

for i in range(y+1):
    print("U",end="")
print("L",end="")




print("U",end="")
for i in range(x+1):
    print("L",end="")

for i in range(y+1):
    print("D",end="")
print("R",end="")

Solution (Python):
sx, sy, tx, ty = map(int, input().split())

ans = ""
count = 0

ans = ans + 'U' * (ty-sy) + 'R' * (tx-sx)
ans = ans + 'D' * (ty-sy) + 'L' * (tx-sx)
ans = ans + 'L' + 'U' * (ty-sy+1) + 'R' * (tx-sx+1) + 'D'
ans = ans + 'R' + 'D' * (ty-sy+1) + 'L' * (tx-sx+1) + 'U'

print(ans)

Solution (Python):
sx, sy, tx, ty = map(int,input().split())

width = tx - sx
height = ty - sy

ans_str = ''

ans_str += 'R' * width
ans_str += 'U' * height
ans_str += 'L' * width
ans_str += 'D' * height

ans_str += 'D'
ans_str += 'R' * (width+1)
ans_str += 'U' * (height+1)
ans_str += 'L'

ans_str += 'U'
ans_str += 'L' * (width+1)
ans_str += 'D' * (height+1)
ans_str += 'R'

print(ans_str)

Solution (Python):
sx,sy,tx,ty = map(int, input().split())

diff_x = tx-sx
diff_y = ty-sy

first_path = 'U'*diff_y + 'R'*diff_x + 'D'*diff_y + 'L'*diff_x
second_path = 'L' + 'U'*diff_y + 'U' + 'R' + 'R'*diff_x + 'D' + \
              'R' + 'D'*diff_y + 'D' + 'L' + 'L'*diff_x + 'U'


print(first_path+second_path)

Solution (Python):
sx, sy, tx, ty = map(int, input().split())
dx = tx - sx
dy = ty - sy
print('R'*dx + 'U'*dy + 'L'*dx + 'D'*dy + 'D' + 'R'*(dx+1) +
      'U'*(dy+1) + 'L' + 'U' + 'L'*(dx+1) + 'D'*(dy+1) + 'R')

Solution (Python):
x1, y1, x2, y2 = map(int, input().split())
res = ""

res += "U" * (y2-y1)
res += "R" * (x2-x1)
res += "D" * (y2-y1)
res += "L" * (x2-x1)
res += "L" + "U" * (y2-y1 + 1)
res += "R" * (x2-x1 + 1) + "D"

res += "R" + "D" * (y2-y1 + 1)
res += "L" * (x2-x1 + 1) + "U"


print(res)

Solution (Python):
sx,sy,tx,ty=map(int,input().split())
dx=tx-sx
dy=ty-sy
ans=""

for i in range(4):
    if i==2:
        ans+="L"
        dx+=1
        dy+=1
    elif i==3:
        ans+="DR"
    if dy>=0:
        ans+="U"*dy
        dy=dy*(-1)
    else:
        ans+="D"*(dy*(-1))
        dy=dy*(-1)
    if dx>=0:
        ans+="R"*dx
        dx=dx*(-1)
    else:
        ans+="L"*(dx*(-1))
        dx=dx*(-1)
ans+="U"
print(ans)

Solution (Python):
sx, sy, tx, ty = map(int, input().split())
dx, dy = tx-sx, ty-sy
print(dy*'U'+dx*'R' + dy*'D'+dx*'L' + 'L'+(dy+1)*'U'+(dx+1)*'R'+'D' + 'R'+(dy+1)*'D'+(dx+1)*'L'+'U')

Solution (Python):
sx,sy,tx,ty=map(int,input().split())
ans=[]

for i in range(ty-sy):
    ans.append("U")
for i in range(tx-sx):
    ans.append("R")
for i in range(abs(sy-ty)):
    ans.append("D")
for i in range(abs(sx-tx)):
    ans.append("L")

ans.append("L")
for i in range(ty-sy+1):
    ans.append("U")
for i in range(tx-sx+1):
    ans.append("R")
ans.append("D")
ans.append("R")
for i in range(abs(sy-ty)+1):
    ans.append("D")
for i in range(abs(sx-tx)+1):
    ans.append("L")
ans.append("U")

print("".join(ans))