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 move(x, y, direction):
    global ans, nx, ny
    if direction in ['U', 'D']:
        ans += direction * abs(ny - y)
    if direction in ['L', 'R']:
        ans += direction * abs(nx - x)
    nx, ny = x, y


sx, sy, tx, ty = map(int, input().split())
ans = ''
nx, ny = sx, sy

move(sx, ty, 'U')
move(tx, ty, 'R')

move(tx, sy, 'D')
move(sx, sy, 'L')

move(sx-1, sy, 'L')
move(sx-1, ty+1, 'U')
move(tx, ty+1, 'R')
move(tx, ty, 'D')

move(tx+1, ty, 'R')
move(tx+1, sy-1, 'D')
move(sx, sy-1, 'L')
move(sx, sy, 'U')

print(ans)

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

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

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

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

W,H=[c-a,d-b]

print('R'*W + 'U'*H, end='')
print('L'*W + 'D'*H, end='')
print('D' + 'R'*(W+1) + 'U'*(H+1) + 'L', end='')
print('U' + 'L'*(W+1) + 'D'*(H+1) + 'R', end='')

Solution (Python):
sx,sy,tx,ty=map(int,input().split())
dx,dy=tx-sx,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):
from sys import stdin

SX, SY, TX, TY = map(int, stdin.readline().rstrip().split())




print('U' * (TY - SY), end='')
print('R' * (TX - SX), end='')


print('D' * (TY - SY), end='')
print('L' * (TX - SX), end='')



print('L', end='')
print('U' * (TY - SY + 1), end='')
print('R' * (TX - SX + 1), end='')
print('D', end='')



print('R', end='')
print('D' * (TY - SY + 1), end='')
print('L' * (TX - SX + 1), end='')
print('U')

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

ans = []

X = tx - sx
Y = ty - sy

for i in range(X):
    ans.append('R')
for i in range(Y):
    ans.append('U')
for i in range(X):
    ans.append('L')
for i in range(Y):
    ans.append('D')

ans.append('D')
for i in range(X + 1):
    ans.append('R')
for i in range(Y + 1):
    ans.append('U')
ans.append('L')
ans.append('U')
for i in range(X + 1):
    ans.append('L')
for i in range(Y + 1):
    ans.append('D')
ans.append('R')


for i in ans:
    print(i,end='')

Solution (Python):


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

if x >= 0 and y >= 0:
    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")
elif x < 0 and y >= 0:
    print("L" * x + "U" * y + "R" * x + "D" * y + "D" + "L" * (x + 1) + "U" * (y + 1) + "R" + "U" + "R" * (x + 1) + "D" * (y + 1) + "L")
elif x >= 0 and y < 0:
    print("R" * x + "D" * y + "L" * x + "U" * y + "U" + "R" * (x + 1) + "D" * (y + 1) + "L" + "D" + "L" * (x + 1) + "U" * (y + 1) + "R")
else:
    print("L" * x + "D" * y + "R" * x + "U" * y + "U" + "L" * (x + 1) + "D" * (y + 1) + "R" + "D" + "R" * (x + 1) + "U" * (y + 1) + "L")

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

p1 = dx*"R"+dy*"U"
p2 = dx*"L"+dy*"D"
p3 = "D"+(1+dx)*"R"+(1+dy)*"U"+"L"
p4 = "U"+(1+dx)*"L"+(1+dy)*"D"+"R"

print(p1+p2+p3+p4)

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

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

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

ue = ty - sy
migi = tx - sx

print('U'*ue+'R'*migi+'D'*ue+'L'*(migi+1)+'U'*(ue+1)+'R'*(migi+1)+'D'+'R'+'D'*(ue+1)+'L'*(migi+1)+'U')

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

x_shift = tx - sx
y_shift = ty - sy
ans = ""

if y_shift > 0:
  for i in range(y_shift):
    ans += "U"
else:
  y = abs(y_shift)
  for i in range(y):
    ans += "D"

if x_shift > 0:
  for i in range(x_shift):
    ans += "R"
else:
  x = abs(x_shift)
  for i in range(x):
    ans += "L"

if y_shift > 0:
  for i in range(y_shift):
    ans += "D"
else:
  y = abs(y_shift)
  for i in range(y):
    ans += "U"

if x_shift > 0:
  for i in range(x_shift + 1):
    ans += "L"
else:
  x = abs(x_shift)
  for i in range(x + 1):
    ans += "R"

