def naive(n,m,a): mod=1<