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())

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

print(ans)

Solution (Python):
sx,sy,tx,ty = map(int,input().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=[int(i) for i in input().split()]
x=tx-sx
y=ty-sy

procedure=[]

for i in range(x):
    procedure.append("R")
for i in range(y):
    procedure.append("U")
for i in range(x):
    procedure.append("L")
for i in range(y):
    procedure.append("D")
    

procedure.append("D")
for i in range(x+1):
    procedure.append("R")
for i in range(y+1):
    procedure.append("U")
procedure.append("L")
procedure.append("U")
for i in range(x+1):
    procedure.append("L")
for i in range(y+1):
    procedure.append("D")
procedure.append("R")

print("".join(procedure))

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

Solution (Python):
a,b,c,d = map(int, input().split())
x = c-a
y = d-b
y1=''
y2=''
for i in range(y):
  y1+='U'
  y2+='D'
x1=''
x2=''
for i in range(x):
  x1+='R'
  x2+='L'
print(y1+x1+y2+x2+'L'+y1+'UR'+x1+'DR'+y2+'DL'+x2+'U')

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

tx -= sx
ty -= sy

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

Solution (Python):

import sys
import math
from collections import defaultdict


sys.setrecursionlimit(10**7)
def input():
  return sys.stdin.readline()[:-1]


mod = 10**9 + 7


def I(): return int(input())
def II(): return map(int, input().split())
def III(): return list(map(int, input().split()))
def Line(N):
  read_all = [tuple(map(int, input().split())) for _ in range(N)]
  return map(list,zip(*read_all))



sx,sy,tx,ty = II()

move = ['U']*(ty-sy) + ['R']*(tx-sx) + ['D']*(ty-sy) + ['L']*(tx-sx)
move2 = ['L'] + ['U']*(ty-sy+1) + ['R']*(tx-sx+1) + ['D'] + \
        ['R'] + ['D']*(ty-sy+1) + ['L']*(tx-sx+1) + ['U']

ans = move+move2
print(*ans,sep='')

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

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

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

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

dx = tx - sx
dy = ty - sy

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

print(ans)

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

dx = tx -sx
dy = ty -sy

c = ['U', 'D', 'L', 'R']

print(c[0]*dy+c[3]*dx+c[1]*dy+c[2]*dx 
 + c[2] + c[0]*(dy+1) +c[3]*(dx+1) + c[1] 
 + c[3] + c[1]*(dy+1) + c[2]*(dx+1) + c[0])

Solution (Python):
sx, sy, tx, ty = map(int, input().split())
x_plus = tx - sx
y_plus = ty - sy
first_go = 'R'*x_plus + 'U'*y_plus
first_back = 'L'*x_plus + 'D'*y_plus
second_go = 'DR' + first_go + 'UL'
second_back = 'UL' + first_back + 'DR'
print(first_go + first_back + second_go + second_back)

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):
sx,sy,tx,ty  = list(map(int,input().split()))
string = ""  
if sy == ty:
  string += "R"*(tx-sx)
  string += "D"+"L"*(tx-sx)+"U"
  string += "U"+"R"*(tx-sx)+"D"
  string += "RUU"+"L"*(tx-sx+2)+"DDR"
  if sx > tx:
    string.replace("R","X").replace("L","R").replace("X","L")
elif sy == ty:
  string += "U"*(tx-sx)
  string += "R"+"D"*(tx-sx)+"L"
  string += "L"+"U"*(tx-sx)+"R"
  string += "ULL"+"D"*(tx-sx+2)+"RRU"
  if sy > ty:
    string.replace("D","X").replace("U","D").replace("X","U")
else:
  g = []
  if sx<tx:
    g += ["R","L"]
  else:
    g += ["L","R"]
  
  if sy<ty:
    g += ["U","D"]
  else:
    g += ["D","U"]
  
  dx,dy = abs(tx-sx),abs(ty-sy)
  
  string += g[0]*dx+g[2]*dy
  string += g[1]*dx+g[3]*dy
  string += g[3]+g[0]+g[0]*dx+g[2]*dy+g[2]+g[1]
  string += g[2]+g[1]+g[1]*dx+g[3]*dy+g[3]+g[0]
  
print(string)

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

