package yukicoder; import java.util.Scanner; public class No1492 { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int N = scan.nextInt(); int M = scan.nextInt(); scan.close(); int[][][] dp = new int[2*N][N+1][N*N+1]; dp[0][0][0] = 1; for (int i=0; i < 2*N-1; i++) { for (int j=0; j <= N; j++) { for (int k=0; k <= N*N; k++) { if (k+j <= N*N && i+1-j <= N) { dp[i+1][j][k+j] = (dp[i+1][j][k+j] +dp[i][j][k]) % M; } if (i-j+1 >= j+1 && j+1 <= N) { dp[i+1][j+1][k] = (dp[i+1][j+1][k] + dp[i][j][k]) % M; } } } } for (int i=0; i <= N*N; i++) { System.out.println(dp[2*N-1][N][i]); } } }