import sys import math from collections import defaultdict inputs = sys.stdin.readline """再帰関数のときセット sys.setrecursionlimit(10**7) import pypyjit pypyjit.set_param('max_unroll_recursion=-1') """ MOD = 998244353 def main(): N, M = map(int, inputs().split()) A = list(map(int, inputs().split())) after_dic = defaultdict(int) for a in A: before_dic, after_dic = after_dic, defaultdict(int) for GCD, cnt in before_dic.items(): after_dic[GCD] += cnt after_dic[GCD] %= MOD GCD2 = math.gcd(GCD, a) after_dic[GCD2] += cnt after_dic[GCD2] %= MOD after_dic[a] += 1 for i in range(1, M + 1): print(after_dic[i] % MOD) if __name__ == '__main__': main()