N, M = map(int, input().split()) dp = [[0] * (N ** 2 + 1) for _ in range(N + 1)] dp[0][0] = 1 for i in range(2 * N): new_dp = [[0] * (N ** 2 + 1) for _ in range(N + 1)] for j in range(N): for inv in range(N ** 2 + 1): new_dp[j][inv] += dp[j + 1][inv] for j in range(N): if i < j: break tmp = (i - j) // 2 for inv in range(N ** 2 - tmp): new_dp[j + 1][inv + tmp] += dp[j][inv] new_dp[j + 1][inv + tmp] %= M dp = new_dp print(*dp[0], sep='\n')