#include <cassert> #include <cmath> #include <algorithm> #include <iostream> #include <iomanip> #include <climits> #include <map> #include <queue> #include <set> #include <cstring> #include <vector> using namespace std; typedef long long ll; int main() { int N, M; cin >> N >> M; ll dp[N + 1][N * N + 1]; memset(dp, 0, sizeof(dp)); dp[0][0] = 1; for (int i = 0; i < 2 * N; ++i) { ll temp[N + 1][N * N + 1]; memset(temp, 0, sizeof(temp)); for (int zc = 0; zc <= N; ++zc) { int oc = i - zc; if (oc > zc) continue; for (int k = 0; k < N * N; ++k) { if (oc + 1 <= zc) { temp[zc][k] += dp[zc][k]; temp[zc][k] %= M; } if (zc + 1 <= N) { temp[zc + 1][k + oc] += dp[zc][k]; temp[zc + 1][k + oc] %= M; } } } memcpy(dp, temp, sizeof(temp)); } for (int k = 0; k <= N * N; ++k) { cout << dp[N][k] << endl; } return 0; }