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())
ts_x=tx-sx
ts_y=ty-sy

answer_list=[]

for i in range(ts_y):
  answer_list.append("U")
for i in range(ts_x):
  answer_list.append("R")
  

for i in range(ts_y):
  answer_list.append("D")
for i in range(ts_x):
  answer_list.append("L")
  

answer_list.append("L")
for i in range(ts_y+1):
  answer_list.append("U")
for i in range(ts_x+1):
  answer_list.append("R")
answer_list.append("D")


answer_list.append("R")
for i in range(ts_y+1):
  answer_list.append("D")
for i in range(ts_x+1):
  answer_list.append("L")
answer_list.append("U")

print("".join(answer_list))

Solution (Python):
o1,o2,x,y=map(int,input().split())
x = x-o1
y = y-o2
res = ''
if x>=0 and y>=0:
    res='R'*x+'U'*y+'L'*x+'D'*y
    res+='L'+'U'*(y+1)+'R'*(x+1)+'D'
    res+='R'+'D'*(y+1)+'L'*(x+1)+'U'
print(res)

Solution (Python):
o1,o2,x,y=map(int,input().split())
x = x-o1
y = y-o2
res = ''
if x>=0 and y>=0:
    res='R'*x+'U'*y+'L'*x+'D'*y
    res+='L'+'U'*(y+1)+'R'*(x+1)+'D'
    res+='R'+'D'*(y+1)+'L'*(x+1)+'U'
print(res)

Solution (Python):






import sys
input = sys.stdin.readline

import math
import bisect
from collections import deque
from fractions import gcd
from functools import lru_cache






MOD = 10**9+7
INF = float('inf')






def inputI(): return int(input().strip())
def inputS(): return input().strip()
def inputIL(): return list(map(int,input().split()))
def inputSL(): return list(map(str,input().split()))
def inputILs(n): return list(int(input()) for _ in range(n))
def inputSLs(n): return list(input().strip() for _ in range(n))
def inputILL(n): return [list(map(int, input().split())) for _ in range(n)]
def inputSLL(n): return [list(map(str, input().split())) for _ in range(n)]


def inv(n): return pow(n, MOD-2, MOD)


kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret


def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])
    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])
    return arr


def lcm(a, b):
    return a * b // gcd (a, b)


def count_bit(n):
  count = 0
  while n:
    n &= n -1
    count += 1
  return count





sx,sy,tx,ty = inputIL()

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())
dist_x, dist_y = abs(tx-sx), abs(ty-sy)



path1 = ""
path2 = ""
path3 = ""
path4 = ""

if dist_x == 0 and dist_y == 0:
    pass
elif dist_x == 0 and dist_y != 0:
    path1 += "D"*disy_y if sy > ty else "U"*dist_y
    path2 += "U"*disy_y if sy > ty else "D"*dist_y
    path3 += "D"*disy_y if sy > ty else "U"*dist_y
    path4 += "U"*disy_y if sy > ty else "D"*dist_y
elif dist_x != 0 and dist_y == 0:
    path1 += "L"+dist_x if sx > tx else "R"*dist_x
    path2 += "R"+dist_x if sx > tx else "L"*dist_x
    path3 += "L"+dist_x if sx > tx else "R"*dist_x
    path4 += "R"+dist_x if sx > tx else "L"*dist_x
else:
    path1 += "D"*disy_y if sy > ty else "U"*dist_y
    path1 += "L"+dist_x if sx > tx else "R"*dist_x

    path2 += "U"*disy_y if sy > ty else "D"*dist_y
    path2 += "R"+dist_x if sx > tx else "L"*dist_x

    path3 += "R" if sx > tx else "L"
    path3 += "D"*(disy_y+1) if sy > ty else "U"*(dist_y+1)
    path3 += "L"*(disy_x+1) if sx > tx else "R"*(dist_x+1)
    path3 += "U" if sy > ty else "D"

    path4 += "L" if sx > tx else "R"
    path4 += "U"*(disy_y+1) if sy > ty else "D"*(dist_y+1)
    path4 += "R"*(disy_x+1) if sx > tx else "L"*(dist_x+1)
    path4 += "D" if sy > ty else "U"

