N,mod=map(int,input().split()) DP=[[[0]*(N*N+1) for i in range(N+2)] for j in range(2*N+1)] DP[0][0][0]=1 for i in range(2*N): for j in range(N+1): if (i-j)>j: continue for k in range(N*(N-1)+1): DP[i+1][j+1][k+(i-j)]=(DP[i+1][j+1][k+(i-j)]+DP[i][j][k])%mod DP[i+1][j][k]=(DP[i+1][j][k]+DP[i][j][k])%mod print(*[DP[N*2][N][i] for i in range(N*N+1)],sep='\n')