import sys input = sys.stdin.readline N,mod=map(int,input().split()) DP=[[0]*(N*N+1) for i in range(N+1)] DP[0][0]=1 for i in range(1,N+1): NDP=[[0]*(N*N+1) for i in range(N+1)] for zero in range(N+1): for ten in range(N*N+1): if DP[zero][ten]==0: continue for j in range(max(zero,i),N+1): ten2=(i-1)*(j-zero)+ten NDP[j][ten2]=(NDP[j][ten2]+DP[zero][ten])%mod DP=NDP for i in range(N*N+1): print(DP[N][i])