Solve a Stack State Diagram
Python 3, 84 bytes

lambda n,*s:"DLL"+"L".join(i*"SLSC"+"LSLSCDURLCULCULSC"for i in s[::-1])+n*"SR"+"UR"


Usage:

# Example: 4 2 0 1 3 2 -&gt; LSLCSLSCSLCULSLSCSLSCLSLDCSCUSLCU
&gt;&gt;&gt; f = lambda ...
&gt;&gt;&gt; f(4, 2, 0, 1, 3, 2)
'DLLSLSCSLSCLSLSCDURLCULCULSCLSLSCSLSCSLSCLSLSCDURLCULCULSCLSLSCLSLSCDURLCULCULSCLLSLSCDURLCULCULSCLSLSCSLSCLSLSCDURLCULCULSCSRSRSRSRUR'


Explanation: To start off we duplicate the zero and wrap it in a list:

DL -&gt; 3 2 1 0 (0)


This is our base. Now I will explain a general algorithm that turns ... 1 0 (x) into ... 1 0 (i x) for arbitrary integer i. I will use as an example i = 2, and we have some arbitrary list (x). We start by wrapping our current list (x) into another list:

L -&gt; 3 2 1 0 ((x))


Now we repeat the following sequence i times:

SLSC -&gt; 3 2 1 (0 (x))
SLSC -&gt; 3 2 (1 0 (x))


Now we're ready to insert the 2 into list (x). This goes as follows:

LSLSC -&gt; 3 (2 (1 0 (x)))
DU -&gt; 3 (2 (1 0 (x))) 2 (1 0 (x))
RLCU -&gt; 3 2 (1 0 (x)) 2
LCU -&gt; 3 2 1 0 (x) 2
LSC -&gt; 3 2 1 0 (2 x)


Note that we keep pushing new integers on the left. So the very first (0) we started with stays on the right.

After we have inserted every integer we need into the list we remove the rest of the stack by swapping and removing n time (SR). Finally we unpack our list and delete the first 0 we inserted to start our list (UR).