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 = [int(_) for _ in input().split(' ')]
dx = tx - sx
dy = ty - sy
answer = 'R' * dx + 'U' * dy + 'L' * dx + 'D' * dy
answer += 'D' + 'R' * (dx + 1) + 'U' * (dy + 1) + 'L'
answer += 'U' + 'L' * (dx + 1) + 'D' * (dy + 1) + 'R'
print(answer)

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

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


for i in range(ty) :
    answer.append("U")
for i in range(tx) :
    answer.append("R")
for i in range(ty) :
    answer.append("D")
for i in range(tx) : 
    answer.append("L")


answer.append("L")

for i in range(ty + 1) :
    answer.append("U")
for i in range(tx + 1) :
    answer.append("R")

answer.append("D")
answer.append("R")

for i in range(ty + 1) :
    answer.append("D")
for i in range(tx + 1) :
    answer.append("L")
answer.append("U")

print("".join(answer))

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

start = (int(sx), int(sy))
end = (int(tx), int(ty))
l = list()

for _ in range(abs(int(sy)-int(ty))):
	l.append("U")

for _ in range(abs(int(sx)-int(tx))):
	l.append("R")

for _ in range(abs(int(sy)-int(ty))):
	l.append("D")

for _ in range(abs(int(sx)-int(tx))):
	l.append("L")

l.append("L")

for _ in range(abs(int(sy)-int(ty)) + 1):
	l.append("U")

for _ in range(abs(int(sx)-int(tx)) + 1):
	l.append("R")

l.append("DR")

for _ in range(abs(int(sy)-int(ty)) + 1):
	l.append("D")

for _ in range(abs(int(sx)-int(tx)) + 1):
	l.append("L")

l.append("U")

print("".join(l))

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

start = (int(sx), int(sy))
end = (int(tx), int(ty))
l = list()

for _ in range(abs(int(sy)-int(ty))):
	l.append("U")

for _ in range(abs(int(sx)-int(tx))):
	l.append("R")

for _ in range(abs(int(sy)-int(ty))):
	l.append("D")

for _ in range(abs(int(sx)-int(tx))):
	l.append("L")

l.append("L")

for _ in range(abs(int(sy)-int(ty)) + 1):
	l.append("U")

for _ in range(abs(int(sx)-int(tx)) + 1):
	l.append("R")

l.append("DR")

for _ in range(abs(int(sy)-int(ty)) + 1):
	l.append("D")

for _ in range(abs(int(sx)-int(tx)) + 1):
	l.append("L")

l.append("U")

print("".join(l))

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

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

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

x = tx-sx
y = ty-sy
str = ""

str += "R"*x+ "U"*y+ "L"*x+ "D"*y+ "L"+ "U"*(y+1)+ "R"*(x+1)+"D"+ "R"+ "D"*(y+1)+ "L"*(x+1)+ "U"

print(str)

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


x = tx-sx
y = ty-sy
str = ""

if(x > 0) and (y > 0):
    
    str += "R"*x
    str += "U"*y
    
    str += "L"*x
    str += "D"*y
    
    str += "L"
    str += "U"*(y+1)
    str += "R"*(x+1)
    str += "D"
    
    str += "R"
    str += "D"*(y+1)
    str += "L"*(x+1)
    str += "U"

print(str)

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


x = tx-sx
y = ty-sy
str = ""

if(x > 0) and (y > 0):
    
    str += "R"*x
    str += "U"*y
    
    str += "L"*x
    str += "D"*y
    
    str += "L"
    str += "U"*(y+1)
    str += "R"*(x+1)
    str += "D"
    
    str += "R"
    str += "D"*(y+1)
    str += "L"*(x+1)
    str += "U"

elif(x > 0) and (y < 0):
    
    str += "R"*x
    str += "D"*y
    
    str += "L"*x
    str += "U"*y
    
    str += "L"
    str += "D"*(y+1)
    str += "R"*(x+1)
    str += "U"
    
    str += "R"
    str += "U"*(y+1)
    str += "L"*(x+1)
    str += "D"