dx = abs(tx -  sx)
dy = abs(ty - sy)
print("U" * dy + "R" * dx + "D" * dy + "L" * dx, end="")
print("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())
diff_x = tx-sx
diff_y = ty-sy

ans = ''
ans += 'U'*abs(diff_y) if diff_x>0 else 'D'*abs(diff_y) 
ans += 'R'*abs(diff_x+1) if diff_x>0 else 'L'*abs(diff_x+1) 
ans += 'U'*(abs(diff_y)+1) if diff_x<0 else 'D'*(abs(diff_y)+1) 
ans += 'R'*abs(diff_x+1) if diff_x<0 else 'L'*abs(diff_x+1) 
ans += 'U' if diff_x>0 else 'D' 
ans += 'R' if diff_x<0 else 'L' 

ans += 'U'*abs(diff_y+1) if diff_x>0 else 'D'*abs(diff_y+1) 
ans += 'R'*abs(diff_x+1) if diff_x>0 else 'L'*abs(diff_x+1) 

ans += 'U'*(abs(diff_y)+1) if diff_x<0 else 'D'*(abs(diff_y)+1) 
ans += 'R'*abs(diff_x) if diff_x<0 else 'L'*abs(diff_x) 
print(ans)

Solution (Python):
sx, sy, tx, ty = [int(x) for x in input().split()]
x = tx - sx
y = ty - sy
l = ["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("".join(l))

Solution (Python):
def move(direction, x, y):
    tmp_x, tmp_y = x, y
    if direction == 'U': tmp_y += 1
    if direction == 'D': tmp_y -= 1
    if direction == 'L': tmp_x -= 1
    if direction == 'R': tmp_x += 1
    print(direction, end = '')
    return tmp_x, tmp_y

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

x, y = sx, sy


while x != tx:
    x, y = move('R', x, y)
while y != ty:
    x, y = move('U', x, y)

while x != sx:
    x, y = move('L', x, y)
while y != sy:
    x, y = move('D', x, y)

x, y = move('D', x, y)
while x != tx:
    x, y = move('R', x, y)
x, y = move('R', x, y)
while y != ty:
    x, y = move('U', x, y)
x, y = move('L', x, y)

x, y = move('U', x, y)
while x != sx:
    x, y = move('L', x, y)
x, y = move('L', x, y)
while y != sy:
    x, y = move('D', x, y)
x, y = move('R', x, y)

print('')

Solution (Python):
sx,sy,tx,ty=map(int,input().split())
x=tx-sx
y=ty-sy
l=["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("".join(l))

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

gx, gy = tx-sx, ty-sy

r1 = 'U'*gy + 'R'*gx
r2 = 'D'*gy + 'L'*gx
r3 = 'L' + 'U'*(gy+1) + 'R'*(gx+1) + 'D'
r4 = 'R' + 'D'*(gy+1) + 'L'*(gx+1) + 'U'
print(r1 + r2 + r3 + r4)

Solution (Python):
sx, sy, tx, ty = (int(x) for x in input().split())
print_list = []

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

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

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

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

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


for _ in range(dx):
	res.append("R")
for _ in range(dy):
	res.append("U")
for _ in range(dx):
	res.append("L")
for _ in range(dy):
	res.append("D")

res.append("L")
for _ in range(dy+1):
	res.append("U")
for _ in range(dx+1):
	res.append("R")
res.append("D")

res.append("R")
for _ in range(dy+1):
	res.append("D")
for _ in range(dx+1):
	res.append("L")
res.append("U")
print("".join(res))

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


for i in range(ty - sy):
    print("U", end="")

for i in range(tx - sx):
    print("R", end="")

for i in range(ty - sy):
    print("D", end="")

for i in range(tx - sx + 1):
    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):


def main():
    a, b, c, d = map(int, input().split())

    for i in range(d - b):
        print('U', end='')

    for i in range(c - a):
        print('R', end='')

    for i in range(d - b):
        print('D', end='')

    for i in range(c - a):
        print('L', end='')

    print('L', end='')

    for i in range(d - b + 1):
        print('U', end='')

    for i in range(c - a + 1):
        print('R', end='')

    print('D', end='')

    print('R', end='')

    for i in range(d - b + 1):
        print('D', end='')

    for i in range(c - a + 1):
        print('L', end='')

    print('U')




if __name__ == '__main__':
    main()

Solution (Python):
a,b,c,d=map(int,input().split())
x,y=c-a,d-b
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,dy = (tx-sx),(ty-sy)
p1 = "U"*dy+"R"*dx
p2 = "D"*dy+"L"*dx
p3 = "L"+"U"*(dy+1)+"R"*(dx+1)+"D"
p4 = "R"+"D"*(dy+1)+"L"*(dx+1)+"U"
print(p1+p2+p3+p4)

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

Solution (Python):
import sys
import math

sys.setrecursionlimit(1000)
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def LIST(): return [int(x) for x in input().split()]
MOD = 10**9 + 7

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

trace = ""


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


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


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


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

print(trace)

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

x=tx-sx
y=ty-sy

r="R"
d="D"
u="U"
l="L"


ans=""

ans+=(r*abs(x))
ans+=(u*abs(y))
ans+=(l*abs(x))
ans+=(d*abs(y))
ans+=(d)
ans+=(r*abs(x+1))
ans+=(u*abs(y+1))
ans+=(l)
ans+=(u)
ans+=(l*abs(x+1))
ans+=(d*abs(y+1))
ans+=(r)


print(ans)

Solution (Python):

def main():
    sx,sy,tx,ty = map(int,input().split())
    subx = tx-sx
    suby = ty-sy
    if subx>=0:
        ls1 = "R"*subx
        ls3 = "L"*subx
    else:
        ls1 = "L"*(-subx)
        ls3 = "R"*(-subx)
    if suby>=0:
        ls2 = "U"*suby
        ls4 = "D"*suby
    else:
        ls2 = "D"*(-suby)
        ls4 = "U"*(-suby)
    first = ls1 + ls2 + ls3 + ls4
    second = ls4[0] + (ls1 + ls1[0]) + (ls2 + ls2[0]) + ls3[0] + ls2[0] + (ls3 + ls3[0]) + (ls4 + ls4[0]) + ls1[0]
    ans = first + second
    print("".join(ans))
    
if __name__ == "__main__":
    main()

Solution (Python):

from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
import itertools
sys.setrecursionlimit(10**5)
stdin = sys.stdin
bisect_left = bisect.bisect_left
bisect_right = bisect.bisect_right
def LI(): return list(map(int, stdin.readline().split()))
def LF(): return list(map(float, stdin.readline().split()))
def LI_(): return list(map(lambda x: int(x)-1, stdin.readline().split()))
def II(): return int(stdin.readline())
def IF(): return float(stdin.readline())
def LS(): return list(map(list, stdin.readline().split()))
def S(): return list(stdin.readline().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')


def A():
    a = input()
    print(" ".join(a.split(",")))
    return


def B():
    k, s = LI()
    ans = 0
    for i in range(k + 1):
        for j in range(k + 1):
            if 0 <= s - (i + j) <= k:
                ans += 1
    print(ans)
    return


def C():
    sx, sy, tx, ty = LI()
    UD = ("U", "D")
    LR = ("R", "L")
    ans = UD[sy > ty] * (abs(sy - ty)) + LR[sx > tx] * (abs(sx - tx))
    ans += UD[ty > sy] * (abs(sy - ty)) + LR[tx > sx] * (abs(sx - tx))
    ans += LR[tx > sx] + UD[sy > ty] * (abs(sy - ty) + 1) + LR[sx > tx] * (abs(sx - tx) + 1) + UD[ty > sy]
    ans += LR[sx > tx] + UD[ty > sy] * (abs(sy - ty) + 1) + LR[tx > sx] * (abs(sx - tx) + 1) + UD[sy > ty]
    print(ans)
    return


def D():
    return


if __name__ == '__main__':
    C()

Solution (Python):
sx, sy, tx, ty = [int(x) for x in input().split()]
fw = tx - sx
fh = ty - sy
print("R"*fw + "U"*fh + "L"*fw + "D"*fh + "D" + "R"*(fw+1) + "U"*(fh+1) + "LU" + "L"*(fw+1) + "D"*(fh+1) + "R")

Solution (Python):



tmp = input().split()
hoge = list(map(lambda a: int(a), tmp))
sx=hoge[0]
sy=hoge[1]
tx=hoge[2]
ty=hoge[3]


ans = ""

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

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

for i in range(0,tx-sx):
	ans+="R"
for i in range(0,ty-sy):
	ans+="U"

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

print(ans)

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

def solve(tx, ty):
    res = []
    for i in range(1, ty):
        res.append("U")
    for i in range(1, tx):
        res.append("R")
    for i in range(ty, 1, -1):
        res.append("D")
    for i in range(tx, 1, -1):
        res.append("L")
    res += "L"
    for i in range(1, ty + 1):
        res.append("U")
    for i in range(0, tx):
        res.append("R")
    res += "DR"
    for i in range(ty, 0, -1):
        res.append("D")
    for i in range(tx, 0, -1):
        res.append("L")
    res.append("U")
    return "".join(res)
print solve(tx, ty)

Solution (Python):
sx, sy, tx, ty = map(int, input().split())
up = "U" * (ty - sy)
right = "R" * (tx - sx)
down = up.replace("U", "D")
left = right.replace("R", "L")
first = up + right + down + left
second = "LU" + up + right + "RDRD" + down + left + "LU"
print(first+second)

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

rangex = tx-sx
rangey = ty-sy

for y in range(rangey):
  print("U", end="")
for x in range(rangex):
  print("R", end="")


for y in range(rangey):
  print("D", end="")
for x in range(rangex):
  print("L", end="")

  
print("L", end="")
for y in range(rangey + 1):
  print("U", end="")
for x in range(rangex + 1):
  print("R", end="")

print("D", end="")


print("R", end="")
for y in range(rangey + 1):
  print("D", end="")
for x in range(rangex+1):
  print("L", end="")

print("U", end="")

Solution (Python):
def solve(dx, dy):
    a = 'U'*dy+'R'*dx
    b = 'D'*dy+'L'*dx
    c = 'L'+'U'*(dy+1)+'R'*(dx+1)+'D'
    d = 'R'+'D'*(dy+1)+'L'*(dx+1)+'U'
    return a+b+c+d


if __name__ == '__main__':
    sx, sy, tx, ty = map(int, input().split())
    dx = abs(tx-sx)
    dy = abs(ty-sy)
    print(solve(dx, dy))

Solution (Python):

import sys
sys.setrecursionlimit(300000)


def solve(sx: int, sy: int, tx: int, ty: int):
    ret = ''
    ret += 'U' * (ty - sy)
    ret += 'R' * (tx - sx)
    ret += 'D' * (ty - sy)
    ret += 'L' * (tx - sx + 1)
    ret += 'U' * (ty - sy + 1)
    ret += 'R' * (tx - sx + 1)
    ret += 'D'
    ret += 'R'
    ret += 'D' * (ty - sy + 1)
    ret += 'L' * (tx - sx + 1)
    ret += 'U'
    print(ret)
    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())
x=tx-sx
y=ty-sy
ans=""
ans+="U"*y
ans+="R"*x
ans+="D"*y
ans+="L"*(x+1)
ans+="U"*(y+1)
ans+="R"*(x+1)
ans+="DR"
ans+="D"*(y+1)
ans+="L"*(x+1)
ans+="U"
print(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+1):
    ans += 'L'
for _ in range(ty-sy+1):
    ans += 'U'
for _ in range(tx-sx+1):
    ans += 'R'
ans += 'D'
ans += 'R'
for _ in range(ty-sy+1):
    ans += 'D'
for _ in range(tx-sx+1):
    ans += 'L'
ans += 'U'
print(ans)

Solution (Python):



def main():
    sx, sy, tx, ty = map(int, input().split())
    first = list()
    second = list()

    for y in range(ty - sy):
        first.append('U')
        second.append('D')

    for x in range(tx - sx):
        first.append('R')
        second.append('L')

    third = ['L', 'U'] + first + ['R', 'D']
    fourth = ['R', 'D'] + second + ['L', 'U']

    print(''.join(map(str, first + second + third + fourth)))


if __name__ == '__main__':
    main()

Solution (Python):



def main():
    sx, sy, tx, ty = map(int, input().split())
    x_count = abs(tx - sx)
    y_count = abs(ty - sy)
    first = list()
    second = list()

    for y in range(y_count):
        first.append('U')

    for x in range(x_count):
        first.append('R')

    for y in range(y_count):
        second.append('D')

    for x in range(x_count):
        second.append('L')

    third = ['L', 'U'] + first + ['R', 'D']
    fourth = ['R', 'D'] + second + ['L', 'U']

    print(''.join(map(str, first + second + third + fourth)))


if __name__ == '__main__':
    main()

Solution (Python):



def main():
    sx, sy, tx, ty = map(int, input().split())
    x_count = abs(tx - sx)
    y_count = abs(ty - sy)
    first = list()
    second = list()

    for y in range(y_count):
        first.append('U')

    for x in range(x_count):
        first.append('R')

    for y in range(y_count):
        second.append('D')

    for x in range(x_count):
        second.append('L')

    third = ['L', 'U'] + first + ['R', 'D']
    fourth = ['R', 'D'] + second + ['L', 'U']

    print(''.join(map(str, first + second + third + fourth)))


if __name__ == '__main__':
    main()

Solution (Python):


import sys
import copy

sys.setrecursionlimit(1000000)





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

ans = ""

for i in range(abs(ty - sy)):
    ans += 'U'

for i in range(abs(tx - sx)):
    ans += 'R'

for i in range(abs(ty - sy)):
    ans += 'D'

for i in range(abs(tx - sx)):
    ans += 'L'

ans += 'L'

for i in range(abs(ty - sy) + 1):
    ans += 'U'

for i in range(abs(tx - sx) + 1):
    ans += 'R'

ans += 'D'
ans += 'R'

for i in range(abs(ty - sy) + 1):
    ans += 'D'

for i in range(abs(tx - sx) + 1):
    ans += 'L'

ans += 'U'

print(ans)

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

for _ in range(ty-sy):
    print("U", end="")
for _ in range(tx-sx):
    print("R", end="")

for _ in range(ty-sy):
    print("D", end="")
for _ in range(tx-sx):
    print("L", end="")

print("L", end="")
for _ in range(ty-sy):
    print("U", end="")
print("U", end="")
for _ in range(tx-sx):
    print("R", end="")
print("R", end="")
print("D", end="")

print("R", end="")
for _ in range(ty-sy):
    print("D", end="")
print("D", end="")
for _ in range(tx-sx):
    print("L", end="")
print("L", end="")
print("U", end="")

print()

Solution (Python):
import sys

def solve(sx, sy, tx, ty):
    
    
    
    
    
    

    dx = tx - sx
    dy = ty - sy
    A = ((sx, sy+1), (tx-1, ty))
    B = ((tx, ty-1), (sx+1, sy))
    C = ((sx, sy-1), (tx+1, ty))
    D = ((tx, ty-1), (sx-1, sy))

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

    print(path)

def main():
    sx, sy, tx, ty = map(int, input().split())
    solve(sx, sy, tx, ty)

if __name__ == "__main__":
    main()

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+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):
INF = 10**9+7

xy = list(map(int,input().split()))
ans =''

for i in range(xy[3]-xy[1]):
	ans += 'U'
for i in range(xy[2]-xy[0]):
	ans += 'R'
for i in range(xy[3]-xy[1]):
	ans += 'D'
for i in range(xy[2]-xy[0]+1):
	ans += 'L'
for i in range(xy[3]-xy[1]+1):
	ans += 'U'
for i in range(xy[2]-xy[0]+1):
	ans += 'R'
ans += 'DR'
for i in range(xy[3]-xy[1]+1):
	ans += 'D'
for i in range(xy[2]-xy[0]+1):
	ans += 'L'
ans+= 'U'
print(ans)

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+"D"+"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())

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 ("".join(ans))

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

dx, dy = tx-sx, ty-sy
u = 'U'*dy+'R'*dx+'D'*dy+'L'*(dx+1)+'U'*(dy+1)+'R'*(dx+1)+'DR'+'D'*(dy+1)+'L'*(dx+1)+'U'

print(u)

Solution (Python):
x,y,xx,yy=map(int,input().split())
x=xx-x
y=yy-y
print(("R"*x)+("U"*y)+("L"*x)+("D"*(y+1))+("R"*(x+1))+("U"*(y+1))+"LU"+("L"*(x+1))+("D"*(y+1))+"R")

Solution (Python):
sx,sy,tx,ty = list(map(int,input().split()))
dir_x = tx > sx
dir_y = ty > sy
space_x = abs(sx - tx)
space_y = abs(sy - ty)
if dir_x:
    if dir_y:
        dirset = 'RULDDRULULDR'
    else:
        dirset = 'RDLUURDLDLUR'
else:
    if dir_y:
        dirset = 'LURDDLURURDL'
    else:
        dirset = 'LDRUULDRDRUL'

for p in range(space_x):
    print(dirset[0],end='')    
for p in range(space_y):
    print(dirset[1],end='')
for p in range(space_x):
    print(dirset[2],end='')
for p in range(space_y):
    print(dirset[3],end='')
print(dirset[4],end='')
for p in range(space_x+1):
    print(dirset[5],end='')
for p in range(space_y+1):
    print(dirset[6],end='')
print(dirset[7],end='')
print(dirset[8],end='')
for p in range(space_x+1):
    print(dirset[9],end='')
for p in range(space_y+1):
    print(dirset[10],end='')
print(dirset[11],end='')

Solution (Python):
def rev(str):
    ans = ''
    for i in list(str):
        if i =='R':
            ans += 'L'
        elif i == 'L':
            ans += 'R'
        elif i =='U':
            ans += 'D'
        else:
            ans += 'U'
    return ans
def main():
    sx,sy,tx,ty = map(int,input().split(' '))
    ans_1 =''
    ans_2 = ''
    if sx-tx <0:
        ans_1 += 'R'*(tx-sx)
        ans_2 += 'L'
        mid = 'R'
    elif sx-tx >0:
        ans_1 += 'L'*(sx-tx)
        ans_2 += 'R'
        mid = 'L'
    if sy-ty <0:
        ans_1 += 'U'*(ty-sy)
        ans_2 += 'U'*(ty-sy+1)
        last = 'D'
    elif sy-ty >0:
        ans_1 += 'D'*(sy-ty)
        ans += 'D'*(sy-ty+1)
        last = 'D'
    ans_2 += mid*(abs(sx-tx)+1)+last
    ans = ans_1+rev(ans_1)+ans_2+rev(ans_2)
    print(ans)

if __name__ == '__main__':
    main()

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

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

Solution (Python):
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,queue,copy

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7
dd=[(-1,0),(0,1),(1,0),(0,-1)]
ddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return input()

def main():
  sx,sy,tx,ty=LI()

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

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

  return ans

print(main())

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

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

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

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




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

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

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

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

print(ans)

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

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+1):
    ans += "U"
