def main(): import sys input = sys.stdin.read().split() idx = 0 N = int(input[idx]) idx += 1 M = int(input[idx]) idx += 1 C = int(input[idx]) idx += 1 A = list(map(int, input[idx:idx+N])) idx += N sum_total = sum(A) dp = [{} for _ in range(C + 1)] dp[0][0] = 1 for a in A: for k in range(C, 0, -1): if not dp[k-1]: continue current_dict = dp[k-1] for s in list(current_dict.keys()): new_s = s + a count = current_dict[s] if new_s in dp[k]: dp[k][new_s] = (dp[k][new_s] + count) % M else: dp[k][new_s] = count % M result = [] for s in range(1, sum_total + 1): result.append(str(dp[C].get(s, 0) % M)) print(' '.join(result)) if __name__ == '__main__': main()