print(path1+path2+path3+path4)

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

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

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

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

def Main(Sx, Sy, Tx, Ty):
    x = Tx - Sx
    y = Ty - Sy
    dir = ['U','R','D','L','U','R','D','R','D','L','U']
    steps = [y, x, y, x+1, y+1, x+1, 1, 1, y+1, x+1, 1]
    ans = []
    for d, s in zip(dir, steps):
        ans.append(d*s)
    return "".join(ans)
          
                    
print(Main(Sx, Sy, Tx, Ty))

Solution (Python):
def out(c, n):
    for i in range(n):
        print(c, end='')

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

out('U', ty - sy)
out('R', tx - sx)
out('D', ty - sy)
out('L', tx - sx)

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

print()

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

Solution (Python):

sx,sy,tx,ty=map(int,input().split())
dx=tx-sx
dy=ty-sy
s=''
route=['U' for i in range(dy)]
for i in range(dx):
    route.append('R')
for i in range(dy):
    route.append('D')
for i in range(dx+1):
    route.append('L')
for i in range(dy+1):
    route.append('U')
for i in range(dx+1):
    route.append('R')
route.append('D')
route.append('R')
for i in range(dy+1):
    route.append('D')
for i in range(dx+1):
    route.append('L')
route.append('U')
for i in range(len(route)):
    s+=route[i]
print(s)

Solution (Python):
sx, sy, tx, ty = map(int, input().split())
X, Y = tx - sx, ty - sy
for d, n in zip("RULDRULULDR", [X, Y, X, Y + 1, X + 1, Y + 1, 1, 1, X + 1, Y + 1, 1]):
    print(d * n, end="")
print()

Solution (Python):
sx, sy, tx, ty = map(int, input().split())
X, Y = tx - sx, ty - sy
for d, n in zip("RULD", [X, Y, X, Y]):
    print(d * n, end="")
for d, n in zip("DRULULDR", [1, X + 1, Y + 1, 1, 1, X + 1, Y + 1, 1]):
    print(d * n, end="")
print()

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


if __name__ == '__main__':
    main()

Solution (Python):
def main():
    a, b, c, d = map(int, input().split())
    dx, dy = (c - a), (d - b)
    p1 = "L" + "U" * (dy + 1) + "R" * (dx + 1) + "D" + "L" * dx + "D" * dy
    p2 = "D" + "R" * (dx + 1) + "U" * (dy + 1) + "L" + "D" * dy + "L" * dx
    print(p1 + p2)


if __name__ == '__main__':
    main()

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

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

Solution (Python):
def getN():
    return int(input())
def getNM():
    return map(int, input().split())
def getList():
    return list(map(int, input().split()))
def getArray(intn):
    return [int(input()) for i in range(intn)]

from collections import defaultdict, deque
from sys import exit
import heapq
import math
import copy
from bisect import bisect_left, bisect_right

import sys
sys.setrecursionlimit(1000000000)

sx, sy, tx, ty = getNM()

path = ""
path_s = ""
for _ in range(tx - sx):
    path_s += "R"
for _ in range(ty - sy):
    path_s += "U"
path_e = ""
for _ in range(tx - sx):
    path_e += "L"
for _ in range(ty - sy):
    path_e += "D"

path = path_s + path_e + "DR" + path_s + "UL" + "UL" + path_e + "DR"
print(path)

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


def solve(sx, sy, tx, ty):
    dx = tx - sx
    dy = ty - sy
    st = 'U' * dy + 'R' * dx
    ts = 'D' * dy + 'L' * dx
    rt1 = st + ts
    rt2 = 'L' + 'U' + st + 'R' + 'D' + 'R' + 'D' + ts + 'L' + 'U'
    ans = rt1 + rt2
    return ans


if __name__ == '__main__':
    main()

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

x = data[2] - data[0]
y = data[3] - data[1]

go = x * "R" + y * "U"
come = x * "L" + y * "D"

path = go + come

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

ans = path + temp
print(ans)

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

Solution (Python):
from collections import deque

sx, sy, tx, ty = map(int, input().split())
Done = [[-1]*3000 for _ in range(3000)]

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

