One says that the manifold M′ is produced by a surgery cutting out S^p \times D^q and gluing in D^{p+1} \times S^{q-1}, or by a p-surgery if one wants to specify the number p. Strictly speaking, M′ is a manifold with corners, but there is a canonical way to smooth them out. Notice that the submanifold that was replaced in M was of the same dimension as M (it was of codimension 0).
