There is an infinite sequence of functions $g_1,g_2,\ldots$, each of them is $\Bbb R\to\Bbb R$. Prove that there exists a finite set of functions $f_1,f_2,\ldots,f_n$ such that any function $g_k$ can be expressed as a composition $f_{k_1}\circ f_{k_2}\circ\cdots\circ f_{k_m}$.