elif(x < 0) and (y > 0):
    
    str += "L"*x
    str += "U"*y
    
    str += "R"*x
    str += "D"*y
    
    str += "R"
    str += "U"*(y+1)
    str += "L"*(x+1)
    str += "D"
    
    str += "L"
    str += "D"*(y+1)
    str += "R"*(x+1)
    str += "U"
    
elif(x < 0) and (y < 0):
    
    str += "L"*x
    str += "D"*y
    
    str += "R"*x
    str += "U"*y
    
    str += "R"
    str += "D"*(y+1)
    str += "L"*(x+1)
    str += "U"
    
    str += "L"
    str += "U"*(y+1)
    str += "R"*(x+1)
    str += "D"

elif(x==0) and (y < 0):
    
    str += "D"*y
    
    str += "R"
    str += "U"*y
    str += "L"
    
    str += "L"
    str += "D"*y
    str += "R"
    
    str += "D"
    str += "LL"
    str += "U"*(y+2)
    str += "RR"
    str += "D"

elif(x==0) and (y > 0):
    
    str += "U"*y
    
    str += "R"
    str += "D"*y
    str += "L"
    
    str += "L"
    str += "U"*y
    str += "R"
    
    str += "U"
    str += "LL"
    str += "D"*(y+2)
    str += "RR"
    str += "U"

elif(x > 0) and (y == 0):
    
    str += "R"*x
    
    str += "U"
    str += "L"*x
    str += "D"
    
    str += "D"
    str += "R"*x
    str += "U"
    
    str += "R"
    str += "UU"
    str += "L"*(y+2)
    str += "DD"
    str += "R"
    
elif(x < 0) and (y == 0):
    
    str += "L"*x
    
    str += "U"
    str += "R"*x
    str += "D"
    
    str += "D"
    str += "L"*x
    str += "U"
    
    str += "L"
    str += "UU"
    str += "R"*(y+2)
    str += "DD"
    str += "L"
    
print(str)

Solution (Python):
sx,sy,tx,ty=list(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):
sx,sy,tx,ty=map(int,input().split())
dx = tx-sx
dy = ty-sy
s1 = 'D'+'R'*(dx+1)+'U'*(dy+1)+'L'
s2 = 'U'+'L'*(dx+1)+'D'*(dy+1)+'R'
s3 = 'R'*dx+'U'*dy
s4 = 'L'*dx+'D'*dy
print(s1+s2+s3+s4)

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

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

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,end='')
print('D'+'R'*(1+X) + 'U'*(1+Y) + 'LU'+ 'L'*(1+X) + 'D'*(1+Y)+'R')

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

Solution (Python):
def m():
    sx, sy, tx, ty = map(int, input().split())
    X = tx-sx
    Y = ty-sy
    ans = ""

    
    ans += "U" * Y
    ans += "R" * X
    ans += "D" * Y
    ans += "L" * X

    
    ans += "L"
    ans += "U" * (Y+1)
    ans += "R" * (X+1)
    ans += "D"

    
    ans += "R"
    ans += "D" * (Y+1)
    ans += "L" * (X+1)
    ans += "U"

    return ans


print(m())

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

one = ("U"*(ty-sy))+("R"*(tx-sx))
two = ("D"*(ty-sy))+("L"*(tx-sx))
three = "L"+("U"*(ty-sy+1))+("R"*(tx-sx+1))+"D"
four = "R"+("D"*(ty-sy+1))+("L"*(tx-sx+1))+"U"

print(one+two+three+four)

