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):
def main():
    x1, y1, x2, y2 = list(map(int, input().split()))

    ans = ''

    
    for i in range(y2 - y1):
        ans += 'U'
    for i in range(x2 - x1):
        ans += 'R'
    for i in range(y2 - y1):
        ans += 'D'
    for i in range(x2 - x1):
        ans += 'L'

    
    ans += 'L'
    for i in range(y2 - y1 + 1):
        ans += 'U'
    for i in range(x2 - x1 + 1):
        ans += 'R'
    ans += 'D'
    ans += 'R'
    for i in range(y2 - y1 + 1):
        ans += 'D'
    for i in range(x2 - x1 + 1):
        ans += 'L'
    ans += 'U'
    
    print(ans)

if __name__ == "__main__":
    main()

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

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

sx,sy,tx,ty=map(int,input().split())
a=["U"]*(ty-sy)+["R"]*(tx-sx)
b=["D"]*(ty-sy)+["L"]*(tx-sx)
c=["L"]+["U"]*(ty-sy+1)+["R"]*(tx-sx+1)+["D"]
d=["R"]+["D"]*(ty-sy+1)+["L"]*(tx-sx+1)+["U"]
ans=a+b+c+d
print("".join(ans))

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

ans=''
for _ in range(ty-sy):
  ans+='U'
for _ in range(tx-sx):
  ans+='R'
for _ in range(ty-sy):
  ans+='D'
for _ in range(tx-sx):
  ans+='L'
ans+='L'
for _ in range(ty-sy+1):
  ans+='U'
for _ in range(tx-sx+1):
  ans+='R'
ans+='DR'
for _ in range(ty-sy+1):
  ans+='D'
for _ in range(tx-sx+1):
  ans+='L'
ans+='U'
print(ans)

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

pass1 = "U"*dy + "R"*dx
pass2 = "D"*dy + "L"*dx
pass3 = "L" + "U"*(dy+1) + "R"*(dx+1) + "D"
pass4 = "R" + "D"*(dy+1) + "L"*(dx+1) + "U"
print(pass1 + pass2 + pass3 + pass4)

Solution (Python):
sx, sy, tx, ty = map(int, input().split())
ans = "R" * (tx-sx) + "U" * (ty-sy) + "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):
sx, sy, tx, ty = map(int, input().split(" "))

x_d = tx - sx
y_d = ty - sy

print("R"*x_d + "U"*y_d + "L"*x_d + "D"*(y_d + 1) + "R"*(x_d + 1) +
     "U"*(y_d + 1) + "L" + "U" + "L"*(x_d + 1) + "D"*(y_d + 1) + "R")

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

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

if sx < tx:
	status[0] = 1
elif sx > tx:
	status[0] = -1

if sy < ty:
	status[1] = 1
elif sy > ty:
	status[1] = -1


if status[0] == 1 and status[1] == 1:
	for i in range(tx - sx):
		print("R", end="")
	for i in range(ty - sy):
		print("U", end="")
	for i in range(tx - sx):
		print("L", end="")
	for i in range(ty - sy):
		print("D", end="")
	print("L", end="")
	for i in range(ty - sy + 1):
		print("U", end="")
	for i in range(tx - sx + 1):
		print("R", end="")
	print("D", end="")
	print("R", end="")
	for i in range(ty - sy + 1):
		print("D", end="")
	for i in range(tx - sx + 1):
		print("L", end="")
	print("U", end="")

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

distance_x = tx - sx
distance_y = ty - sy


route_str = ''

route_str += 'U' * distance_y
route_str += 'R' * distance_x
route_str += 'D' * distance_y
route_str += 'L' * distance_x

route_str += 'L'
route_str += 'U' * (distance_y + 1)
route_str += 'R' * (distance_x + 1)
route_str += 'D'
route_str += 'R'
route_str += 'D' * (distance_y + 1)
route_str += 'L' * (distance_x + 1)
route_str += 'U'

print(route_str)