print(Ans)

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

ans = ""
sa_x = tx-sx
sa_y = ty-sy

for i in range(sa_x):
    ans += "R"
for i in range(sa_y):
    ans += "U"
for i in range(sa_x):
    ans += "L"
for i in range(sa_y):
    ans += "D"
ans += "D"
for i in range(sa_x+1):
    ans += "R"
for i in range(sa_y+1):
    ans += "U"
ans += "LU"
for i in range(sa_x+1):
    ans += "L"
for i in range(sa_y+1):
    ans += "D"
ans +="R"

print(ans)

Solution (Python):
line = list(map(int,input().split()))
dx = line[2]-line[0]
dy = line[3]-line[1]
for i in range(dx):
	print('R',end='')
for i in range(dy):
	print('U',end='')
for i in range(dx):
	print('L',end='')
for i in range(dy+1):
	print('D',end='')
for i in range(dx+1):
	print('R',end='')
for i in range(dy+1):
	print('U',end='')
print('LU',end='')
for i in range(dx+1):
	print('L',end='')
for i in range(dy+1):
	print('D',end='')
print('R')

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

X = tx-sx
Y = ty-sy

print('R'*X+'U'*Y+'L'*X+'D'*Y+'D'+'R'*(X+1) +
      'U'*(Y+1)+'L'+'U'+'L'*(X+1)+'D'*(Y+1)+'R')

Solution (Python):
import sys
import heapq, math
from itertools import zip_longest, permutations, combinations, combinations_with_replacement
from itertools import accumulate, dropwhile, takewhile, groupby
from functools import lru_cache
from copy import deepcopy

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

ans = []

for i in range(tx - sx):
    ans.append("R")

for i in range(ty - sy):
    ans.append("U")

for i in range(tx - sx):
    ans.append("L")

for i in range(ty - sy):
    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):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

sx, sy, tx, ty = map(int, read().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):
sx, sy, tx, ty = map(int, input().split(" "))
fir1, sec = "", ""
txt = ""
if ty - sy > 0 and tx - sx > 0:
  fir1 = 'U' * (ty - sy) + 'R' * (tx - sx)
  fir2 = 'D' * (ty - sy) + 'L' * (tx - sx)
  sec = "LU" + fir1 + "RDRD" + fir2 + "LU"
elif ty - sy > 0 and tx - sx < 0:
  fir1 = 'U' * (ty - sy) + 'L' * (sx - tx)
  fir2 = 'D' * (ty - sy) + 'R' * (sx - tx)
  sec = "RU" + fir1 + "LDLD" + fir2 + "RU"
elif ty - sy < 0 and tx - sx > 0:
  fir1 = 'D' * (sy - ty) + 'R' * (tx - sx)
  fir2 = 'U' * (sy - ty) + 'L' * (tx - sx)
  sec = "LD" + fir1 + "RURU" + fir2 + "LD"
else:
  fir1 = 'D' * (sy - ty) + 'L' * (sx - tx)
  fir2 = 'U' * (sy - ty) + 'R' * (sx - tx)
  sec = "RD" + fir1 + "LULU" + fir2 + "RD"
print(fir1 + fir2 + sec)

Solution (Python):
from collections import deque
s, t = [0, 0], [0, 0]
s[0], s[1], t[0], t[1] = map(int, input().split())

dx, dy = t[0] - s[0], t[1] - s[1]
ans = deque()

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

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

print("".join(ans))

Solution (Python):


from sys import *
from math import *

sx, sy, tx, ty = map(int, input().split())
length = abs(tx - sx)
vertical = abs(ty - sy) 

first_go = ("R" * length) + ("U" * vertical)
first_back =  ("L" * length) + ("D" * vertical)
second_go = "L" + ("U" * (vertical + 1)) + ("R" * (length + 1)) + "D" 
second_back = "R" + ("D" * (vertical + 1)) + ("L" * (length + 1)) + "U" 
print(first_go + first_back + second_go + second_back)

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

Solution (Python):
import sys

sx, sy, tx, ty = map(int, sys.stdin.readline().rstrip().split())