Solution (Python):
sx,sy,tx,ty = map(int,input().split())
fx,bx = 'RL' if sx < tx else 'LR'
fy,by = 'UD' if sy < ty else 'DU'
dx,dy = abs(sx-tx),abs(sy-ty)
ans = ''
ans += fy*dy + fx*dx
ans += by*dy + bx*(dx+1)
ans += fy*(dy+1) + fx*(dx+1) + by
ans += fx + by*(dy+1) + bx*(dx+1) + fy
print(ans)

Solution (Python):
l = input().split(' ')

y = int(l[3]) - int(l[1])
x = int(l[2]) - int(l[0])

def my_print(i,str):
    for j in range(i):
        print(str,end='')
"""
for i in range(x):
    print('U',end='')

for i in range(y):
    print('R',end='')

for i in range(x):
    print('D',end='')

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

for i in range"
"""
my_print(y,'U')
my_print(x,'R')
my_print(y,'D')
my_print(x+1,'L')
my_print(y+1,'U')
my_print(x+1,'R')
my_print(1,'D')
my_print(1,'R')
my_print(y+1,'D')
my_print(x+1,'L')
my_print(1,'U')


print()

Solution (Python):

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


str1=""
str2=""
for i in range(abs(tx-sx)):
  str1+="R"
  str2+="L"
for i in range(abs(ty-sy)):
  str1+="U"
  str2+="D"


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

str3+="L"
str4+="R"

print("{}{}{}{}".format(str1,str2,str3,str4))

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

fx,bx = 'L','R'
if sx < tx: fx,bx = bx,fx
fy,by = 'D','U'
if sy < ty: fy,by = by,fy

w = abs(sx-tx)
h = abs(sy-ty)

ans = ''
ans += fy * h
ans += fx * w
ans += by * h
ans += bx * (w+1)
ans += fy * (h+1)
ans += fx * (w+1)
ans += by
ans += fx
ans += by * (h+1)
ans += bx * (w+1)
ans += fy

print(ans)

Solution (Python):
x, y, u, v = map(int, input().split())
x=u-x
y=v-y

ans  = "L"+"U"*(y+1)+"R"*(x+1)+"D"
ans += "L"*x+"D"*y
ans += "R"*x+"U"*y
ans += "R" + "D"*(y+1)+"L"*(x+1)+"U"
print(ans)

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

    dx = t_x - s_x
    dy = t_y - s_y

    way = []
    for i in range(2):
        if i == 1:
            way.append("D")

        for j in range(dx+i):
            way.append("R")
        for j in range(dy+i):
            way.append("U")

        if i == 1:
            way.append("L")
            way.append("U")

        for j in range(dx+i):
            way.append("L")
        for j in range(dy+i):
            way.append("D")

        if i == 1:
            way.append("R")

    print("".join(way))


if __name__ == '__main__':
    main()

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

a = tx - sx
b = ty - sy

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

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

print(kei)

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

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

route1 = ["R"] * (x2 - x1) + ["U"] * (y2 - y1)
route2 = ["L"] * (x2 - x1) + ["D"] * (y2 - y1)
route3 = ["D"] + ["R"] * (x2 - x1 + 1) + ["U"] * (y2 - y1 + 1) + ["L"]
route4 = ["U"] + ["L"] * (x2 - x1 + 1) + ["D"] * (y2 - y1 + 1) + ["R"]
route = route1 + route2 + route3 + route4
print("".join(route))

Solution (Python):
a,b,c,d=map(int,input().split())
x=c-a
y=d-b
s=["U"]*y+["R"]*x
t=["D"]*y+["L"]*x
q=s+t+["L"]+["U"]+s+["R"]+["D"]+["R"]+["D"]+t+["L"]+["U"]
print("".join(q))

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

Solution (Python):
in1 = list(map(int,input().split()))
x = in1[2]-in1[0]
y = in1[3]-in1[1]
r = ""
for i in range(y):
  r+= "U"
for i in range(x):
  r+= "R"
for i in range(y):
  r+= "D"
for i in range(x):
  r+= "L"
r+= "L"
for i in range(y+1):
  r+= "U"
