#include <bits/stdc++.h>
using namespace std;
#define R(i, a, b) for (int i = (a); i < (b); ++i)
#define L(i, a, b) for (int i = (b) - 1; i >= (a); --i)
using i64 = long long;
int M;
struct mint {
  int x;
  const int operator()() {
    return x;
  }
  mint(int _x = 0) : x(_x) {}
};
mint operator+(const mint &a, const mint &b) {
  const int x = a.x + b.x;
  return x < M ? x : x - M;
}
mint operator-(const mint &a, const mint &b) {
  const int x = a.x - b.x;
  return x < 0 ? x + M : x;
}
mint operator*(const mint &a, const mint &b) {
  return i64(a.x) * b.x % M;
}
mint &operator+=(mint &a, const mint &b) {
  a = a + b; return a;
}
mint &operator*=(mint &a, const mint &b) {
  a = a * b; return a;
}
mint pw(mint a, int x = M - 2) {
  mint res = 1;
  for (; x; x >>= 1, a *= a) if (x & 1) res *= a;
  return res;
}
constexpr int xn = 501;
int n;
mint c[xn][xn], f[xn][xn][xn];
int main() {
  freopen("tree.in", "r", stdin); freopen("tree.out", "w", stdout);
  ios::sync_with_stdio(false); cin.tie(0);
  cin >> n >> M;
  R(i, 0, n + 1) R(j, 0, i + 1) c[i][j] = !j ? 1 : c[i - 1][j] + c[i - 1][j - 1]; 
  f[0][0][1] = 1;
  R(i, 0, n) R(j, 0, n + 1) R(k, 1, n + 1) if (f[i][j][k]()) {
    R(x, 1, j + 1) f[i + 1][j - x + 1][k - 1] += f[i][j][k] * c[j][x];
    R(x, 1, n + 1 - (k - 1)) f[i + 1][j + 1][k - 1 + x] += f[i][j][k] * c[k - 1 + x][x];
  }
  // R(i, 0, n + 1) R(j, 0, n + 1) R(k, 0, n + 1) if (f[i][j][k]()) cerr << "f[" << i << ", " << j << ", " << k << "] = " << f[i][j][k]() << '\n'; // @
  R(i, 2, n + 1) cout << f[i][1][0]() << '\n';
  return 0;
}