Multipartite generalization of the Schmidt decomposition