for i in range(x+1):
  r+= "R"
r+="D"
r+="R"
for i in range(y+1):
  r+= "D"
for i in range(x+1):
  r+= "L"
r+="U"
print(r)

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

Solution (Python):
s = [0]*2
t = [0]*2
s[0],s[1],t[0],t[1] = map(int,input().split())
ans = 'R'*(t[0]-s[0])+'U'*(t[1]-s[1])+'L'*(t[0]-s[0])+'D'*(t[1]-s[1])+\
'D'+'R'*(t[0]-s[0]+1)+'U'*(t[1]-s[1]+1)+'L'+'U'+'L'*(t[0]-s[0]+1)+'D'*(t[1]-s[1]+1)+'R'
print(ans)

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

gx = ''
gy = ''
bx = ''
by = ''

for i in range(0, tx-sx):
	gx = gx + 'R'
	bx = bx + 'L'
for i in range(0, ty-sy):
	gy = gy + 'U'
	by = by + 'D'

print gx + gy + bx + by + 'D' + gx + 'RU' + gy + 'LU' + bx + 'LD' + by + 'R'

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

Solution (Python):
from itertools import chain

def main():
    SX, SY, TX, TY = map(int, input().split())

    ud = TY - SY
    lr = TX - SX
    move1 = (('U', ud), ('R', lr))
    move2 = (('D', ud), ('L', lr))
    move3 = (('L', 1), ('U', ud + 1), ('R', lr + 1), ('D', 1))
    move4 = (('R', 1), ('D', ud + 1), ('L', lr + 1), ('U', 1))
    for a, b in chain(move1, move2, move3, move4):
        print(a * b, end='')
    print()

main()

Solution (Python):
sx, sy, tx, ty = map(int, input().split(" "))
tx -= sx
ty -= sy
sx = 0
sy = 0
line = []
for i in range(tx):
    line.append("R")
for i in range(ty):
    line.append("U")
for i in range(tx):
    line.append("L")
for i in range(ty):
    line.append("D")
line.append("D")
for i in range(tx+1):
    line.append("R")
for i in range(ty+1):
    line.append("U")
line.append("L")
line.append("U")
for i in range(tx+1):
    line.append("L")
for i in range(ty+1):
    line.append("D")
line.append("R")
for i in range(len(line)):
    if i<len(line):
        print(line[i], end = "")
    else:
        print(line[i])

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

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

print(route)

Solution (Python):
sx, sy, tx, ty = map(int, input().split(" "))
tx -= sx
ty -= sy
sx = 0
sy = 0
line = []
for i in range(tx):
    line.append("R")
for i in range(ty):
    line.append("U")
for i in range(tx):
    line.append("L")
for i in range(ty):
    line.append("D")
line.append("D")
for i in range(tx+1):
    line.append("R")
for i in range(ty+1):
    line.append("U")
line.append("L")
line.append("U")
for i in range(tx+1):
    line.append("L")
for i in range(ty+1):
    line.append("D")
line.append("R")
for i in range(len(line)):
    if i<len(line):
        print(line[i], end = "")
    else:
        print(line[i])

Solution (Python):
Sx,Sy,Tx,Ty = map(int,input().split())
Dx,Dy = abs(Tx-Sx),abs(Ty-Sy)
S = ""

moveX,moveY = [],[]
if Dx > 0:
    moveX = ["R","L","R","L"] 
elif Dx < 0:
    moveX = ["L","R","L","R"]
if Dy > 0:
    moveY = ["U","D","U","D"]
elif Dy < 0:
    moveY = ["D","U","D","U"]

S += moveY[0]*Dy + moveX[0]*Dx
S += moveY[1]*Dy + moveX[1]*Dx
S += moveX[1] + moveY[0]*(Dy+1) + moveX[0]*(Dx+1) + moveY[1]
S += moveX[0] + moveY[1]*(Dy+1) + moveX[1]*(Dx+1) + moveY[0]