if y_shift > 0:
  for i in range(y_shift + 1):
    ans += "U"
else:
  y = abs(y_shift)
  for i in range(y + 1):
    ans += "D"

if x_shift > 0:
  for i in range(x_shift + 1):
    ans += "R"
else:
  x = abs(x_shift)
  for i in range(x + 1):
    ans += "L"
if y_shift > 0:
  ans += "D"
else:
  ans += "U"
if x_shift > 0:
  ans += "R"
else:
  ans += "L"

if y_shift > 0:
  for i in range(y_shift + 1):
    ans += "D"
else:
  y = abs(y_shift)
  for i in range(y + 1):
    ans += "U"

if x_shift > 0:
  for i in range(x_shift + 1):
    ans += "L"
else:
  x = abs(x_shift)
  for i in range(x + 1):
    ans += "R"
if y_shift > 0:
  ans += "U"
else:
  ans += "D"
print(ans)

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

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

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

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

Solution (Python):
a,b,c,d=map(int,input().split())
lia=[]
lib=[]
lia2=[]
lib2=[]

lia+='R'*(c-a)
lia+='U'*(d-b)
lia2+='D'
lia2+='R'*(c-a+1)
lia2+='U'*(d-b+1)
lia2+='L'

lib+='L'*(c-a)
lib+='D'*(d-b)
lib2+='U'
lib2+='L'*(c-a+1)
lib2+='D'*(d-b+1)
lib2+='R'
li=lia+lib+lia2+lib2
print(''.join(li))

Solution (Python):
def main():
    sx,sy,tx,ty = map(int,input().split())
    path =''
    ly,lx = abs(ty-sy),abs(tx-sx)
    
    path += 'U' * ly
    path += 'R' * lx
    
    path += 'D' * ly
    path += 'L' * lx
    
    path += 'L' + 'U' * (ly+1)
    path += 'R' * (lx+1) + 'D'
    
    path += 'R' +'D'*(ly+1)
    path += 'L'*(lx+1) +'U'
    print(path)
if __name__ == '__main__':
    main()

Solution (Python):
a,b,c,d = [int(x) for x in input().split()]
h,w = d-b,c-a

def rep(t,c):
	for i in range(t):
		print(c,end='')
rep(1,'L')
rep(h+1,'U')
rep(w+1,'R')
rep(1,'D')
rep(1,'R')
rep(h+1,'D')
rep(w+1,'L')
rep(1,'U')

rep(h,'U')
rep(w,'R')
rep(h,'D')
rep(w,'L')

print()

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

nx=tx-sx
ny=ty-sy

root_1='U'*ny+'R'*nx
root_2='R'+'D'*(ny+1)+'L'*(nx+1)+'U'
root_3='R'*nx+'U'*ny
root_4='U'+'L'*(nx+1)+'D'*(ny+1)+'R'

print(root_1+root_2+root_3+root_4)

Solution (Python):
sx,sy,tx,ty=map(int,input().split())
x=tx-sx
y=ty-sy
def p(h,n):
    for i in range(n):
        print(h,end="")
p("U",y)
p("R",x)
p("D",y)
p("L",x+1)
p("U",y+1)
p("R",x+1)
p("D",1)
p("R",1)
p("D",y+1)
p("L",x+1)
p("U",1)

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

move = []
temp_x = 0
temp_y = 0


def move_1(sX, sY, gX, gY):
    temp_x = sX
    temp_y = sY
    while temp_y < gY:
        move.append('U')
        temp_y += 1

    while temp_x < gX:
        move.append('R')
        temp_x += 1

def move_2(sX, sY, gX, gY):
    temp_x = sX
    temp_y = sY
    while temp_y > gY:
        move.append('D')
        temp_y -= 1

    while temp_x > gX:
        move.append('L')
        temp_x -= 1



move_1(sx, sy, tx, ty)
move_2(tx, ty, sx, sy)
move.append('L')
move_1(sx - 1, sy, tx, ty + 1)
move.append('DR')
move_2(tx + 1, ty, sx, sy - 1)
move.append('U')
print(''.join(move))

Solution (Python):
import sys
import copy
import string
from _bisect import *
from collections import *
from operator import itemgetter
from math import factorial
"""
from fractions import gcd
def lcm(x, y):
    return (x * y) // gcd(x, y)
"""
stdin = sys.stdin
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()

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

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

ans += dy * 'D'
ans += dx * "L"

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

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

