  Let $A \leq G$ be a subgroup of a group $G$. An $A$-complement of $G$ is a
subgroup $H$ of $G$ such that $G = A H$ and $A \cap H = \{1\}$. The
\emph{classifying complements problem} asks for the description and
classification of all $A$-complements of $G$. We shall give the answer to this
problem in three steps. Let $H$ be a given $A$-complement of $G$ and
$(\triangleright, \triangleleft)$ the canonical left/right actions associated
to the factorization $G = A H$. To start with, $H$ is deformed to a new
$A$-complement of $G$, denoted by $H_r$, using a certain map $r: H \to A$
called a deformation map of the matched pair $(A, H, \triangleright,
\triangleleft)$. Then the description of all complements is given: ${\mathbb
H}$ is an $A$-complement of $G$ if and only if ${\mathbb H}$ is isomorphic to
$H_{r}$, for some deformation map $r: H \to A$. Finally, the classification of
complements proves that there exists a bijection between the isomorphism
classes of all $A$-complements of $G$ and a cohomological object ${\mathcal D}
\, (H, A \, | \,(\triangleright, \triangleleft))$. As an application we show
that the theoretical formula for computing the number of isomorphism types of
all groups of order $n$ arises only from the factorization $S_n = S_{n-1} C_n$.