path = ""
path_s = ""
for _ in range(tx - sx):
    path_s += "R"
for _ in range(ty - sy):
    path_s += "U"
path_e = ""
for _ in range(tx - sx):
    path_e += "L"
for _ in range(ty - sy):
    path_e += "D"

path = path_s + path_e + "DR" + path_s + "UL" + "UL" + path_e + "DR"
print(path)

Solution (Python):
sx,sy,tx,ty=map(int,input().split())
ans=[]
if ty-sy>=0:
    for i in range(ty-sy):
        ans.append('U')
else:
    for i in range(sy-ty):
        ans.append('D')
if tx-sx>=0:
    for i in range(tx-sx):
        ans.append('R')
else:
    for i in range(sx-tx):
        ans.append('L')
if ty-sy>=0:
    for i in range(ty-sy):
        ans.append('D')
else:
    for i in range(sy-ty):
        ans.append('U')
if tx-sx>=0:
    for i in range(tx-sx+1):
        ans.append('L')
else:
    for i in range(sx-tx+1):
        ans.append('R')
if ty-sy>=0:
    for i in range(ty-sy+1):
        ans.append('U')
else:
    for i in range(sy-ty+1):
        ans.append('D')
if tx-sx>=0:
    for i in range(tx-sx+1):
        ans.append('R')
else:
    for i in range(sx-tx+1):
        ans.append('L')
if ty-sy>=0:
    ans.append('D')
else:
    ans.append('U')
if tx-sx>=0:
    ans.append('R')
else:
    ans.append('L')
if ty-sy>=0:
    for i in range(ty-sy+1):
        ans.append('D')
else:
    for i in range(sy-ty+1):
        ans.append('U')
if tx-sx>=0:
    for i in range(tx-sx+1):
        ans.append('L')
else:
    for i in range(sx-tx+1):
        ans.append('R')
if ty-sy>=0:
    ans.append('U')
else:
    ans.append('D')

print(''.join(ans))

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

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

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

    return ans

if __name__ == "__main__":
    sx,sy,tx,ty = [int(i) for i in input().split()]
    print(solve(sx, sy, tx, ty))

Solution (Python):

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

route = ''

updown_num = ty - sy 
rightleft_num = tx - sx 


for i in range(updown_num):
    route += 'U'
for i in range(rightleft_num):
    route += 'R'

for i in range(updown_num):
    route += 'D'
for i in range(rightleft_num):
    route += 'L'

route += 'L'
for i in range(updown_num + 1):
    route += 'U'
for i in range(rightleft_num + 1):
    route += 'R'
route += 'D'

route += 'R'
for i in range(updown_num + 1):
    route += 'D'
for i in range(rightleft_num + 1):
    route += 'L'
route += 'U'

print(route)

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

dx = tx - sx
dy = ty -sy
r = ''
if dx > 0:
    dxc = 1
else:
    dxc = 0
    
if dy > 0:
    dyc = 1
else:
    dyc = 0
    
if dxc:
    r += 'R' * dx
else:
    r += 'L' * dx
    
if dyc:
    r += 'U' * dy
else:
    r += 'D' * dy
    
if dxc:
    r += 'L' * dx
else:
    r += 'R' * dx
    
if dyc:
    r += 'D' * dy
else:
    r += 'U' * dy
    
    
if dyc:
    r += 'D' * 1
else:
    r += 'U' * 1      
    
if dxc:
    r += 'R' * (dx +1)
else:
    r += 'L' * (dx+1)
    
if dyc:
    r += 'U' * (dy + 1)
else:
    r += 'D' * (dy + 1)
    
if dxc:
    r += 'L' * 1
else:
    r += 'R' * 1
    
    
    
if dyc:
    r += 'U' * 1
else:
    r += 'D' * 1      
    
if dxc:
    r += 'L' * (dx +1)
else:
    r += 'R' * (dx+1)
    
if dyc:
    r += 'D' * (dy + 1)
else:
    r += 'U' * (dy + 1)
    
if dxc:
    r += 'R' * 1
else:
    r += 'L' * 1
    
    
print(r)