Solution (Python):
a0,b0,a1,b1=map(int,input().split())
[x,y]=[a1-a0,b1-b0]
print("U"*y+"R"*x+"D"*y+"L"*x+"D"+"R"*(x+1)+"U"*(y+1)+"LU"+"L"*(x+1)+"D"*(y+1)+"R")

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

x=a
y=b
l=[]
while y<d:
    y+=1
    l.append('U')
while x<c:
    x+=1
    l.append('R')
while y>b:
    y-=1
    l.append('D')
while x>a:
    x-=1
    l.append('L')
x-=1
l.append('L')
while y<=d:
    y+=1
    l.append('U')
while x<c:
    x+=1
    l.append('R')
y-=1
l.append('D')
x+=1
l.append('R')
while y>=b:
    y-=1
    l.append('D')
while x>a:
    x-=1
    l.append('L')
y+=1
l.append('U')
print(''.join(l))

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

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

print(ans)

Solution (Python):
from collections import deque
sx, sy, tx, ty = [int(x) for x in input().split()]
ret = 'R' * (tx - sx) + 'U' * (ty - sy)
ret += 'L' * (tx - sx) + 'D' * (ty - sy)
ret += 'D' + 'R' * (tx - sx + 1) + 'U' * (ty - sy + 1) + 'L'
ret += 'U' + 'L' * (tx - sx + 1) + 'D' * (ty - sy + 1) + 'R'
print(ret)

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

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

Solution (Python):
sx, sy, tx, ty = map(int, input().split())
lx1 = sx-1
ly1 = sy
lx2 = tx
ly2 = ty+1
rx1 = tx+1
ry1 = ty
rx2 = sx
ry2 = sy-1
ans = ""
sign = ['U', 'R', 'D', 'L', 'L', 'U', 'R', 'D', 'R', 'D', 'L', 'U']
road = [ty-sy, tx-sx, sy-ty, sx-tx, -1, ly2-ly1, lx2-lx1, -1, 1, ry2-ry1, rx2-rx1, 1]
for i in range(12):
    ans += sign[i]*abs(road[i])
print(ans)

Solution (Python):
from collections import deque
sx, sy, tx, ty = [int(x) for x in input().split()]
ret = 'R' * (tx - sx) + 'U' * (ty - sy)
ret += 'L' * (tx - sx) + 'D' * (ty - sy)
ret += 'D' + 'R' * (tx - sx + 1) + 'U' * (ty - sy + 1) + 'L'
ret += 'U' + 'L' * (tx - sx + 1) + 'D' * (ty - sy + 1) + 'R'
print(ret)

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

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

x = tx - sx
y = ty - sy

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

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

Solution (Python):



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

done_list = []
route_list = []


route_list += ['R'] * abs(sx - tx)
route_list += ['U'] * abs(sy - ty)
route_list += ['L'] * abs(sx - tx)
route_list += ['D'] * abs(sy - ty)


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

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

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

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

print(ans)

Solution (Python):
a0,b0,a1,b1=map(int,input().split())
[x,y]=[a1-a0,b1-b0]
print("U"*y+"R"*x+"D"*y+"L"*x+"D"+"R"*(x+1)+"U"*(y+1)+"LU"+"L"*(x+1)+"D"*(y+1)+"R")

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

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

Solution (Python):
if __name__ == "__main__":
    
    
    
    

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

    result = (
        "U" * (ty - sy)
        + "R" * (tx - sx)
        + "D" * (ty - sy)
        + "L" * (tx - sx)
        + "LU"
        + "U" * (ty - sy)
        + "R" * (tx - sx)
        + "RD"
        + "RD"
        + "D" * (ty - sy)
        + "L" * (tx - sx)
        + "LU"
    )

    print(result)

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

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

out = ""
def p(s):
    global out
    out += s

for i in range(ty-sy):
    p("U")
for i in range(tx-sx):
    p("R")


for i in range(ty-sy):
    p("D")
for i in range(tx-sx):
    p("L")


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

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

Solution (Python):
sx,sy,tx,ty = map(int,input().split())
w = tx - sx 
h = ty - sy 
ans = []
ans_1 = ["R"]*w + ["U"]*h 
ans_2 = ["L"]*w + ["D"]*h
ans_3 = ["D"] + ["R"] * (w+1) + ["U"] *(h+1) + ["L"]
ans_4 = ["U"] + ["L"] * (w+1)  + ["D"]*(h+1) +["R"]
ans = ans_1 + ans_2 + ans_3 + ans_4 
ans = "".join(ans)
print(ans,end=" ")

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) + "D" + "R" + "D" * (y+1) + "L" * (x+1) + "U")

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

