import sys MOD = 998244353 def main(): input = sys.stdin.read().split() idx = 0 N, M = int(input[idx]), int(input[idx+1]) idx += 2 A = list(map(int, input[idx:idx+N])) from collections import defaultdict cnt = defaultdict(int) for a in A: if a != 0: # Skip zeros since they contribute nothing cnt[a] += 1 result = [0] * (M + 1) for v in cnt: c = cnt[v] current = v for k in range(1, M + 1): result[k] = (result[k] + current * c) % MOD if k < M: current = current * v % MOD print(' '.join(map(str, result[1:M+1]))) if __name__ == '__main__': main()