n, M, C = map(int, input().split()) A = list(map(int, input().split())) sumA = sum(A) # Initialize DP table. dp[j][k] is the count of ways to choose j elements summing to k. dp = [[0] * (sumA + 1) for _ in range(C + 1)] dp[0][0] = 1 for a in A: # Iterate j from C down to 1 to avoid using the same element multiple times in the same step for j in range(C, 0, -1): # Iterate k from sumA down to a to prevent overwriting values that are yet to be processed for k in range(sumA, a - 1, -1): if dp[j-1][k - a]: dp[j][k] = (dp[j][k] + dp[j-1][k - a]) % M # Prepare the result for C elements, from s=1 to sumA result = [] for s in range(1, sumA + 1): result.append(str(dp[C][s] % M)) print(' '.join(result))