print(S)

Solution (Python):

line = input().split(" ")
sx = int(line[0])
sy = int(line[1])
tx = int(line[2])
ty = int(line[3])

ret = []

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


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


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


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

print("".join(ret))

Solution (Python):
nums = [int(x) for x in input().split()]
sx,sy,tx,ty = nums[0],nums[1],nums[2],nums[3]

dx = tx - sx
dy = ty - sy
ans = []

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())
ans = str()
for i in range(ty - sy):
    ans += "U"
for j in range(tx - sx):
    ans += "R"
for k in range(ty - sy):
    ans += "D"
for l in range(tx - sx):
    ans += "L"
ans += "L"
for i in range(ty - sy + 1):
    ans += "U"
for j in range(tx - sx + 1):
    ans += "R"
ans += "D"
ans += "R"
for k in range(ty - sy + 1):
    ans += "D"
for l in range(tx - sx + 1):
    ans += "L"
ans += "U"
print(ans)

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

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

Solution (Python):
sx,sy,tx,ty = map(int,input().split())
dx, dy = tx-sx, ty-sy
ans = ''
for i in range(2):
    for x in range(dx):
        if i==0:
            ans += 'R'
        else:
            ans += 'L'
    for y in range(dy):
        if i==0:
            ans += 'U'
        else:
            ans += 'D'
for i in range(2):
    if i==0:
        ans += 'L'
    else:
        ans += 'R'
    for y in range(dy+1):
        if i==0:
            ans += 'U'
        else:
            ans += 'D'
    for x in range(dx+1):
        if i==0:
            ans += 'R'
        else:
            ans += 'L'
    if i==0:
        ans += 'D'
    else:
        ans += 'U'
print(ans)

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

Solution (Python):
xy=[int(i) for i in input().split()]
a=abs(xy[2]-xy[0])
b=abs(xy[3]-xy[1])

ans="U"*b+"R"*a+"D"*b+"L"*a+"L"+"U"*(b+1)+"R"*(a+1)+"D"+"R"+"D"*(b+1)+"L"*(a+1)+"U"

print(ans)

Solution (Python):

inline = list(map(int,input().split()))
sx = inline[0]
sy = inline[1]
tx = inline[2]
ty = inline[3]

h = sy-ty
w = sx-tx

for i in range(abs(h)):
    if h > 0:
        print("D",end = "")
    else:
        print("U",end="")

for i in range(abs(w)):
    if w > 0:
        print("L",end = "")
    else:
        print("R",end="")

for i in range(abs(h)):
    if h < 0:
        print("D",end = "")
    else:
        print("U",end="")

for i in range(abs(w)):
    if w < 0:
        print("L",end = "")
    else:
        print("R",end="")

if h>0:
    print("U",end="")
else:
    print("D",end="")

for i in range(abs(w)+1):
    if w > 0:
        print("L",end = "")
    else:
        print("R",end="")
for i in range(abs(h)+1):
    if h > 0:
        print("D",end = "")
    else:
        print("U",end="")

if w>0:
    print("R",end="")
else:
    print("L",end="")

if h<0:
    print("U",end="")
else:
    print("D",end="")

for i in range(abs(w)+1):
    if w < 0:
        print("L",end = "")
    else:
        print("R",end="")
for i in range(abs(h)+1):
    if h < 0:
        print("D",end = "")
    else:
        print("U",end="")

if w<0:
    print("R")
else:
    print("L")

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

ans = "U" * Y + "R" * X
ans += "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('U'*(ty-sy)+'R'*(tx-sx)+'D'*(ty-sy)+'L'*(tx-sx)+'LU'+'U'*(ty-sy)+'R'*(tx-sx)+'RDRD'+'D'*(ty-sy)+'L'*(tx-sx)+'LU')

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

