n, m = map(int, input().split()) dp = [[[0] * (n ** 2 + n + 1) for _ in range(n + 1)] for _ in range(n + 1)] dp[0][0][0] = 1 for i in range(n + 1): for j in range(n + 1): for k in range(n ** 2): if i + 1 <= n and i + 1 >= j: dp[i + 1][j][k + j] += dp[i][j][k] dp[i + 1][j][k + j] %= m if j + 1 <= n and i >= j + 1: dp[i][j + 1][k] += dp[i][j][k] dp[i][j + 1][k] %= m for i in range(n ** 2 + 1): print(dp[-1][-1][i])