Inverse problem for multi-body interaction of nonlinear waves