w = tx - sx
h = ty - sy

s = ''
s += 'U'
s += 'U' * (h - 1)
s += 'R' * w
s += 'D'
s += 'D' * (h - 1)
s += 'L' * w
s += 'L'
s += 'U' * (h + 1)
s += 'R' * (w + 1)
s += 'D'
s += 'R'
s += 'D' * (h + 1)
s += 'L' * (w + 1)
s += 'U'

print(s)

Solution (Python):


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

h = ty - sy
w = tx - sx

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

print(ans)

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

if __name__ == '__main__':
    print(main())

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

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

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

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

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

way_1="U"*(ty-sy)+"R"*(tx-sx)
way_2="D"*(ty-sy)+"L"*(tx-sx)
way_3="L"+"U"*(ty-sy+1)+"R"*(tx-sx+1)+"D"
way_4="R"+"D"*(ty-sy+1)+"L"*(tx-sx+1)+"U"

print(way_1+way_2+way_3+way_4)

Solution (Python):
H = list(map(int, input().split()))
SX=H[0]
SY=H[1]
TX=H[2]
TY=H[3]
TX=TX-SX
TY=TY-SY

if((TX>=0)&(TY>=0)):
    U="U"
    R="R"
    D="D"
    L="L"

if((TX<0)&(TY>=0)):
    U="U"
    R="L"
    D="D"
    L="R"

if((TX>=0)&(TY<0)):
    U="D"
    R="R"
    D="U"
    L="L"

if((TX<0)&(TY<0)):
    U="D"
    R="L"
    D="U"
    L="R"

for i in range(abs(TY)):print(U,end="") 
for i in range(abs(TX)):print(R,end="") 

for i in range(abs(TY)):print(D,end="")
for i in range(abs(TX)):print(L,end="") 

print(L,end="") 
for i in range(abs(TY)+1):print(U,end="")
for i in range(abs(TX)+1):print(R,end="") 
print(D,end="")

print(R,end="") 
for i in range(abs(TY)+1):print(D,end="")
for i in range(abs(TX)+1):print(L,end="") 
print(U,end="")

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

yoko=li[2]-li[0]
tate=li[3]-li[1]
s=["R"]*yoko+["U"]*tate+["L"]*yoko
s+=["D"]*(tate+1)+["R"]*(yoko+1)+["U"]*(tate+1)+["L"]
s+=["U"]+["L"]*(yoko+1)+["D"]*(tate+1)+["R"]
ans=''.join(s)

print(ans)

Solution (Python):
sx, sy, tx, ty = map(int, input().split())
 
right1 = ["R" for _ in range(tx-sx)]
up1 = ["U" for _ in range(ty-sy)]
left1 = ["L" for _ in range(tx-sx)]
down1 = ["D" for _ in range(ty-sy)]
hoge = ["D"]
right2 = ["R" for _ in range(tx-sx+1)]
up2 = ["U" for _ in range(ty-sy+1)]
hoge2 = ["LU"]
left2 = ["L" for _ in range(tx-sx+1)]
down2 = ["D" for _ in range(ty-sy+1)]
hoge3 = ["R"]
print("".join(right1+up1+left1+down1+hoge+right2+up2+hoge2+left2+down2+hoge3))

Solution (Python):
import sys
sys.setrecursionlimit(12345678)
import itertools
from collections import Counter
from collections import defaultdict
from collections import deque
import bisect
from heapq import heappush, heappop


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

    p1 = 'R' * dx + 'U' * dy
    p2 = 'L' * dx + 'D' * dy
    p3 = 'D' + 'R' * (dx + 1) + 'U' * (dy + 1) + 'L'
    p4 = 'U' + 'L' * (dx + 1) + 'D' * (dy + 1) + 'R'
    print(p1 + p2 + p3 + p4)


if __name__ == '__main__':
    main()

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

dx = tx - sx
dy = ty - sy

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

