#include #define rep(i,n) for(int i = 0; i < (int)(n); i++) #define rrep(ri,n) for(int ri = (int)(n-1); ri >= 0; ri--) #define rep2(i,x,n) for(int i = (int)(x); i < (int)(n); i++) #define rrep2(ri,x,n) for(int ri = (int)(n-1); ri >= (int)(x); ri--) #define repit(itr,x) for(auto itr = x.begin(); itr != x.end(); itr++) #define rrepit(ritr,x) for(auto ritr = x.rbegin(); ritr != x.rend(); ritr++) #define ALL(x) x.begin(), x.end() using ll = long long; using namespace std; #include using namespace atcoder; using mint = modint; int main() { int n, m; cin >> n >> m; mint::set_mod(m); vector dp(n+1, vector(n*n+1, 0)); dp.front().front()++; rep(i, n*2) { vector ndp(n+1, vector(n*n+1, 0)); rep(j, n+1) { int rj = i - j; rep(k, n*n+1) { ndp.at(j).at(k) += dp.at(j).at(k); if(rj > j && j < n && k+rj <= n*n) { ndp.at(j+1).at(k+rj) += dp.at(j).at(k); } } } dp = ndp; } // rep(i, n*2+1) { // rep(j, n+1) { // rep(k, n*n+1) { // cerr << dp.at(i).at(j).at(k).val() << " "; // } // cerr << endl; // } // cerr << "------------------" << endl; // } rrep(i, n*n+1) { cout << dp.back().at(i).val() << endl; } return 0; }