Solution (Python):
a,b,c,d = (int(i) for i in input().split())
x,y = c-a,d-b
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):
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()

def main():
    sx,sy,tx,ty = na()
    ret = ""
    for i in range(tx-sx):
        ret += "R"
    for i in range(ty-sy):
        ret += "U"
    for i in range(tx-sx):
        ret += "L"
    for i in range(ty-sy):
        ret += "D"
    ret += "L"
    for i in range(ty-sy+1):
        ret += "U"
    for i in range(tx-sx+1):
        ret += "R"
    ret += "D"
    ret += "R"
    for i in range(ty-sy+1): ret += "D"
    for i in range(tx-sx+1): ret += "L"
    ret += "U"
    print(ret)
    pass


if __name__ == "__main__":
    main()

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

Solution (Python):
sx, sy, tx, ty = [int(x) for x in input().split()]
dx = tx - sx
dy = ty - sy
print('U' * dy + 'R' * dx + 'D' * dy + 'L' * dx + 'L' + '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())
movelist = ['U','D','L','R']
moved = []
countX = tx - sx
countY = ty - sy

for y in range (0, countY):
    moved.append(movelist[0])

for x in range (0, countX):
    moved.append(movelist[3])

for y in range (0, countY):
    moved.append(movelist[1])

for x in range (0, countX):
    moved.append(movelist[2])

moved.append(movelist[2])

for y in range (0, countY+1):
    moved.append(movelist[0])

for x in range (0, countX+1):
    moved.append(movelist[3])

moved.append(movelist[1])

moved.append(movelist[3])

for y in range (0,countY+1):
    moved.append(movelist[1])

for x in range (0, countX+1):
    moved.append(movelist[2])

moved.append(movelist[0])

print("".join(moved))

Solution (Python):

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

Solution (Python):
sx, sy, tx, ty = map(int, input().split())
a = ''
x = tx - sx
y = ty - sy
for i in range(y):
    a+='U'
    
for i in range(x):
    a+='R'

for i in range(y):
    a+='D'

for i in range(x+1):
    a+='L'

for i in range(y+1):
    a+='U'

for i in range(x+1):
    a+='R'

a+='D'
a+='R'
for i in range(y+1):
    a+='D'

for i in range(x+1):
    a+='L'

a+='U'
print(a)

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

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

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

Solution (Python):
lis = list(map(int, input().split()))
a=lis[0]
b=lis[1]
c=lis[2]
d=lis[3]
x=c-a
y=d-b
 
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+1):
    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):
x, y, tx, ty = map(int, input().split())

x_diff = tx - x
y_diff = ty - y

first_x_diff = "R" * abs(x_diff) if x_diff > 0 else "L" * abs(x_diff)
first_y_diff = "U" * abs(y_diff) if y_diff > 0 else "D" * abs(y_diff)

first_diff = first_x_diff + first_y_diff
tmp_diff = first_diff.replace("R", "L")
tmp_diff = tmp_diff.replace("U", "D")
first_diff = first_diff + tmp_diff

second_x_diff = "R" * abs(x_diff + 1) if x_diff > 0 else "L" * abs(x_diff + 1)
second_y_diff = "U" * abs(y_diff + 1) if y_diff > 0 else "D" * abs(y_diff + 1)

second_diff = second_x_diff + second_y_diff
tmp_diff = second_diff.replace("R", "L")
tmp_diff = tmp_diff.replace("U", "D")
second_diff = "D" + second_diff + "L" + "U" + tmp_diff + "R"

res = first_diff + second_diff
print(res)

Solution (Python):
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()

def main():
    sx,sy,tx,ty = na()
    ret = ""
    for i in range(tx-sx):
        ret += "R"
    for i in range(ty-sy):
        ret += "U"
    for i in range(tx-sx):
        ret += "L"
    for i in range(ty-sy):
        ret += "D"
    ret += "L"
    for i in range(ty-sy+1):
        ret += "U"
    for i in range(tx-sx+1):
        ret += "R"
    ret += "D"
    ret += "R"
    for i in range(ty-sy+1): ret += "D"
    for i in range(tx-sx+1): ret += "L"
    ret += "U"
    print(ret)
    pass


