$shape(-1,5,4)=(1,3,2)$ for $n=3$.
The word $7\,8\,6\,1\,3\,2\,4\,5,$ is $3$-universal.
$$W_3=7\,8\,6\,1\,3\,2\,4\,5$$
$$W_4\,=\,22\,23\,24\,21\,20\,18\,19\,3\,17\,4\,2\,16\,1\,6\,7\,5\,11\,10\,8\,13\,9\,12\,15\,14$$
For $n=3$ and the starting $W=(a_1,a_2)=(2,3)$ the algorithm GREEDY can return the following universal word $$W_3=2\ 3\ 1\ 0\ 3\ 1\ 2\ 3.$$
The sequence of shapes of consecutive factors of length 3 is: $$(2,3,1)\rightarrow (3,2,1)\rightarrow (2,1,3)\rightarrow (1,3,2)\rightarrow (3,1,2)\rightarrow (1,2,3).$$
The word $W_3$ is derived in a greedy way as follows: $$12 \rightarrow 231 \rightarrow 3421 \rightarrow 45312 \rightarrow 564132 \rightarrow 6751324 \rightarrow 78613245$$
Two words $u$ and $v$ of the same length are said to be order-equivalent, written $u \approx v$, if $u[i] \lt u[j]\Longleftrightarrow v[i] \lt v[j]$ for all pairs of positions $i,j$ on the words. For a word $u$ of length $n$ with all letters distinct we define $shape(u)$ as the $n$-permutation of $\{1,2,\ldots,n\}$ order-equivalent to $u$. Define $$SHAPES(w)=\{shape(u)\,\mid\, u\ \mbox{is a factor of}\ w\ \mbox{of length}\ n\}.$$
For $n\gt 2$ there is no word containing exactly once each $n$-permutation, but there is a word $W$ over a larger linearly ordered alphabet such that for each permutation $\pi$ there is exactly one subword of $W$ order-equivalent to $\pi$. In other words $|W|=n!+n-1$ and $SHAPES(W)$ is the set of all $n$-permutations. Such words $W$ are called $n$-universal words of permutations.
In other words the word $|W|$ of size $n!+n-1$ is universal if and only if $SHAPES(W)$ is the set of all $n$-permutations.
The crucial operation in the greedy generation presented here of a universal word is the shape-extension of an $(n-1)$-permutation $\alpha=(a_1,a_2,\ldots,a_{n-1})$ of distinct numbers. Assume $(b_1,b_2,\ldots,b_{n-1})$ is the sorted version of $\alpha$. Define $b_0=-\infty,b_n=+\infty$. Then for $k\geq 1 $ denote $$Level_k(\alpha)=\{x \mid b_{k-1}\lt x\lt b_k\} $$ and $$ ExtShape(\alpha,k)=shape(\alpha\,a) \ \mbox{for any}\ a\in Level_k(\alpha). $$
Denote by $suf_{n-1}(W)$ the suffix of $W$ of length $n-1$.
\begin{algorithmic} \STATE{$W\leftarrow a_1\,a_2\,\ldots,a_{n-1}\ \mbox{where}\ a_1\lt a_2\lt \cdots\lt a_{n-1}$} \FOR{$i\leftarrow 1$ to $n!$} \STATE{$\alpha\leftarrow suf_{n-1}(W)$} \STATE{$k\leftarrow \min\{j\geq 1 \mid ExtShape(\alpha,j) \notin SHAPES(W)\}$} \STATE{$(*)$ let $a$ be any real number in $Level_k(\alpha)$} \STATE{$W\leftarrow W\,a$} \ENDFOR \RETURN{$W$} \end{algorithmic}