Let A ≤ G be a subgroup of a group G. An A-complement of G is a subgroup H of G such that G = AH and A ∩ H = {1}. The 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 (⊲, ⊳) the canonical left/right actions associated to the factorization G = AH. To start with, H is deformed to a new A-complement of G, denoted by Hr, using a certain map r : H → A called a deformation map of the matched pair (A, H, ⊲, ⊳). Then the description of all complements is given: H is an A-complement of G if and only if H is isomorphic to Hr, for some deformation map r : H → 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 D (H, A | (⊲, ⊳)). 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 Sn = Sn−1Cn.