import collections import math N,M = map(int, input().split()) A = list(map(int, input().split())) A.sort() mod = 998244353 DP = collections.Counter() for a in A: NDP = collections.Counter() for k,v in DP.items(): gc = math.gcd(k, a) NDP[gc]=(NDP[gc]+v)%mod NDP[a]+=1 DP.update(NDP) for i in range(1,M+1): print(DP[i]%mod)