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):
import math
import fractions
import bisect
import collections
import itertools
import heapq
import string
import sys
import copy
from decimal import *
from collections import deque
sys.setrecursionlimit(10**7)
MOD = 10**9+7
INF = float('inf') 
def gcd(a,b):return fractions.gcd(a,b) 
def lcm(a,b):return (a*b) // fractions.gcd(a,b) 
def iin(): return int(sys.stdin.readline()) 
def ifn(): return float(sys.stdin.readline()) 
def isn(): return sys.stdin.readline().split() 
def imn(): return map(int, sys.stdin.readline().split()) 
def imnn(): return map(lambda x:int(x)-1, sys.stdin.readline().split()) 
def fmn(): return map(float, sys.stdin.readline().split()) 
def iln(): return list(map(int, sys.stdin.readline().split())) 
def iln_s(): return sorted(iln()) 
def iln_r(): return sorted(iln(), reverse=True) 
def fln(): return list(map(float, sys.stdin.readline().split())) 
def join(l, s=''): return s.join(l) 
def perm(l, n): return itertools.permutations(l, n) 
def perm_count(n, r): return math.factorial(n) // math.factorial(n-r) 
def comb(l, n): return itertools.combinations(l, n) 
def comb_count(n, r): return math.factorial(n) // (math.factorial(n-r) * math.factorial(r)) 
def two_distance(a, b, c, d): return ((c-a)**2 + (d-b)**2)**.5 
def m_add(a,b): return (a+b) % MOD
def print_list(l): print(*l, sep='\n')
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def No(): print('No')

def sieves_of_e(n):
    is_prime = [True] * (n+1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5)+1):
        if not is_prime[i]: continue
        for j in range(i * 2, n+1, i): is_prime[j] = False
    return is_prime

sx,sy,tx,ty=imn()

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

Solution (Python):










"""def kiri(n,m):
  r_ = n / m
  if (r_ - (n // m)) > 0:
    return (n//m) + 1
  else:
    return (n//m)"""

""" n! mod m 階乗
mod = 1e9 + 7
N = 10000000
fac = [0] * N
def ini():
  fac[0] = 1 % mod
  for i in range(1,N):
    fac[i] = fac[i-1] * i % mod"""

"""mod = 1e9+7
N = 10000000
pw = [0] * N
def ini(c):
  pw[0] = 1 % mod
  for i in range(1,N):
    pw[i] = pw[i-1] * c % mod"""

