class Combinatorics: def __init__(self, n: int) -> None: self.n = n self.fa = [1] * (self.n * 2 + 1) self.fi = [1] * (self.n * 2 + 1) for i in range(1, self.n * 2 + 1): self.fa[i] = self.fa[i - 1] * i % mod self.fi[-1] = pow(self.fa[-1], mod - 2, mod) for i in range(self.n * 2, 0, -1): self.fi[i - 1] = self.fi[i] * i % mod def comb(self, n: int, r: int) -> int: if n < r:return 0 if n < 0 or r < 0:return 0 return self.fa[n] * self.fi[r] % mod * self.fi[n - r] % mod def perm(self, n: int, r: int) -> int: if n < r:return 0 if n < 0 or r < 0:return 0 return self.fa[n] * self.fi[n - r] % mod def combr(self, n: int, r: int) -> int: if n == r == 0:return 1 return self.comb(n + r - 1, r) n, mod = map(int, input().split()) dp = [[0] * n for i in range(n + 1)] C = Combinatorics(300) dp[0][0] = 1 for i in range(n): for j in range(i + 1): dp[i + 1][j] += dp[i][j] dp[i + 1][j] %= mod for k in range(2, n - i + 1): dp[i + k][j + k - 1] += dp[i][j] * C.comb(n - i - 1, k - 1) * pow(k, k - 2, mod) dp[i + k][j + k - 1] %= mod print(*dp[n], sep="\n")