Solution (Python):
sx,sy,tx,ty = list(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(ty - sy):
    ans.append("D")
for i in range(tx - sx):
    ans.append("L")

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

Solution (Python):
a,b,c,d=map(int,input().split())
x=c-a;y=d-b
l=['R','L','U','D']
t=''
for j in range(2):
  for i in range(x):
    t+=l[j]
  for i in range(y):
    t+=l[j+2]
for j in range(2):
  t+=l[3-j]
  for i in range(x+1):
    t+=l[j]
  for i in range(y+1):
    t+=l[j+2]
  t+=l[1-j]
print(t)

Solution (Python):
a,b,c,d=map(int,input().split())
x=c-a;y=d-b
l=['R','L','U','D']
t=''
for j in range(2):
  for i in range(x):
    t+=l[j]
  for i in range(y):
    t+=l[j+2]
for j in range(2):
  t+=l[3-j]
  for i in range(x+1):
    t+=l[j]
  for i in range(y+1):
    t+=l[j+2]
  t+=l[1-j]
print(t)

Solution (Python):
sx,sy,tx,ty = list(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(ty - sy):
    ans.append("D")
for i in range(tx - sx):
    ans.append("L")

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

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

output_txt = ''


x1 = tx -sx
if x1 >0:
    txt_x1 = 'R' * x1
else:
    txt_x1 = 'L' * x1
y1 = ty -sy
if y1 >0:
    txt_y1 = 'U' * y1
else:
    txt_y1 = 'D' * y1


if x1 >0:
    txt_x2 = 'L' * x1
else:
    txt_x2 = 'R' * x1
if y1 >0:
    txt_y2 = 'D' * y1
else:
    txt_y2 = 'U' * y1


if y1 >0:
    txt_3 = 'D' 
else:
    txt_3 = 'U'

if x1 >0:
    txt_3 += 'R' * x1 + 'R'
else:
    txt_3 += 'L' * x1 + 'L'

if y1 >0:
    txt_3 += 'U' * y1 + 'U'
else:
    txt_3 += 'D' * y1 + 'D'

if x1 >0:
    txt_3 += 'L'
else:
    txt_3 += 'R'



if y1 >0:
    txt_4 = 'U' 
else:
    txt_4 = 'D'

if x1 >0:
    txt_4 += 'L' * x1 + 'L'
else:
    txt_4 += 'R' * x1 + 'R'

if y1 >0:
    txt_4 += 'D' * y1 + 'D'
else:
    txt_4 += 'U' * y1 + 'U'

if x1 >0:
    txt_4 += 'R'
else:
    txt_4 += 'L'

output_txt = txt_x1 + txt_y1 + txt_x2 + txt_y2
print(output_txt+txt_3+txt_4)

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

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

Solution (Python):
a,b,c,d=map(int,input().split())
s='';t='';p=''
if c-a>=0:
    s+='R'*(c-a);t+='L'*(c-a)
if c-a<0:
    s+='L'*(a-c);t+='R'*(a-c)
if d-b>=0:
    s+='U'*(d-b);t+='D'*(d-b+1)+s[:(c-a)]+s[0]+s[c-a:]+s[-1]
    p+=t[0]+t[-1]+t[0]*(c-a+1)+'D'*(d-b+1)+s[0]
if d-b<0:
    s+='D'*(b-d);t+='U'*(b-d+1)+s[:(c-a)]+s[0]+s[c-a:]+s[-1]
    p+=t[0]+t[-1]+t[0]*(c-a+1)+'U'*(d-b+1)+s[0]
print(s+t+p)

Solution (Python):

import sys


def solve(sx: int, sy: int, tx: int, ty: int):
    x = tx-sx
    y = ty-sy

    print('U'*y+'R'*x
        +'D'*y+'L'*x
        +'L'+'U'*(y+1)+'R'*(x+1)+'D'
        +'R'+'D'*(y+1)+'L'*(x+1)+'U')

    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    sx = int(next(tokens))  
    sy = int(next(tokens))  
    tx = int(next(tokens))  
    ty = int(next(tokens))  
    solve(sx, sy, tx, ty)

if __name__ == '__main__':
    main()

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

for i in range(tx-sx):
    result.append("R")
for i in range(ty-sy):
    result.append("U")

for i in range(tx-sx):
    result.append("L")
for i in range(ty-sy):
    result.append("D")
print("".join(result))

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

Solution (Python):
sx,sy,tx,ty = map(int,input().split())
r = 'R'
l = 'L'
for i in range(tx-sx-1):
    r += 'R'
    l += 'L'
u = 'U'
d = 'D'
for i in range(ty-sy-1):
    u += 'U'
    d += 'D'
ans = r + u + l + d + 'D' + r + 'R' + u + 'U' + 'L' + 'U' + l + 'L' + d + 'D' + 'R'
print(ans)

Solution (Python):

import sys
input = sys.stdin.readline


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

dx = Tx - Sx
dy = Ty - Sy

ans1 = "U"*dy + "R"*dx
ans2 = "D"*dy + "L"*dx
ans3 = "L" + "U"*(dy+1) + "R"*(dx+1) + "D"
ans4 = "R" + "D"*(dy+1) + "L"*(dx+1) + "U"

print(ans1 + ans2 + ans3 + ans4)

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

ans = ""
go = "U"*y+"R"*x
back = "D"*y+"L"*x
a1 = "LU"
a2 = "RDRD"
a3 = "LU"
print(go+back+a1+go+a2+back+a3)

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

s= ""

xlen = tx - sx
ylen = ty - sy


for i in range(xlen):
  s += "R"
for i in range(ylen):
  s +="U"


for i in range(xlen):
  s += "L"
for i in range(ylen):
  s +="D"


s += "D"
for i in range(xlen + 1):
  s += "R"
for i in range(ylen + 1):
  s += "U"
s += "L"


s +="U"
for i in range(xlen + 1):
  s += "L"
for i in range(ylen + 1):
  s +="D"
s += "R"

print(s)

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

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

print(ans)

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

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

xdif=tx-sx
ydif=ty-sy

S="R"*xdif+"U"*ydif+"L"*xdif+"D"*ydif
S=S+"D"+"R"*(xdif+1)+"U"*(ydif+1)+"LU"+"L"*(xdif+1)+"D"*(ydif+1)+"R"
print(S)

Solution (Python):
sx,sy,tx,ty=map(int,input().split())
R_go='R'*(tx-sx)
L_go='L'*(tx-sx)
U_go='U'*(ty-sy)
D_go='D'*(ty-sy)

cycle1=R_go+U_go+L_go+D_go
cycle2_1="D"+R_go+"R"+"U"+U_go+"L"
cycle2_2="U"+L_go+"L"+"D"+D_go+"R"
print(cycle1+cycle2_1+cycle2_2)

Solution (Python):
def examC():
    sx, sy, tx, ty = LI()
    ans = ""
    k = 1
    for _ in range(2):
        if k==-1:
            ans = ans + "L"
            ty +=1; tx +=1

        for _ in range(ty - sy):
            ans = ans + "U"
        for _ in range(tx - sx):
            ans = ans + "R"
        k *= (-1)

        if k==1:
            ans = ans + "D"
            ans = ans + "R"

        for _ in range(ty - sy):
            ans = ans + "D"
        for _ in range(tx - sx):
            ans = ans + "L"

        if k==1:
            ans = ans + "U"
    print("".join(map(str,ans)))

import sys
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def S(): return sys.stdin.readline().strip()
mod = 10**9 + 7
inf = float('inf')

examC()

Solution (Python):
def main():
    sx, sy, tx, ty = (int(i) for i in input().split())
    dx = tx - sx
    dy = ty - sy
    ans = "U" * dy + "R" * dx
    ans = ans + "D" * dy + "L" * dx
    ans = ans + "L" + "U" * (dy+1) + "R" * (dx+1) + "D"
    ans = ans + "R" + "D" * (dy+1) + "L" * (dx+1) + "U"
    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
def main():
    sx, sy, tx, ty = (int(i) for i in input().split())
    x, y = sx, sy
    goal_cnt = 0
    ans = ""
    finished = {(sx, sy)}
    while goal_cnt < 4:
        if goal_cnt % 2 == 0:
            if y < ty and (x, y+1) not in finished:
                y += 1
                ans = ans + "U"
            elif y > ty and (x, y-1) not in finished:
                y -= 1
                ans = ans + "D"
            elif x < tx and (x+1, y) not in finished:
                x += 1
                ans = ans + "R"
            elif x > tx and (x-1, y) not in finished:
                x -= 1
                ans = ans + "L"
            elif y == ty and (x, y+1) not in finished:
                y += 1
                ans = ans + "U"
            elif y == ty and (x, y-1) not in finished:
                y -= 1
                ans = ans + "D"
            elif x == tx and (x+1, y) not in finished:
                x += 1
                ans = ans + "R"
            elif x == tx and (x-1, y) not in finished:
                x -= 1
                ans = ans + "L"
            elif (x, y-1) not in finished:
                y -= 1
                ans = ans + "D"
            elif (x-1, y) not in finished:
                x -= 1
                ans = ans + "L"
            elif (x, y+1) not in finished:
                y += 1
                ans = ans + "U"
            elif (x+1, y) not in finished:
                x += 1
                ans = ans + "R"
            else:
                raise Exception("panic!")
            if x == tx and y == ty:
                goal_cnt += 1
                finished.discard((sx, sy))
                finished.add((tx, ty))
            else:
                finished.add((x, y))
        else:
            if y < sy and (x, y+1) not in finished:
                y += 1
                ans = ans + "U"
            elif y > sy and (x, y-1) not in finished:
                y -= 1
                ans = ans + "D"
            elif x < sx and (x+1, y) not in finished:
                x += 1
                ans = ans + "R"
            elif x > sx and (x-1, y) not in finished:
                x -= 1
                ans = ans + "L"
            elif y == sy and (x, y+1) not in finished:
                y += 1
                ans = ans + "U"
            elif y == sy and (x, y-1) not in finished:
                y -= 1
                ans = ans + "D"
            elif x == sx and (x+1, y) not in finished:
                x += 1
                ans = ans + "R"
            elif x == sx and (x-1, y) not in finished:
                x -= 1
                ans = ans + "L"
            elif (x, y-1) not in finished:
                y -= 1
                ans = ans + "D"
            elif (x-1, y) not in finished:
                x -= 1
                ans = ans + "L"
            elif (x, y+1) not in finished:
                y += 1
                ans = ans + "U"
            elif (x+1, y) not in finished:
                x += 1
                ans = ans + "R"
            else:
                raise Exception("panic!")
            if x == sx and y == sy:
                goal_cnt += 1
                finished.discard((tx, ty))
                finished.add((sx, sy))
            else:
                finished.add((x, y))
    print(ans)


if __name__ == '__main__':
    main()

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

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

Solution (Python):
sx,sy,tx,ty=map(int,input().split())
dx=tx-sx
dy=ty-sy
Dx=abs(dx)
Dy=abs(dy)
val='U'*Dy+'R'*Dx+'D'*Dy+'L'*(Dx+1)+'U'*(Dy+1)+'R'*(Dx+1)+'D'+'R'+'D'*(Dy+1)+'L'*(Dx+1)+'U'
ans_l=[]
for _ in range(len(val)):
	ans_l.append(val[_])
l=len(ans_l)
if dy<0:
	for i in range(l):
		if ans_l[i]=='U':
			ans_l[i]='D'
		elif ans_l[i]=='D':
			ans_l[i]='U'
if dx<0:
	for j in range(l):
		if ans_l[j]=='R':
			ans_l[j]='L'
		elif ans_l[j]=='L':
			ans_l[j]='R'
print("".join(ans_l))

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

dx = tx - sx
dy = ty - sy

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

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

Solution (Python):
sx,sy,tx,ty = (int(x) for x in input().split())
root=''

for i in range(tx-sx):
    root+='R'
for j in range(ty-sy):
    root+='U'

for i in range(tx-sx):
    root+='L'
for j in range(ty-sy):
    root+='D'

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

print(root)

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

Solution (Python):
def func(x1, y1, x2, y2):
    xd = x2 - x1
    yd = y2 - y1
    for i in range(xd):
        print("R", end="")
    for j in range(yd):
        print("U", end="")
    return

def func2(a1, b1, a2, b2):
    ad = a2 - a1
    bd = b2 - b1
    for k in range(ad):
        print("L", end="")
    for l in range(bd):
        print("D", end="")
    
a = list(map(int,input().split()))

func(a[0],a[1],a[2],a[3])
func2(a[0],a[1],a[2],a[3])
print("D", end="")
func(a[0],(a[1] - 1),(a[2] + 1),a[3])
print("L", end="")
print("U", end="")
func2(a[0],(a[1] - 1),(a[2] + 1),a[3])
print("R", end="")

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

Solution (Python):
sx,sy,tx,ty=map(int,input().split())
ans=""
width=tx-sx
length=ty-sy
A,B,C,D="U"*length,"R"*width,"D"*length,"L"*width
for i in range(2):
    if i==0:ans +=A+B+C+D
    else:ans +="L"+A+"UR"+B+"DR"+C+"DL"+D+"U"
print(ans)

Solution (Python):
sx,sy,tx,ty=map(int,input().split())
ans=""
width=tx-sx
length=ty-sy
A="U"*length
B="R"*width
C="D"*length
D="L"*width
for i in range(2):
    if i==0:
        ans +=A+B+C+D
    else:
        ans +="L"+A+"UR"+B+"DR"+C+"DL"+D+"U"
print(ans)

Solution (Python):



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

S = ""

xlen = tx - sx
ylen = ty - sy


for i in range(xlen):
  S += "R"
for i in range(ylen):
  S += "U"
  

for i in range(xlen):
  S += "L"
for i in range(ylen):
  S += "D"


S += "D"
for i in range(xlen + 1):
  S += "R"
for i in range(ylen + 1):
  S += "U"
S += "L"


S += "U"
for i in range(xlen + 1):
  S += "L"
for i in range(ylen + 1):
  S += "D"
S += "R"

print(S)

Solution (Python):


sx, sy, tx, ty = map(int, input().split())
for i in range(2):
    if i > 0:
        [print("L", end="") for j in range(i)]
    [print("U", end="") for y in range(ty - sy + i)]
    [print("R", end="") for x in range(tx - sx + i)]
    if i > 0:
        [print("D", end="") for j in range(i)]
        [print("R", end="") for j in range(i)]
    [print("D", end="") for y in range(ty - sy + i)]
    [print("L", end="") for x in range(tx - sx + i)]
    if i > 0:
        [print("U", end="") for j in range(i)]
print()

Solution (Python):

sx, sy, tx, ty = map(int, input().split())
R = ""
for i in range (tx-sx):
    R = R + "R"
for i in range (ty-sy):
    R = R + "U"
for i in range (tx-sx):
    R = R + "L"
for i in range (ty-sy):
    R = R + "D"
R = R + "D"
for i in range (tx-sx+1):
    R = R + "R"
for i in range (ty-sy+1):
    R = R + "U"
R = R + "LU"
for i in range (tx-sx+1):
    R = R + "L"
for i in range (ty-sy+1):
    R = R + "D"
R = R + "R"
print(R)

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

dx = tx - sx
dy = ty - sy

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

out += "DR"

for i in range(dy+1):
  out += "D"
for i in range(dx+1):
  out += "L"

out += "U"

print(out)

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

dist_x = tx - sx
dist_y = ty - sy

print('R' * dist_x, end='')
print('U' * dist_y, end='')

print('L' * dist_x, end='')
print('D' * dist_y, end='')

print('D', end='')
print('R' * (dist_x + 1), end='')
print('U' * (dist_y + 1), end='')
print('L', end='')

print('U', end='')
print('L' * (dist_x + 1), end='')
print('D' * (dist_y + 1), end='')
print('R', end='')

Solution (Python):


def read_input():
  l = [int(item) for item in input().split()]
  sx = l[0]
  sy = l[1]
  tx = l[2]
  ty = l[3]
  return sx,sy,tx,ty

def main():
  sx,sy,tx,ty = read_input()
  dx = tx - sx
  dy = ty - sy
  s = ''
  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)

  

if __name__ == '__main__':
  main()

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

ans=''
ans+='R'*dx+'U'*dy
ans+='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):


"""
0 0 1 2
UURDDLLUUURRDRDDDLLU
"""

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


[print("U", end="") for y in range(ty - sy)]


[print("R", end="") for x in range(tx - sx)]


[print("D", end="") for y in range(ty - sy)]


[print("L", end="") for x in range(tx - sx)]


print("L", end="")


[print("U", end="") for y in range(ty - sy + 1)]


[print("R", end="") for x in range(tx - sx + 1)]


print("D", end="")


print("R", end="")


[print("D", end="") for y in range(ty - sy + 1)]


[print("L", end="") for x in range(tx - sx + 1)]


print("U", end="")

print()

Solution (Python):
sx, sy, tx, ty = map(int, input().split())
dx, dy = tx-sx, ty-sy
s = ""
s += "U"*dy + "R"*dx + "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())

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

move_x = "R" * dx
move_y = "U" * dy

f_move = move_y + move_x

if "R" in f_move:
  s_move = f_move.replace("R","L")
if "U" in s_move:
  s_move = s_move.replace("U","D")

t_move = "L" + "U" + f_move + "R" + "D"

ff_move = "R" + "D" + s_move + "L" + "U"

total = f_move + s_move + t_move + ff_move  
  
print(total)

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)+"D"+"R"+"D"*(ty-sy+1)+"L"*(tx-sx+1)+"U")

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

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

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

