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 < 2; 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++ { dp[(i+1) % 2][j][k] = 0 } for k := 0; k <= N*N; k++ { if k+j <= N*N && i+1 <= N { dp[(i+1) % 2][j][k+j] = (dp[(i+1) % 2][j][k+j] + dp[i % 2][j][k]) % M } if i >= j+1 && j+1 <= N { dp[i % 2][j+1][k] = (dp[i % 2][j+1][k] + dp[i % 2][j][k]) % M } } } } for i := 0; i <= N*N; i++ { fmt.Fprintln(w, dp[N%2][N][i]) } }