"""
def YEILD():
  yield 'one'
  yield 'two'
  yield 'three'
generator = YEILD()
print(next(generator))
print(next(generator))
print(next(generator))
"""
"""def gcd_(a,b):
  if b == 0:
    return a
  return gcd_(a,a % b) 
"""def extgcd(a,b,x,y):
  d = a
  if b!=0:
    d = extgcd(b,a%b,y,x)
    y -= (a//b) * x
    print(x,y)
  else:
    x = 1
    y = 0
  return d"""


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

def main():
  sx,sy,tx,ty = readInts()
  h  =ty - sy
  w = tx-sx
  a = 'U' * h + 'R' * w
  b  = 'D' * h + 'L' * w
  print(a + b + 'LU' + a + 'RDRD' + b + 'LU')
if __name__ == '__main__':
  main()

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

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

ans=''

for _ in range(h):
    ans+="U"
    

for _ in range(w+1):
    ans+="R"
    

for _ in range(h+1):
    ans+="D"
    

for _ in range(w+1):
    ans+="L"
    

ans+="UL"

for _ in range(h+1):
    ans+="U"

for _ in range(w+1):
    ans+="R"

for _ in range(h+1):
    ans+="D"

for _ in range(w):
    ans+="L"

print(ans)

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

S = ""
for k in range(2):
    if k == 1:
        S += "L"
    for i in range(ty-sy+k):
        S += "U"
    for i in range(tx-sx+k):
        S += "R"
    if k == 1:
        S += "DR"
    for i in range(ty-sy+k):
        S += "D"
    for i in range(tx-sx+k):
        S += "L"
    if k == 1:
        S += "U"

print(S)

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

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

Solution (Python):
walklist=[]
a,b,c,d=map(int,input().split())
x_diff=c-a
y_diff=d-b
walklist.append("U"*y_diff)
walklist.append("R"*x_diff)
walklist.append("D"*y_diff)
walklist.append("L"*(x_diff+1))
walklist.append("U"*(y_diff+1))
walklist.append("R"*(x_diff+1))
walklist.append("D")
walklist.append("R")
walklist.append("D"*(y_diff+1))
walklist.append("L"*(x_diff+1))
walklist.append("U")
print("".join(walklist))

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

dx=tx-sx
dy=ty-sy

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

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

print(root)

Solution (Python):
ax,ay,bx,by = map(int,input().split())
path = []
y = int(by-ay)
x = int(bx-ax)

for i in range(y):
    path.append('U')
for i in range(abs(x)):
    path.append('R')
for i in range(y):
    path.append('D')
for i in range(abs(x)):
    path.append('L')

path.append('L')
for i in range(y+1):
    path.append('U')
for i in range(x+1):
    path.append('R')
path.append('D')
path.append('R')
for i in range(y+1):
    path.append('D')
for i in range(x+1):
    path.append('L')
path.append('U')
print(''.join(path))

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

print(''.join(s))

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

r1 = 'R'*W + 'U'*H + 'L'*W + 'D'*H
r2 = 'D' + 'R'*(W+1) + 'U'*(H+1) + 'L' + 'U' + 'L'*(W+1) + 'D'*(H+1) +'R'
print(r1+r2)

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

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

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

y = ty - sy
x = tx - sx

u = "U" * y
r = "R" * x
d = "D" * y
l = "L" * x

offset1 = "LU"
offset2 = "RD"
print(u + r + d + l + offset1 + u + r + offset2 + offset2 + d + l + offset1)

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

y = ty - sy
x = tx - sx

u = "U" * y
r = "R" * x
d = "D" * y
l = "L" * x

offset1 = "LU"
offset2 = "RD"
print(u + r + d + l + offset1 + u + r + offset2 + offset2 + d + l + offset1)

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

dx, dy = tx - sx, ty - sy

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

print(path)

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

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

home = [sx,sy]
goal = [tx,ty]
point = [sx,sy]

ans_li = []

def move_to(start,end):
  while start!=end:
    if start[0]>end[0]:
      start[0]-=1
      ans_li.append('L')
    if start[0]<end[0]:
      start[0]+=1
      ans_li.append('R')
    if start[1]>end[1]:
      start[1]-=1
      ans_li.append('D')
    if start[1]<end[1]:
      start[1]+=1
      ans_li.append('U')

move_to(home,[sx,ty])
move_to([sx,ty],[tx,ty])
move_to(goal,[tx,sy])
move_to([tx,sy],[sx,sy])

ans_li.append('L')
move_to([sx-1,sy],[sx-1,ty+1])
move_to([sx-1,ty+1],[tx,ty+1])
ans_li.append('D')
ans_li.append('R')
move_to([tx+1,ty],[tx+1,sy-1])
move_to([tx+1,sy-1],[sx,sy-1])
ans_li.append('U')

print(''.join(ans_li))

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

go1 = ['U']*(ty-sy)+['R']*(tx-sx)

back1 = ['D']*(ty-sy)+['L']*(tx-sx)

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

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

ans = go1+back1+go2+back2

print(''.join(map(str,ans)))

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

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

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

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

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


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

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

print(ans)

Solution (Python):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

s_x, s_y, t_x, t_y = map(int, readline().split())
if s_x < 0 and t_x < 0:
    x = abs(s_x) - abs(t_x)
else:
    x = t_x - s_x
if s_y < 0 and t_y < 0:
    y = abs(s_y) - abs(t_y)
else:
    y = t_y - s_y
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())
way = []
way += ['U' for _ in range(ty-sy)]
way += ['R' for _ in range(tx-sx)]
way += ['D' for _ in range(ty-sy)]
way += ['L' for _ in range(tx-sx+1)]
way += ['U' for _ in range(ty-sy+1)]
way += ['R' for _ in range(tx-sx+1)]
way += ['D','R']
way += ['D' for _ in range(ty-sy+1)]
way += ['L' for _ in range(tx-sx+1)]
way += ['U']
print(''.join(way))

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

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

print(ans)

Solution (Python):
import sys
from collections import *
import heapq
import math
import bisect
from itertools import permutations,accumulate,combinations,product
from fractions import gcd
def input():
    return sys.stdin.readline()[:-1]
def ruiseki(lst):
    return [0]+list(accumulate(lst))
mod=pow(10,9)+7
al=[chr(ord('a') + i) for i in range(26)]

sx,sy,tx,ty=map(int,input().split())
anslst=""
anslst+="R"*(tx-sx)
anslst+="U"*(ty-sy)
anslst+="L"*(tx-sx)
anslst+="D"*(ty-sy)

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

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

print(anslst)

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

p[0]=p[0]-1
root = "".join((root, "L"))
for i in range(ty - sy+1):
    p[1] = p[1] + 1
    root = "".join((root, "U"))
for i in range(tx - sx+1):
    p[0] = p[0] + 1
    root = "".join((root, "R"))
p[1]=p[1]-1
root = "".join((root, "D"))
p[0]=p[0]+1
root = "".join((root, "R"))
for i in range(ty - sy+1):
    p[1] = p[1] + 1
    root = "".join((root, "D"))
for i in range(tx - sx+1):
    p[0] = p[0] + 1
    root = "".join((root, "L"))
p[1]=p[1]+1
root = "".join((root, "U"))



print(root)

Solution (Python):
a,b,c,d = map(int,(input().split()))
x = c-a
y = d-b
ans = []
if x > 0 and y > 0:
    for i in range(y):
        ans.append("U")
    for i in range(x):
        ans.append("R")
    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 range(x):
        ans.append("R")
    for i in range(y):
        ans.append("U")
    ans.append("R")
    for i in range(y+1):
        ans.append("D")
    for i in range(x+1):
        ans.append("L")
    ans.append("U")

if x > 0 and y < 0:
    for i in range(-y):
        ans.append("D")
    for i in range(x):
        ans.append("R")
    ans.append("D")
    for i in range(x+1):
        ans.append("L")
    for i in range(-y+1):
        ans.append("U")
    ans.append("R")

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

if x < 0 and y > 0:
    for i in range(y):
        ans.append("U")
    for i in range(-x):
        ans.append("L")
    ans.append("U")
    for i in range(-x+1):
        ans.append("R")
    for i in range(y+1):
        ans.append("D")
    ans.append("L")

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

if x < 0 and y < 0:
    for i in range(-y):
        ans.append("D")
    for i in range(-x):
        ans.append("L")
    ans.append("D")
    for i in range(-x+1):
        ans.append("R")
    for i in range(-y+1):
        ans.append("U")
    ans.append("L")

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

if y==0:
    if x>0:
        for i in range(x):
            ans.append("R")
        ans.append("U")
        for i in range(x):
            ans.append("L")
        ans.append("D")

        ans.append("D")
        for i in range(x):
            ans.append("R")
        ans.append("U")
        ans.append("R")
        ans.append("D")
        ans.append("D")
        for i in range(x+2):
            ans.append("L")
        ans.append("U")
        ans.append("U")
        ans.append("R")
    if x<0:
        x = -x
        for i in range(x):
            ans.append("L")
        ans.append("U")
        for i in range(x):
            ans.append("R")
        ans.append("D")

        ans.append("D")
        for i in range(x):
            ans.append("L")
        ans.append("U")
        ans.append("L")
        ans.append("D")
        ans.append("D")
        for i in range(x+2):
            ans.append("R")
        ans.append("U")
        ans.append("U")
        ans.append("L")

if x==0:
    if y>0:
        for i in range(y):
            ans.append("U")
        ans.append("R")
        for i in range(y):
            ans.append("D")
        ans.append("L")

        ans.append("L")
        for i in range(y):
            ans.append("U")
        ans.append("R")
        ans.append("U")
        ans.append("L")
        ans.append("L")
        for i in range(y+2):
            ans.append("D")
        ans.append("R")
        ans.append("R")
        ans.append("U")
    if y<0:
        y = -y
        for i in range(y):
            ans.append("D")
        ans.append("R")
        for i in range(y):
            ans.append("U")
        ans.append("L")

        ans.append("L")
        for i in range(y):
            ans.append("D")
        ans.append("R")
        ans.append("D")
        ans.append("L")
        ans.append("L")
        for i in range(y+2):
            ans.append("U")
        ans.append("R")
        ans.append("R")
        ans.append("D")

output = "".join(ans)
print(output)

Solution (Python):
a, b, c, d = map(int, input().split())
x = c-a
y = d-b
ans = []
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+1):
    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')
print(''.join(ans))

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

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

dx = tx - sx
dy = ty - sy

ans = []
ans += ["U"] * dy
ans += ["R"] * dx
ans += ["D"] * dy
ans += ["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, sep="")

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,end="")
print("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())
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())
right = abs(tx - sx)
up = abs(ty - sy)
root = 'U'*up + 'R'*right
root_back = 'D'*up + 'L'*right
root2 = 'L' + 'U'*(up+1) + 'R'*(right+1) + 'D'
root_back2 = 'R' + 'D'*(up+1) + 'L'*(right+1) + 'U'
print(root+root_back+root2+root_back2)

Solution (Python):
sx, sy, tx, ty = map(int, input().split())
v = [tx - sx, ty - sy]
ans = []
ans.append(("").join(["R"] * v[0]))
ans.append(("").join(["U"] * v[1]))
ans.append(("").join(["L"] * v[0]))
ans.append(("").join(["D"] * (v[1] + 1)))
ans.append(("").join(["R"] * (v[0] + 1)))
ans.append(("").join(["U"] * (v[1] + 1)))
ans.append("LU")
ans.append(("").join(["L"] * (v[0] + 1)))
ans.append(("").join(["D"] * (v[1] + 1)))
ans.append("R")
print(("").join(ans))

Solution (Python):
sx, sy, tx, ty = map(int, input().split())
v = [tx - sx, ty - sy]
ans = []
ans.append("".join(["R"] * v[0]))
ans.append("".join(["U"] * v[1]))
ans.append("".join(["L"] * v[0]))
ans.append("".join(["D"] * (v[1] + 1)))
ans.append("".join(["R"] * (v[0] + 1)))
ans.append("".join(["U"] * (v[1] + 1)))
ans.append("LU")
ans.append("".join(["L"] * (v[0] + 1)))
ans.append("".join(["D"] * (v[1] + 1)))
ans.append("R")
print("".join(ans))

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

dx = "R" * (tx - sx)
dy = "U" * (ty - sy)
ans = dx + dy

dx = "L" * (tx - sx)
dy = "D" * (ty - sy)
ans = ans + dx + dy

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

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

print(ans)

Solution (Python):


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

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

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

print(ans)

Solution (Python):

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

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

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())
dx = tx-sx
dy = ty-sy
a = ['U','R','D','L']
print(
    a[0]*dy+
    a[1]*dx+
    a[2]*dy+
    a[3]*(dx+1)+
    a[0]*(dy+1)+
    a[1]*(dx+1)+
    a[2]+a[1]+
    a[2]*(dy+1)+
    a[3]*(dx+1)+
    a[0]
)

Solution (Python):
sx,sy,tx,ty = map(int,input().split())
ans = []
dx = tx-sx
dy = ty-sy
if dy>0:
    if dx>0:
        a = ['U','R','D','L']
    else:
        a = ['U','L','D','R']
else:
    if dx>0:
        a = ['D','R','U','L']
    else:
        a = ['D','L','U','R']
dx,dy = abs(dx),abs(dy)
ans.append(a[0]*dy)
ans.append(a[1]*dx)
ans.append(a[2]*dy)
ans.append(a[3]*(dx+1))
ans.append(a[0]*(dy+1))
ans.append(a[1]*(dx+1))
ans.append(a[2])
ans.append(a[1])
ans.append(a[2]*(dy+1))
ans.append(a[3]*(dx+1))
ans.append(a[0])
print(''.join(ans))

Solution (Python):

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

ans=""

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

print(ans)

Solution (Python):
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')
ans.append('R')
for i in range(tx-sx):
    ans.append('R')
for i in range(ty-sy):
    ans.append('U')
ans.append('U')
ans.append('L')

ans.append('U')
ans.append('L')
for i in range(tx-sx):
    ans.append('L')
for i in range(ty-sy):
    ans.append('D')
ans.append('D')
ans.append('R')

print(''.join(ans))

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

x = tx - sx
y = ty - sy

ret = ''


ret += 'U' * y
ret += 'R' * x
ret += 'D' * y
ret += 'L' * x


ret += 'L'

ret += 'U' * (y + 1)
ret += 'R' * (x + 1)

ret += 'DR'

ret += 'D' * (y + 1)
ret += 'L' * (x + 1)

ret += 'U'

print(ret)

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

x=tx-sx
y=ty-sy

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

Solution (Python):
X0,Y0,X1,Y1 = (int(x) for x in input().split())
s = ""
for i in range(Y1-Y0):
    s += "U"
for i in range (X1-X0):
    s += "R"
for i in range(Y1-Y0):
    s += "D"
for i in range(X1-X0+1):
    s += "L"
for i in range(Y1-Y0+1):
     s += "U"
for i in range (X1-X0+1):
    s += "R"
s += "DR"
for i in range(Y1-Y0+1):
    s += "D"
for i in range(X1-X0+1):
    s += "L"
s += "U"
print(s)

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

Solution (Python):

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


diff_x = abs(tx - sx) 
diff_y = abs(ty - sy) 

ans = ["R" for _ in range(diff_x)]
ans += ["U" for _ in range(diff_y)]
ans += ["L" for _ in range(diff_x)]
ans += ["D" for _ in range(diff_y)]
ans += ["D"] 
ans += ["R" for _ in range(diff_x)]
ans += ["R"] 
ans += ["U"] 
ans += ["U" for _ in range(diff_y)]
ans += ["L"] 
ans += ["U"] 
ans += ["L" for _ in range(diff_x)]
ans += ["L"] 
ans += ["D"] 
ans += ["D" for _ in range(diff_y)]
ans += ["R"] 

print(str(''.join(ans)))

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

print(ans)

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

def go(start, goal):
    x = goal[0] - start[0]
    y = goal[1] - start[1]
    if x < 0:
        st = "L" * abs(x)
    else:
        st = "R" * x

    if y < 0:
        st += "D" * abs(y)
    else:
        st += "U" * y

    return st

def go2(start, goal):
    x = goal[0] - start[0]
    y = goal[1] - start[1]

    if y < 0:
        st = "D" * abs(y)
    else:
        st = "U" * y

    if x < 0:
        st += "L" * abs(x)
    else:
        st += "R" * x

    return st

ans = go([sx, sy], [tx, ty])
ans += go([tx, ty], [sx, sy])
ans += go([sx, sy], [sx - 1, sy])
ans += go2([sx - 1, sy], [tx, ty + 1])
ans += go2([tx, ty + 1], [tx, ty])
ans += go2([tx, ty], [tx + 1, ty])
ans += go2([tx + 1, ty], [sx, sy - 1])
ans += go2([sx, sy - 1], [sx, sy])
print(ans)

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):
s,t,x,y=map(int,input().split());x-=s;y-=t;r='R'*x+'U'*-~y+'L'*-~x+'D'*y;print(r+'DRDR'+r)

Solution (Python):
s,t,x,y=map(int,input().split());x-=s;y-=t;print('R'*x+'U'*y+'L'*x+'D'*-~y+'R'*-~x+'U'*
-~y+'LU'+'L'*-~x+'D'*-~y+'R')

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

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

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

Solution (Python):
import sys
import os

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    sx, sy, tx, ty = il()

    ret = ''
    for n in range(ty - sy): ret += 'U'
    for n in range(tx - sx): ret += 'R'
    for n in range(ty - sy): ret += 'D'
    for n in range(tx - sx): ret += 'L'

    ret += 'L'
    for n in range(ty - sy + 1): ret += 'U'
    for n in range(tx - sx + 1): ret += 'R'
    ret += 'D'
    ret += 'R'
    for n in range(ty - sy + 1): ret += 'D'
    for n in range(tx - sx + 1): ret += 'L'
    ret += 'U'

    print(ret)


if __name__ == '__main__':
    main()

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+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())
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 = map(int,input().split())
x_dif = tx-sx
y_dif = ty-sy

print("U"*y_dif + "R"*x_dif + \
      "D"*y_dif + "L"*x_dif + \
      "L" + "U"*(y_dif+1) + "R"*(x_dif+1) + "D"\
      "R" + "D"*(y_dif+1) + "L"*(x_dif+1) + "U")

Solution (Python):



UP = "U"
DOWN = "D"
RIGHT = "R"
LEFT = "L"


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



diff_x = tx - sx
diff_y = ty - sy

min_path = ""

for y in range(diff_y):
    min_path += UP
for x in range(diff_x):
    min_path += RIGHT


for y in range(diff_y):
    min_path += DOWN
for x in range(diff_x):
    min_path += LEFT


min_path += LEFT
for y in range(diff_y+1):
    min_path += UP
for x in range(diff_x+1):
    min_path += RIGHT
min_path += DOWN


min_path += RIGHT
for y in range(diff_y+1):
    min_path += DOWN
for x in range(diff_x+1):
    min_path += LEFT
min_path += UP

print(min_path)

Solution (Python):
sx, sy, tx, ty = map(int, input().split())
w = tx - sx 
h = ty - sy 
ans = ""
for _ in range(h):
  ans += "U"
for _ in range(w):
  ans += "R"
for _ in range(h):
  ans += "D"
for _ in range(w):
  ans += "L"

ans += "L"
for _ in range(h+1):
  ans += "U"
for _ in range(w+1):
  ans += "R"
ans += "D"
ans += "R"
for _ in range(h+1):
  ans += "D"
for _ in range(w+1):
  ans += "L"
ans += "U"
print(ans)

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

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

if sy == ty:
    
    
    
    
    
    
    l = tx - sx
    print("U" + "R"*l + "D" + "L"*l + "D" + "R" *
          l + "U" + "RDDL" + "L" * l + "LUUR")
elif sx == tx:
    l = ty - sy
    print("L" + "U"*l + "R" + "D"*l + "R" + "U" *
          l + "L" + "URRD" + "D" * l + "DLLU")
else:
    lx = tx - sx
    ly = ty - sy
    print("R"*lx + "U"*ly + "L"*lx + "D"*ly + "DR" + "R" *
          lx + "U" * ly + "UL" + "UL" + "L"*lx + "D"*ly + "DR")