dx = tx - sx
dy = ty - sy

r = ''
for i in range(dy):
  r += 'U'

for i in range(dx):
  r += 'R'
  
for i in range(dy):
  r += 'D'

for i in range(dx):
  r += 'L'

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

print(r)

Solution (Python):
x1,y1,x2,y2=map(int,input().split())
X,Y=x2-x1,y2-y1
print('U'*Y+'R'*X+'D'*Y+'L'*X+'L'+'U'*(Y+1)+'R'*(X+1)+'D'+\
      'R'+'D'*(Y+1)+'L'*(X+1)+'U')

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

dx = tx-sx
dy = ty-sy

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

print(a+b)

Solution (Python):
A = list(map(int, input().split()))
s_1 = ''
if (int(A[0]) < 0) and (int(A[2]) < 0):
  a = abs(int(A[0])) - abs(int(A[2]))
elif (int(A[0]) < 0) and (int(A[2]) > 0):
  a = abs(int(A[0])) + abs(int(A[2]))
else:
  a = int(A[2]) -  int(A[0])
  
if (int(A[1]) < 0) and (int(A[3]) < 0):
  b = abs(int(A[1])) - abs(int(A[3]))
elif (int(A[1]) < 0) and (int(A[3]) > 0):
  b = abs(int(A[1])) + abs(int(A[3]))
