package main import ( "fmt" "bufio" "os" ) func main() { r := bufio.NewReader(os.Stdin) w := bufio.NewWriter(os.Stdout) defer w.Flush() var N, M int fmt.Fscan(r, &N, &M) var dp [][][]int = make([][][]int, N+1) for i := 0; i <= N; i ++ { dp[i] = make([][]int, N+1) for j := 0; j <= N; j++ { dp[i][j] = make([]int, N*N+1) } } dp[0][0][0] = 1 for i := 0; i <= N; i++ { for j := 0; j <= N; j++ { for k := 0; k <= N*N; k++ { if k+j <= N*N && i+1 <= N { dp[i+1][j][k+j] = (dp[i+1][j][k+j] +dp[i][j][k]) % M } if i >= j+1 && j+1 <= N { dp[i][j+1][k] = (dp[i][j+1][k] + dp[i][j][k]) % M } } } } for i := 0; i <= N*N; i++ { fmt.Fprintln(w, dp[N][N][i]) } }