#include #include using namespace std; template class Combinatorics { private: static vector factorial; static vector factinv; public: static void init(int n) { int b = factorial.size(); if (n < b) return; factorial.reserve(n + 1); while ((int)factorial.size() <= n) factorial.push_back(factorial.back() * factorial.size()); factinv.resize(n + 1); factinv[n] = T(1) / factorial[n]; for (int i = n; i > b; --i) factinv[i - 1] = factinv[i] * i; } static T fact(int x) { init(x); return factorial[x]; } static T finv(int x) { init(x); return factinv[x]; } static T comb(int n, int r) { if (r < 0 || r > n) return 0; init(n); return factorial[n] * factinv[n - r] * factinv[r]; } }; template std::vector Combinatorics::factorial = std::vector(1, 1); template std::vector Combinatorics::factinv = std::vector(1, 1); using mint = atcoder::modint998244353; using comb = Combinatorics; int main() { int N, A, B; cin >> N >> A >> B; mint T = mint{A} / mint{B}; vector> f(N + 1); f[0] = {0, 1}; for (int i = 0; i < N; ++i) { int M = 1 << i; vector a = f[i]; vector b = a; for (int j = 0; j <= M; ++j) b[j] += (1 - a[j]) * T * 2; for (int j = 0; j <= M; ++j) a[j] *= comb::comb(M, j); for (int j = 0; j <= M; ++j) b[j] *= comb::comb(M, j); vector c = atcoder::convolution(a, b); f[i + 1].resize(M * 2 + 1); for (int j = 0; j <= M * 2; ++j) { f[i + 1][j] = c[j]; f[i + 1][j] /= comb::comb(M * 2, j); } } vector> g(N + 1); g[0] = {1}; for (int i = 0; i < N; ++i) { int M = 1 << i; vector a = g[i]; vector b(M + 1); for (int j = 0; j <= M; ++j) b[j] = (1 - T) * f[i][j] + T * (1 - f[i][j]); for (int j = 0; j < M; ++j) a[j] *= comb::comb(M - 1, j); for (int j = 0; j <= M; ++j) b[j] *= comb::comb(M, j); vector c = atcoder::convolution(a, b); g[i + 1].resize(M * 2); for (int j = 0; j < M * 2; ++j) { g[i + 1][j] = c[j]; g[i + 1][j] /= comb::comb(M * 2 - 1, j); } } for (int i = 0; i < (1 << N); ++i) cout << g[N][i].val() << endl; }