  We consider a configuration of three stacked graphene monolayers with
commensurate twist angles $\theta_{12}/\theta_{23}=p/q$, where $p$ and $q$ are
coprime integers with $0<p<|q|$ and $q$ can be positive or negative. We study
this system using the continuum model in the chiral limit when interlayer
coupling terms between $\textrm{AA}_{12}$ and $\textrm{AA}_{23}$ sites of the
moir\'{e} patterns $12$ and $23$ are neglected. There are only three
inequivalent displacements between the moir\'{e} patterns $12$ and $23$, at
which the three monolayers' Dirac zero modes are protected. Remarkably, for
these displacements and an arbitrary $p/q$ we discover exactly flat bands at an
infinite set of twist angles (magic angles). We provide theoretical explanation
and classification of all possible configurations and topologies of the flat
bands.