for i in range(tx-sx+1):
    ans += "R"
ans += "D"
ans += "R"
for i 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())

ux = (tx - sx)
uy = (ty - sy)
route = []

for i in range(ux):
    route.append('R')
for i in range(uy):
    route.append('U')
for i in range(ux):
    route.append('L')
for i in range(uy):
    route.append('D')
    
route.append('D')
for i in range(ux):
    route.append('R')
route.append('R')
route.append('U')
for i in range(uy):
    route.append('U')
route.append('L')
route.append('U')
for i in range(ux):
    route.append('L')
route.append('L')
route.append('D')
for i in range(uy):
    route.append('D')
route.append('R')

ans = ''

for i in route:
    ans += i
print(ans)

Solution (Python):
sx,sy,tx,ty = [int(x) for x in input().split()]
m1 = 'U'*(ty-sy)+'R'*(tx-sx)
m2 = 'D'*(ty-sy)+'L'*(tx-sx)
m3 = 'D'+'R'*(tx-sx+1)+'U'*(ty-sy+1)+'L'
m4 = 'U'+'L'*(tx-sx+1)+'D'*(ty-sy+1)+'R'
print(m1+m2+m3+m4)

Solution (Python):
import numpy as np

sx, sy, tx, ty = map(int, input().split())
S = np.array([sx, sy])
T = np.array([tx, ty])


