n,m=map(int,input().split()) dp=[[0]*(n**2+1) for _ in range(n+1)] dp[0][0]=1 # dp[i][j]:num0=i,num1=j for i in range(2*n): ndp=[[0]*(n**2+1) for _ in range(n+1)] for j in range(n+1): for k in range(n**2+1): if dp[j][k]==0:continue if j>0:# 1を置く ndp[j-1][k]+=dp[j][k] ndp[j-1][k]%=m if i+j<2*n:# 0を置く x1=(i-j)//2 ndp[j+1][k+x1]+=dp[j][k] ndp[j+1][k+x1]%=m dp=ndp ans=[0]*(n**2+1) for j in range(n+1): for k in range(n**2+1): ans[k]+=dp[j][k] ans[k]%=m print(*ans,sep='\n')