Definition of the ordered triple (a, b, c) according to Kuratowski's Set Theory.
Just track the definition of the ordered pair:
$$\begin{align*} \langle a,b,c\rangle&=\big\langle\color{blue}{\langle a,b\rangle},c\big\rangle\\ &=\left\langle\color{blue}{\big\{\{a\},\{a,b\}\big\}},c\right\rangle\\ &=\Big\{\left\{\color{blue}{\big\{\{a\},\{a,b\}\big\}}\right\},\left\{\color{blue}{\big\{\{a\},\{a,b\}\big\}},c\right\}\Big\} \end{align*}$$
(I’ve evaluated it from the inside out; I see now that Henno Brandsma has done it from the outside in. You can take your pick; both work fine.)
So we define $(x,y)$ to be $\{\{x\}, \{x,y\}\}$, for any $x,y$.
Then $(a,b,c)$ should be seen as $((a,b),c)$ per the hint.
$((a,b),c) = \{\{(a,b)\}, \{(a,b), c\}\}$.
Now expand $(a,b)$ as well and substitute.
Ordered triples are defined recursivley, so that $(x,y)=\{\{x\},\{x,y\}\}$ and $(x,y,z)=((x,y),z)$. Observe that $((x,y),z)$ only has two elements, $(x,y)$ and $z$, so we can just apply the definition. To make our lives easier, let $q=(x,y)=\{\{x\},\{x,y\}\}$. Then the substitution is simple:
$$\begin{align}\label{eqn:einstein} (x,y,z) &= ((x,y),z) \\ &=(q,z) \\ &= \big\{\{q\},\{q,z\}\big\} \\ &= \big\{\{\{\{x\},\{x,y\}\}\},\{\{\{x\},\{x,y\}\},z\}\big\} \\ \end{align}$$
Likewise, $(x,y,z,w)=((x,y,z),w)$, so letting $q=(x,y,z)$, we can write $(x,y,z,w)=(q,w)= \big\{\{q\},\{q,w\}\big\}$, which we can expand as shown above.
Substitutions are your friend.