else:
  b = int(A[3]) -  int(A[1])

for i in range(b):
  s_1 = s_1 + 'U'
for i in range(a):
  s_1 = s_1 + 'R'
  
for i in range(b):
  s_1 = s_1 + 'D'
for i in range(a):
  s_1 = s_1 + 'L'
  
s_1 = s_1 + 'L'
for i in range(b+1):
  s_1 = s_1 + 'U'
for i in range(a+1):
  s_1 = s_1 + 'R'
s_1 = s_1 + 'D'
  
s_1 = s_1 + 'R'
for i in range(b+1):
  s_1 = s_1 + 'D'
for i in range(a+1):
  s_1 = s_1 + 'L'
s_1 = s_1 + 'U'
print(s_1)

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


main()

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


main()

Solution (Python):
def f(d1, t1, d2, t2):
    print(d1 * t1, end="")
    print(d2 * t2, end="")


def main():
    U, D, L, R = "U", "D", "L", "R"
    sx, sy, tx, ty = map(int, input().split())
    f(R, tx - sx, U, ty - sy)
    f(L, tx - sx, D, ty - sy)
    f(D, 1, "", 0)
    f(R, tx + 1 - sx, U, ty + 1 - sy)
    f(L, 1, "", 0)
    f(U, 1, "", 0)
    f(L, tx + 1 - sx, D, ty + 1 - sy)
    f(R, 1, "", 0)
    print()
    return


