def main(): n, mod = map(int, input().split()) dp = [[[0]*(n**2+1) for i in range(n+1)] for k in range(2)] dp[0][0][0] = 1 for i in range(n): for j in range(n+1): for k in range(n**2+1): ci = i%2 ni = (i+1)%2 dp[ni][j][k] = 0 if j-1 >= 0: dp[ni][j][k] += dp[ni][j-1][k] if j <= i and j <= k: dp[ni][j][k] += dp[ci][j][k-j] dp[ni][j][k] %= mod for i in range(n**2+1): print(dp[n%2][n][i]%mod) if __name__ == '__main__': main()