Let $(\mathcal A,\varphi)$ be a noncommutative probability space, and let $\kappa_k:\mathcal A^k\to\mathbb C$, for $k\geq 1$, be the free cumulants associated to $\varphi$. Let $x_1,\dots,x_n\in\mathcal A$ with $n\geq 1$. For integers $p,q$ with $1\leq p\leq q\leq n$, define $M[p,q]:=\varphi(x_p\cdots x_q)$, and set $M[p,q]:=1$ when $p>q$. Then
\begin{align*}
M[1,n]=\sum_{\substack{k\geq 1,\;1=i_1<i_2<\cdots<i_k\leq n}}\kappa_k(x_{i_1},\dots,x_{i_k})\prod_{j=1}^{k}M[i_j+1,i_{j+1}-1],
\end{align*}
where $i_{k+1}:=n+1$. The same formula applies to any interval subword after relabelling its first position as $1$.