N,M = map(int,input().split()) S = N * N dp = [[0] * (S+1) for _ in range(N+1)] dp[0][0] = 1 for i in range(2,2 * N + 1): nx = [[0] * (S + 1) for _ in range(N+1)] for j in range(i//2): for k in range(S+1): nx[j+1][k] += dp[j][k] nx[j+1][k] %= M for j in range(max(0,i-N),N+1): for k in range(S+1): if j + k > S: break else: nx[j][k+j] += dp[j][k] nx[j][k+j] %= M dp = nx print(*dp[N],sep = "\n")