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