right1 = ["R" for _ in range(tx-sx)]
up1 = ["U" for _ in range(ty-sy)]
left1 = ["L" for _ in range(tx-sx)]
down1 = ["D" for _ in range(ty-sy)]
hoge = ["D"]
right2 = ["R" for _ in range(tx-sx+1)]
up2 = ["U" for _ in range(ty-sy+1)]
hoge2 = ["LU"]
left2 = ["L" for _ in range(tx-sx+1)]
down2 = ["D" for _ in range(ty-sy+1)]
hoge3 = ["R"]
print("".join(right1+up1+left1+down1+hoge+right2+up2+hoge2+left2+down2+hoge3))

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

Solution (Python):
sx, sy, gx, gy = [ int(v) for v in input().split() ]
dx, dy = gx - sx, gy - sy


ans_1 = "R" * dx + "U" * dy
ans_2 = "L" + "D" * (dy-1) + "L" * (dx-1) + "D"
ans_3 = "D" + "R" * (dx+1) + "U" * (dy+1) + "L"
ans_4 = "U" + "LL" + "D" * (dy-1) + "L" * (dx-1) + "DD" + "R"

print(ans_1+ans_2+ans_3+ans_4)

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

Dx = Tx - Sx
Dy = Ty - Sy

g1 = ['U'] * Dy + ['R'] * Dx
g = ''.join(g1)

r1 = ['D'] * Dy + ['L'] * Dx
r = ''.join(r1)

print('{}{}LU{}RDRD{}LU'.format(g, r, g, r))

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

move_x = tx - sx
move_y = ty - sy

move1 = 'R'*move_x + 'U'*move_y
move2 = 'L'*move_x + 'D'*move_y
move3 = 'D' + 'R'*(move_x+1) + 'U'*(move_y+1) + 'L'
move4 = 'U' + 'L'*(move_x+1) + 'D'*(move_y+1) + 'R'

print(move1 + move2 + move3 + move4)

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

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

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

dx = tx - sx
dy = ty - sy

result = []
result.extend(['R' for _ in range(dx)])
result.extend(['U' for _ in range(dy)])
result.extend(['L' for _ in range(dx)])
result.extend(['D' for _ in range(dy + 1)])
result.extend(['R' for _ in range(dx + 1)])
result.extend(['U' for _ in range(dy + 1)])
result.extend(['L'])
result.extend(['U'])
result.extend(['L' for _ in range(dx + 1)])
result.extend(['D' for _ in range(dy + 1)])
result.extend(['R'])
print("".join(result))

Solution (Python):


if __name__ == '__main__':
    sx, sy, tx, ty = map(int, input().split(' '))

    right = tx - sx
    up = ty - sy

    R = ['R'] * right
    U = ['U'] * up
    down = ['D'] * (up+1)
    left = ['L'] * (right+1)

    one = []
    one.extend(R)
    one.extend(U)
    one.append('R')
    one.extend(down)
    one.extend(left)
    one.append('U')

    one.extend(U)
    one.extend(R)
    one.append('U')
    one.extend(left)
    one.extend(down)
    one.append('R')

    out = ''.join(one)
    print(out)