main()

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

Solution (Python):
a, b, c, d = map(int, input().split())
S = []
e = c - a
f = d - b
for i in range(f):
    S.append("U")
for i in range(e+1):
    S.append("R")
for i in range(f+1):
    S.append("D")
for i in range(e+1):
    S.append("L")
S.append("U")
S.append("L")
for i in range(f+1):
    S.append("U")
for i in range(e+1):
    S.append("R")
for i in range(f+1):
    S.append("D")
for i in range(e):
    S.append("L")
ans = "".join(S)
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())
a1 = "U"*(ty-sy) + "R"*(tx-sx)
a2 = "D"*(ty-sy) + "L"*(tx-sx)
a3 = "D"+"R"*(tx-sx+1)+"U"*(ty-sy+1)+"L"
a4 = "U"+"L"*(tx-sx+1)+"D"*(ty-sy+1)+"R"
print(a1+a2+a3+a4)

Solution (Python):
sx, sy, tx, ty = [int(coodinate) for coodinate in input().split()]
dx = tx - sx
dy = ty - sy

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

print(ans)

Solution (Python):
sx, sy, tx, ty = [int(coodinate) for coodinate in input().split()]
d_x = tx - sx
d_y = ty - sy

route = []
route.append('U' * d_y + 'R' * d_x)
route.append('D' * d_y + 'L' * d_x)
route.append('L' + 'U' * (d_y + 1) +
    'R' * (d_x + 1) + 'D')
