Necessary optimality conditions for N-player nonzero-sum multistage games