设等差数列an的前n项和为Sn,若Sm=0,Sm+2=2,Sm+4=8,则公差d=