route.append('R' + 'D' * (d_y + 1) + 'L' * (d_x + 1)
    + 'U')

ans = ''.join(route)
print(ans)

Solution (Python):
import sys


def solve(sx: int, sy: int, tx: int, ty: int):
    print("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")
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    sx = int(next(tokens))  
    sy = int(next(tokens))  
    tx = int(next(tokens))  
    ty = int(next(tokens))  
    solve(sx, sy, tx, ty)

if __name__ == '__main__':
    main()

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

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

ans = ["U"] * (ty-sy) \
    + ["R"] * (tx-sx) \
    + ["D"] * (ty-sy) \
    + ["L"] * (tx-sx) \
    + ["D"]\
    + ["R"] * (tx-sx+1)\
    + ["U"] * (ty-sy+1)\
    + ["L", "U"]\
    + ["L"] * (tx-sx+1)\
    + ["D"] * (ty-sy+1)\
    + ["R"]

print("".join(ans))

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

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

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

print(first+second)

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

if x>=0 and y>=0:
  ans=["U"]*y+["R"]*x+["D"]*y+["L"]*x+\
  	  ["L"]+["U"]*(y+1)+["R"]*(x+1)+["D"]+\
      ["R"]+["D"]*(y+1)+["L"]*(x+1)+["U"]
elif x>=0 and y<0:
  y=abs(y)
  ans=["D"]*y+["R"]*x+["U"]*y+["L"]*x+\
  	  ["L"]+["D"]*(y+1)+["R"]*(x+1)+["U"]+\
      ["R"]+["U"]*(y+1)+["L"]*(x+1)+["D"]
elif x<0 and y>=0:
  x=abs(x)
  ans=["U"]*y+["L"]*x+["D"]*y+["R"]*x+\
  	  ["R"]+["U"]*(y+1)+["L"]*(x+1)+["D"]+\
      ["L"]+["D"]*(y+1)+["R"]*(x+1)+["U"]
elif x<0 and y<0:
  x,y=abs(x),abs(y)
  ans=["D"]*y+["L"]*x+["U"]*y+["R"]*x+\
  	  ["R"]+["D"]*(y+1)+["L"]*(x+1)+["U"]+\
      ["L"]+["U"]*(y+1)+["R"]*(x+1)+["D"]
      
      
print("".join(ans))