Solution (Python):
sx,sy,tx,ty=map(int,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+='DR'
route+='D'*(ty-sy+1)
route+='L'*(tx-sx+1)
route+='U'
print(route)

Solution (Python):
def saitankeiro(s,t):
  dx = t[0] - s[0]
  dy = t[1] - s[1]
  
  
  for i in range(0,dy):
    print('U',end='')
  
  for i in range(0,dx):
    print('R',end='')
  
  for i in range(0,dy):
    print('D',end='')

  for i in range(0,dx):
    print('L',end='')
  
  
  print('L',end='')
  for i in range(0,dy+1):
    print('U',end='')
  
  for i in range(0, dx+1):
    print('R',end='')
  
  print('D',end='')

  print('R',end='')
  for i in range(0,dy+1):
    print('D',end='')
  
  for i in range(0, dx+1):
    print('L',end='')
  
  print('U',end='')

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

saitankeiro([sx,sy], [tx, ty])

Solution (Python):
def moving(delta_x,delta_y):
    go_1="U"*delta_y+"R"*delta_x
    back_1="D"*delta_y+"L"*delta_x
    go_2="L"+"U"*(delta_y+1)+"R"*(delta_x+1)+"D"
    back_2="R"+"D"*(delta_y+1)+"L"*(delta_x+1)+"U"
    return(go_1+back_1+go_2+back_2)

sx,sy,tx,ty=map(int,input().split(" "))
delta_x=tx-sx
delta_y=ty-sy
print(moving(delta_x,delta_y))

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

Solution (Python):


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

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

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

print(ans)

Solution (Python):
x1, y1, x2, y2 = map(int, input().split())
x = abs(x1 - x2)
y = abs(y1 - y2)
a = ""
a += ("U" * y + "R" * x + "D" * y + "L" * x)
a += ("L" + "U" * (y + 1) + "R" * (x + 1) + "D" + "R" + "D" * (y + 1) + "L" * (x + 1) + "U")
print(a)

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

holizontal = tx - sx
vertical = ty - sy

ans = ['L']
ans += ['U'] * (vertical + 1)
ans += ['R'] * (holizontal + 1)
ans += ['D']
ans += ['L'] * holizontal
ans += ['D'] * (vertical + 1)
ans += ['R'] * (holizontal + 1)
ans += ['U'] * (vertical + 1)
ans += ['L']
ans += ['D'] * vertical
ans += ['L'] * holizontal

print(''.join(ans))

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

ans += "R"*r+"U"*u+"L"*r+"D"*u
ans += "D"+"R"*(r+1)+"U"*(u+1)+"L"
ans += "U"+"L"*(r+1)+"D"*(u+1)+"R"

print(ans)

Solution (Python):
from sys import exit, stdin
sx, sy, tx, ty = [int(_) for _ in stdin.readline().rstrip().split()]
dx, dy = tx-sx, ty-sy
print(dy*'U'+dx*'R'+dy*'D'+dx*'L'+'L'+'U'+dy*'U'+dx*'R'+'R'+'D'+'R'+dy*'D'+'D'+'L'+dx*'L'+'U')

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

Solution (Python):


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

lr=tx-sx
ud=ty-sy

ans=[('R'*lr),
    ('U'*ud),
    ('L'*lr),
    ('D'*ud),
    ('D'),
    ('R'*(lr+1)),
    ('U'*(ud+1)),
    ('L'),
    ('U'),
    ('L'*(lr+1)),
    ('D'*(ud+1)),
    ('R')
    ]
print(''.join(ans))

Solution (Python):
x0,y0,x1,y1 = map(int,input().split())
x1 -= x0
y1 -= y0
ans = ''
ans += 'R' * x1
ans += 'U' * y1
ans += 'L' * x1
ans += 'D' * y1
ans += 'D'
ans += 'R' * x1
ans += 'R'
ans += 'U' * y1
ans += 'U'
ans += 'L'
ans += 'U'
ans += 'L' * x1
ans += 'L'
ans += 'D' * y1
ans += 'D'
ans += 'R'
print(ans)

Solution (Python):
a=list(map(int,input().split()))
b,c=a[2]-a[0],a[3]-a[1]
d,e=b+1,c+1
print('R'*b+'U'*c+'L'*b+'D'*c+'D'+'R'*d+'U'*e+'L'+'U'+'L'*d+'D'*e+'R',end='')

Solution (Python):
sx, sy, ex, ey = [int(v) for v in input().split()]


def move(x):
    print(x, end='')


def forward(x1, y1, x2, y2):
    for _ in range(y1, y2):
        move('U')
    for _ in range(x1, x2):
        move('R')


def backword(x1, y1, x2, y2):
    for _ in range(y1, y2):
        move('D')
    for _ in range(x1, x2):
        move('L')


forward(sx, sy, ex, ey)
backword(sx, sy, ex, ey)
move('L')
forward(sx - 1, sy, ex, ey + 1)
move('D')
move('R')
backword(sx, sy - 1, ex + 1, ey)
print('U')

Solution (Python):
A = list(map(int,input().split()))
dx = A[2] - A[0]
dy = A[3] - A[1]
sta = "U" * dy + "R" * dx + "D" * dy + "L" * dx
stb = "L" + "U" * (dy + 1) + "R" * (dx + 1) + "D"
stc = "R" + "D" * (dy + 1) + "L" * (dx + 1) + "U"
st = sta + stb + stc
print(st)

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

dx = tx - sx
dy = ty - sy

for _ in range(dx):
	print('R',end='')
for _ in range(dy):
	print('U',end='')
for _ in range(dx):
	print('L',end='')
for _ in range(dy + 1):
	print('D',end='')
for _ in range(dx + 1):
	print('R',end='')
for _ in range(dy + 1):
	print('U',end='')
print('L',end='')
print('U',end='')
for _ in range(dx + 1):
	print('L',end='')
for _ in range(dy + 1):
	print('D',end='')
print('R')

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

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

print(ans)