Solution (Python):
sx, sy, tx, ty = map(int, input().split())
s = (0, 0)
t = (tx-sx, ty-sy)
ans = ""
go1 = "U"*t[1] + "R"*t[0]
back1 = "U" + "L"*t[0] + "LD" + "D"*t[1] +"R"
go2 = "R"*t[0] + "U"*t[1]
back2 = "R" + "D"*t[1] + "DL" + "L"*t[0] + "U"
ans = go1 + back1 + go2 + back2
print(ans)

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

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

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

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


if __name__ == "__main__":
    main()

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


if __name__ == "__main__":
    main()

Solution (Python):
def main():
    sx, sy, tx, ty = map(int, input().split())
    path = []
    path.append(''.join('U' * (ty - sy)))
    path.append(''.join('R' * (tx - sx)))
    path.append(''.join('D' * (ty - sy)))
    path.append(''.join('L' * (tx - sx)))

    path.append('L')
    path.append(''.join('U' * (ty - sy + 1)))
    path.append(''.join('R' * (tx - sx + 1)))
    path.append('D')
    path.append('R')
    path.append(''.join('D' * (ty - sy + 1)))
    path.append(''.join('L' * (tx - sx + 1)))
    path.append('U')

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


if __name__ == "__main__":
    main()

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


def add(A, item, times):
    for _ in range(times):
        A.append(item)


answer = []
add(answer, 'U', y)
add(answer, 'R', x)
add(answer, 'R', 1)
add(answer, 'D', y+1)
add(answer, 'L', x+1)
add(answer, 'U', 1)
add(answer, 'R', x)
add(answer, 'U', y)
add(answer, 'U', 1)
add(answer, 'L', x+1)
add(answer, 'D', y+1)
add(answer, 'R', 1)
print("".join(answer))

Solution (Python):
def solve(x, y):
    root = ""
    for _ in range(y):
        root = root + "U"
    for _ in range(x):
        root = root + "R"
    for _ in range(y):
        root = root + "D"
    for _ in range(x):
        root = root + "L"
    root = root + "L"
    for _ in range(y+1):
        root = root + "U"
    for _ in range(x+1):
        root = root + "R"
    root = root + "D"
    root = root + "R"
    for _ in range(y+1):
        root = root + "D"
    for _ in range(x+1):
        root = root + "L"
    root = root + "U"


    print(root)

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

main()

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"
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):
sx,sy,tx,ty = map(int, input().split())
dx = tx-sx
dy = ty-sy

if dx >=0 and dy >=0:
    print("U"*dy+"R"*dx+"D"*dy+"L"*dx+"D"*1+"R"*(dx+1)+"U"*(dy+1)+"L"*1+"U"*1+"L"*(dx+1)+"D"*(dy+1)+"R")

elif dx < 0 and dy >=0:
    print("U"*dy+"L"*abs(dx)+"D"*dy+"R"*abs(dx)+"D"*1+"L"*(abs(dx)+1)+"U"*(dy+1)+"R"*1+"U"*1+"R"*(abs(dx)+1)+"D"*(dy+1)+"L")

elif dx >= 0 and dy <0:
    print("D"*abs(dy)+"R"*dx+"U"*abs(dy)+"L"*dx+"U"*1+"R"*(dx+1)+"D"*(abs(dy)+1)+"L"*1+"D"*1+"L"*(dx+1)+"U"*(abs(dy)+1)+"R")

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

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

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

lst = []
lst.append("U" * y)
lst.append("R" * x)
lst.append("D" * y)
lst.append("L" * (x + 1))
lst.append("U" * (y + 1))
lst.append("R" * (x + 1))
lst.append("D")
lst.append("R")
lst.append("D" * (y + 1))
lst.append("L" * (x + 1))
lst.append("U")
print("".join(lst))

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

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

Solution (Python):
from collections import deque

sx, sy, tx, ty = map(int, input().split())
w = tx - sx
h = ty - sy
ans = 'R'*w + 'U'*h + 'L'*w + 'D'*h + 'D' + 'R'*(w+1) + 'U'*(h+1) + 'L' + 'U' + 'L'*(w+1) + 'D'*(h+1) + 'R'
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=map(int,input().split())
ans=[[] for _ in range(4)]

