  Given an affine control system $\dot{\mathbf x} = f({\mathbf x}) +
\sum_{j=1}^m g_j({\mathbf x}) u_j$ we present an algorithmic process of
construction of submanifolds that are invariant under controls assuming that
the linear span of $f, g_1, \ldots, g_m$ has constant rank. We use the method
of reduction of Pfaffian systems to a largest integrable subsystem and finding
the first integrals and the generalized first integrals for the vector fields.
