$\phi(P)=2\, \phi(P_2, \ldots, P_t^*\ldots, P_j)$.

3.  $P_1=QUD$ and $Q$ is a nonempty Dyck path. Set $\phi(P)=3\,
     \phi(Q^*, P_2,  \ldots, P_j)$ if $t=1$ and set $\phi(P_1, \ldots, P_j) =3 \, \phi (Q, P_2, \ldots, P_t^*, \ldots, P_j)$ if $t>1$.

4.  $P_1=Q_1UQ_2D$, where $Q_1$ and $Q_2$ are nonempty Dyck paths. Then we set $$\phi(P_1, \ldots, P_j)=1\, \phi
     (Q_1, Q_2, P_2, \ldots, P_t^*, \ldots, P_j)
     \text{ if }
     t>1 ,$$ $$\phi(P)=1\, \phi
     (Q_1, Q_2^*, P_2, \ldots, P_j) \text{ if } t=1.$$

5.  If $P_1=UQD$ and $Q$ is a nonempty Dyck path. Then we set $$\phi(P)=4\, \phi(Q, P_2, \ldots, P_t^*, \ldots,
    P_j).$$

In order to show that $\phi$ is a bijection, we construct the reverse map of $\phi$. Let $w=w_1w_2\cdots w_{i-1}$ be a sequence of length $i-1$ on $\{1, 2, 3, 4\}$. If $i=1$, then it corresponds to $UD$. We now assume that $i>1$. Suppose that $w_2w_3\cdots w_{i-1}$ corresponds to a rooted composition $(R_1, R_2, \cdots, R_m)$ of a Dyck path $P$ of length $2(i-1)$ with $R_k$ being the distinguished segment. We proceed to find a rooted composition $(P_1, P_2, \ldots, P_j)$ with $P_t$ being the distinguished segment such that $\phi(P_1,
P_2, \ldots, P_j) = w_1 \phi(R_1, R_2, \ldots, R_m)$.

If $w_1=2$, we have 