Title: the descrete maximum principle a study of multistage systems optimization