已知集合M={a,a+d,a+2d},N={a,aq,aq2},其中a不等于0,M=N,求q的值