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