x=sx
y=sy

while y!=ty or x!=tx:
    if y<ty:
        y+=1
        ans[0].append("U")
        ans[1].append("D")
    elif x<tx:
        x+=1
        ans[0].append("R")
        ans[1].append("L")
       
x=sx-1
y=sy
ans[2].append("L")
ans[3].append("R")

while 1:
    if y<ty+1:
        y+=1
        ans[2].append("U")
        ans[3].append("D")
    elif x<tx:
        x+=1
        ans[2].append("R")
        ans[3].append("L")
    else:
        ans[2].append("D")
        ans[3].append("U")
        break

li=[]

for i in range(4):
    for j in ans[i]:
        li.append(j)

print(''.join(li))

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

Solution (Python):
import sys
sys.setrecursionlimit(10**6)
from math import floor,ceil,sqrt,factorial,log
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from operator import itemgetter
from fractions import gcd
mod = 10 ** 9 + 7
inf = float('inf')
ninf = -float('inf')
 

def ii(): return int(sys.stdin.readline().rstrip()) 
def mii(): return map(int,sys.stdin.readline().rstrip().split())
def limii(): return list(mii()) 
def lin(n:int): return [ii() for _ in range(n)]
def llint(n: int): return [limii() for _ in range(n)]

def ss(): return sys.stdin.readline().rstrip() 
def mss(): return sys.stdin.readline().rstrip().split()
def limss(): return list(mss()) 
def lst(n:int): return [ss() for _ in range(n)]
def llstr(n: int): return [limss() for _ in range(n)]





sx,sy,tx,ty = mii()

route=[]

route.extend(["U"]*(ty-sy))
route.extend(["R"]*(tx-sx))
route.extend(["D"]*(ty-sy))
route.extend(["L"]*(tx-sx))

route.extend(["L"])
route.extend(["U"]*(ty-sy+1))
route.extend(["R"]*(tx-sx+1))
route.extend(["D"])
route.extend(["R"])
route.extend(["D"]*(ty-sy+1))
route.extend(["L"]*(tx-sx+1))
route.extend(["U"])
print("".join(route))

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

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

print(ans)

Solution (Python):
xs,ys,xg,yg = map(int,input().split())

ans = ''
for i in range(yg-ys):
    ans += 'U'
for i in range(xg-xs):
    ans += 'R'

for i in range(yg-ys):
    ans += 'D'
for i in range(xg-xs + 1):
    ans += 'L'

for i in range(yg-ys+1):
    ans += 'U'
for i in range(xg-xs+1):
    ans += 'R'
ans += 'DR'

for i in range(yg-ys+1):
    ans += 'D'
for i in range(xg-xs + 1):
    ans += 'L'

ans += 'U'
print(ans)

Solution (Python):
sx, sy, tx, ty = 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):
    print('L', end='')


print('L', end='')
for i in range(ty-sy+1):
    print('U', end='')

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

print('D', end='')


print('R', end='')
for i in range(ty - sy + 1):
    print('D', end='')

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

print('U', end='')

Solution (Python):
A,B,C,D = map(int,input().split())
ans = ""
ans += (C-A) * "R" + (D-B) * "U"
ans += (C-A) * "L" + (D-B) * "D"
ans += "L" + (D-B+1) * "U" + (C-A+1) * "R"+ "D"
ans += "R" + (D-B+1) * "D" + (C-A+1) * "L"+ "U"
print(ans)

Solution (Python):
def resolve():
    sx, sy, tx, ty = list(map(int, input().split()))
    dx = tx - sx
    dy = ty - sy
    res = "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(res)


if '__main__' == __name__:
    resolve()

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

dx = tx - sx
dy = ty - sy

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

print(ans)

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

w = tx - sx
h = ty - sy

route = ''

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

print(route)

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

for i in range(dy):
    root += 'U'
for j in range(dx):
    root += 'R'
for k in range(dy):
    root += 'D'
for j in range(dx):
    root += 'L'
    
root += 'L'

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

for k in range(dy+1):
    root += 'D'
for j in range(dx+1):
    root += 'L'
    
    
root += 'U'    
    
print(root)