#include #include using namespace std; int main() { int n, m; cin >> n >> m; vector dp(2, vector(n+1, vector(n * n + 1, 0))); int cur = 0, prev = 1; dp[prev][0][0] = 1; dp[cur][0][0] = 1; for (int i = 1; i <= 2 * n; i++) { for (int j = 1; j <= i / 2; j++) { for (int k = 0; k <= n * n; k++) { dp[cur][j][k] = dp[prev][j-1][k]; if (k >= j) dp[cur][j][k] += dp[prev][j][k-j]; if (dp[cur][j][k] >= m) dp[cur][j][k] -= m; } } swap(cur, prev); } for (int k = 0; k <= n * n; k++) cout << dp[prev][n][k] << endl; }