Spin-spin interaction in general relativity and induced geometries with nontrivial topology