from collections import defaultdict N,M,C = map(int,input().split()) A = list(map(int,input().split())) S = sum(A) DP = defaultdict(int) DP[0, 0] = 1 for i in range(N): DP2 = defaultdict(int) for k,v in DP.items(): c = k[0] x = k[1] if c < C: DP2[c+1, x+A[i]] += v % M DP2[c, x] += v % M DP = DP2 print(*[DP[C, i] % M for i in range(1,S+1)])