def shortest_path(start, end):
    if start[0] <= end[0]:
        lr_path = "R" * (end[0] - start[0])
    else:
        lr_path = "L" * (start[0] - end[0])
    if start[1] <= end[1]:
        ud_path = "U" * (end[1] - start[1])
    else:
        ud_path = "D" * (start[1] - end[1])
    return lr_path + ud_path


path_1 = shortest_path(S, T)

path_2 = shortest_path(T, S)

path_3 = "D" + shortest_path(S + np.array([0, -1]), T + np.array([1, 0])) + "L"

path_4 = "U" + shortest_path(T + np.array([0, 1]), S + np.array([-1, 0])) + "R"

print(path_1 + path_2 + path_3 + path_4)

Solution (Python):
import numpy as np

sx, sy, tx, ty = map(int, input().split())
S = np.array([sx, sy])
T = np.array([tx, ty])


def shortest_path(start, end):
    if start[0] <= end[0]:
        lr_path = "R" * (end[0] - start[0])
    else:
        lr_path = "L" * (start[0] - end[0])
    if start[1] <= end[1]:
        ud_path = "U" * (end[1] - start[1])
    else:
        ud_path = "D" * (start[1] - end[1])
    return lr_path + ud_path


path_1 = shortest_path(S, T)

path_2 = shortest_path(T, S)

path_3 = "D" + shortest_path(S + np.array([0, -1]), T + np.array([1, 0])) + "L"

path_4 = "U" + shortest_path(T + np.array([0, 1]), S + np.array([-1, 0])) + "R"

print(path_1 + path_2 + path_3 + path_4)