n,mod = map(int,input().split()) M = n*(n-1)//2 dp = [[0]*(M+1) for i in range(n+1)] dp[0][0] = 1 for i in range(2*n): ndp = [[0]*(M+1) for j in range(n+1)] for j in range(n+1): for k in range(M+1): if dp[j][k] == 0: continue if j != n: ndp[j+1][k] += dp[j][k] ndp[j+1][k] %= mod if i-j >= j: continue ndp[j][k+n-j] += dp[j][k] ndp[j][k+n-j] %= mod dp = ndp for i in dp[n]: print(i) for i in range(n**2-M): print(0)