The algorithm for automatic reducing of the topology of a h-genus three-dimensional polyhedron to the topology of a ball is proposed. The polyhedron is assumed to be represented by a three-dimensional cell complex. The special technique for separation of two-dimensional subcomplexes producing the cutting surfaces is described. This technique is based on calculation of Betti groups of the polyhedron.