fn main() { let mut nm = String::new(); std::io::stdin().read_line(&mut nm).ok(); let nm: Vec = nm.trim().split_whitespace().map(|s| s.parse().unwrap()).collect(); let n = nm[0]; let MOD = nm[1]; let limit = (0..n).sum::(); let mut dp = vec![vec![0usize; limit+1]; n+1]; dp[1][0] = 1; for ccnt in 1..2*n { let mut next_dp = vec![vec![0usize; limit+1]; n+1]; for i in 0..=n { for j in 0..=limit { if dp[i][j] == 0 { continue; } if i+1 <= n { next_dp[i+1][j] += dp[i][j]; next_dp[i+1][j] %= MOD; } if i >= ccnt-i+1 { let inv_val = n - i; next_dp[i][j+inv_val] += dp[i][j]; next_dp[i][j+inv_val] %= MOD; } } } dp = next_dp; } for i in 0..=limit { println!("{}", dp[n][i]); } for i in limit+1..=n*n { println!("0"); } }