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