Effective construction of topologically nontrivial solutions in general relativity