if __name__ == "__main__":
    main()

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

Solution (Python):
sx,sy,tx,ty = map(int,input().split(" "))
dx = ['R','L']
dy = ['U','D']

ans = dx[0] * (tx-sx) + dy[0] * (ty - sy)
ans += dx[1] * (tx-sx) + dy[1] * (ty - sy)
ans += (dy[1] + dx[0] * (tx-sx+1) + dy[0] * (ty - sy + 1) + dx[1])
ans += (dy[0] + dx[1] * (tx-sx+1) + dy[1] * (ty - sy + 1) + dx[0])

print(ans)

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

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

ans += 'U' * abs(ty - sy)
ans += 'R' * abs(tx - sx)

ans += 'D' * abs(ty - sy)
ans += 'L' * abs(tx - sx)

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

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

Solution (Python):

def inpl(): return list(map(int, input().split()))

sx, sy, tx, ty = inpl()
res = ""

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

print(res)

Solution (Python):
def main():
    """
    1 秒あたり上下左右に距離 1 だけ進むことができます
    sx<tx と sy<ty を満たす点 
    (sx,sy)->(tx,ty)->(sx,sy)->(tx,ty)->(sx,sy)
    (sx,sy) と点(tx,ty) を除いて、途中で同じ座標を複数回通らないように移動しなければなりません。

    −1000≦sx<tx≦1000
    −1000≦sy<ty≦1000

    最短距離: マンハッタン距離
    to (tx,ty)N=1: 最短距離OK
    to (sx,sy)N=2: 最短距離OK
    to (tx,ty)N=3: 最短距離NG
    to (sx,sy)N=4: 最短距離NG
    """
    sx, sy, tx, ty = map(int, input().split())

    diff_x = tx - sx
    diff_y = ty - sy
    
    
    
    
    route = [
        "U" * diff_y + "R" * diff_x,
        "D" * diff_y + "L" * diff_x,
        "L" + "U" * (diff_y + 1) + "R" * (diff_x + 1) + "D",
        "R" + "D" * (diff_y + 1) + "L" * (diff_x + 1) + "U",
    ]
    for r in route:
        print(r, end="")
    print("")

if __name__ == '__main__':
    main()

Solution (Python):
x,y,sx,sy=map(int,raw_input().split())


a=[]


for i in range(sy-y):
	a.append("U")
for i in range(sx-x):
	a.append("R")

for i in range(sy-y):
	a.append("D")
for i in range(sx-x):
	a.append("L")



a.append("L")
for i in range((sy+1)-y):
	a.append("U")
for i in range(sx-(x-1)):
	a.append("R")
a.append("D")


a.append("R")
for i in range(sy-(y-1)):
	a.append("D")
for i in range((sx+1)-x):
	a.append("L")
a.append("U")


print "".join(a)

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

    print("D", end="")

    for _ in range(t_x - s_x + 1):
        print("R", end="")
    for _ in range(t_y - s_y + 1):
        print("U", end="")

    print("L", end="")
    print("U", end="")

    for _ in range(t_x - s_x + 1):
        print("L", end="")
    for _ in range(t_y - s_y + 1):
        print("D", end="")

    print("R", end="")

    for _ in range(t_x - s_x):
        print("R", end="")
    for _ in range(t_y - s_y):
        print("U", end="")
    for _ in range(t_x - s_x):
        print("L", end="")
    for _ in range(t_y - s_y):
        print("D", end="")


solve()

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 +
      'L' + 'U' * (dy + 1) + 'R' * (dx + 1) + 'D' +
      'R' + 'D' * (dy + 1) + 'L' * (dx + 1) + 'U')