Problem:
Score : 1900 points

Problem Statement

#nck {
width: 30px;
height: auto;
}

One day, Takahashi was given the following problem from Aoki:

You are given a tree with N vertices and an integer K. The vertices are numbered 1 through N. The edges are represented by pairs of integers (a_i, b_i).

For a set S of vertices in the tree, let f(S) be the minimum number of the vertices in a subtree of the given tree that contains all vertices in S.

There are ways to choose K vertices from the trees. For each of them, let S be the set of the chosen vertices, and find the sum of f(S) over all ways.

Since the answer may be extremely large, print it modulo 924844033(prime).

Since it was too easy for him, he decided to solve this problem for all K = 1,2,...,N.

Constraints

2 ≦ N ≦ 200,000

1 ≦ a_i, b_i ≦ N

The given graph is a tree.

Input

The input is given from Standard Input in the following format:

N
a_1 b_1
a_2 b_2
:
a_{N-1} b_{N-1}

Output

Print N lines. The i-th line should contain the answer to the problem where K=i, modulo 924844033.

Sample Input 1

3
1 2
2 3

Sample Output 1

3
7
3

The diagram above illustrates the case where K=2. The chosen vertices are colored pink, and the subtrees with the minimum number of vertices are enclosed by red lines.

Sample Input 2

4
1 2
1 3
1 4

Sample Output 2

4
15
13
4

Sample Input 3

7
1 2
2 3
2 4
4 5
4 6
6 7

Sample Output 3

7
67
150
179
122
45
7

Solution in C++14 (GCC 5.4.1) (judge verdict: Accepted)

#include <cassert>
#include <cctype>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <bitset>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <utility>
#include <vector>
typedef long long LL;
typedef unsigned long long ULL;
typedef long double LD;
using std::cin; using std::cout;
using std::endl;
using std::bitset; using std::map;
using std::queue; using std::priority_queue;
using std::set; using std::string;
using std::stringstream; using std::vector;
using std::pair; using std::make_pair;
typedef pair<int, int> pii;
typedef pair<LL, LL> pll;
typedef pair<ULL, ULL> puu;
#ifdef DEBUG
using std::cerr;
#define pass cerr << "[" << __FUNCTION__ << "] : line = " << __LINE__ << endl;
#define display(x) cerr << #x << " = " << x << endl;
#define displaya(a, st, n)                                                     \
  {                                                                            \
    cerr << #a << " = {";                                                      \
    for (int qwq = (st); qwq <= (n); ++qwq)                                    \
      if (qwq == (st))                                                         \
        cerr << a[qwq];                                                        \
      else                                                                     \
        cerr << ", " << a[qwq];                                                \
    cerr << "}" << endl;                                                       \
  }
#define displayv(a) displaya(a, 0, (int)(a.size() - 1))
#include <ctime>
class MyTimer {
    clock_t st;
public:
    MyTimer() { cerr << std::fixed << std::setprecision(0); reset(); }
    ~MyTimer() { report(); }
    void reset() { st = clock_t(); }
    void report() {  cerr << "Time consumed: " << (clock() - st) * 1e3 / CLOCKS_PER_SEC << "ms" << endl; }
} myTimer;
#else
#define cerr if(false) std::cout
#define pass ;
#define display(x) ;
#define displaya(a, st, n) ;
#define displayv(a) ;
class MyTimer {
public: void reset() {} void report() {}
} myTimer;
#endif

template<typename A, typename B>
std::ostream& operator << (std::ostream &cout, const pair<A, B> &x) {
    return cout << "(" << x.first << ", " << x.second << ")";
}
template<typename T1, typename T2>
inline bool chmin(T1 &a, const T2 &b) { return a > b ? a = b, true : false; }
template<typename T1, typename T2>
inline bool chmax(T1 &a, const T2 &b) { return a < b ? a = b, true : false; }
#ifdef QUICK_READ
char pool[1<<15|1],*it=pool+32768;
#define getchar() (it>=pool+32768?(pool[fread(pool,sizeof(char),1<<15,stdin)]=EOF,*((it=pool)++)):*(it++))
#endif
inline int readint() {
    int a = 0; char c = getchar(), p = 0;
    while(isspace(c)) c = getchar();
    if(c == '-') p = 1, c = getchar();
    while(isdigit(c)) a = a*10 + c - '0', c = getchar();
    return p ? -a : a;
}


const int maxN = 1 << 19;
const LL P = 924844033;
template<LL P, LL g>
struct FastFourierTransform {
    LL p[maxN], ip[maxN];
    int n, rev[maxN];
    LL qpow(LL a, LL b) {
        LL r = 1;
        while(b) {
            if(b & 1) (r *= a) %= P;
            (a *= a) %= P; b >>= 1;
        }
        return r;
    }
    void prepare(int n) {
        assert((n & (n - 1)) == 0);
        this->n = n;
        int width = 0;
        for(; (1 << width) < n; ++width);
        p[0] = ip[0] = 1;
        p[1] = qpow(g, (P - 1) / n); ip[1] = qpow(p[1], P - 2);
        for(int i = 2; i < n; ++i) p[i] = p[i - 1] * p[1] % P, ip[i] = ip[i - 1] * ip[1] % P;
        rev[0] = 0;
        for(int i = 1; i < n; ++i) rev[i] = rev[i >> 1] >> 1 | (i & 1) << (width - 1);
    }
    LL sum(LL x, LL y) { return x + y >= P ? x + y - P : x + y; }
    LL dif(LL x, LL y) { return x - y < 0 ? x - y + P : x - y; }
    void transform(LL a[], int n, int flag) {
        assert(flag == 1 || flag == -1);
        if(this->n != n) prepare(n);
        for(int i = 0; i < n; ++i) if(rev[i] < i) std::swap(a[i], a[rev[i]]);
        LL *wn = flag == 1 ? p : ip;
        for(int i = 1; i < n; i <<= 1) {
            int step = n / (i << 1);
            for(int j = 0; j < n; j += (i << 1)) {
                LL *w = wn;
                for(int k = 0; k < i; ++k, w += step) {
                    LL x = a[j + k], y = a[j + k + i] * *w % P;
                    a[j + k] = sum(x, y);
                    a[j + k + i] = dif(x, y);
                }
            }
        }
        if(flag == -1) {
            LL in = qpow(n, P - 2);
            for(int i = 0; i < n; ++i) a[i] = a[i] * in % P;
        }
    }
    void convolve(LL a[], LL b[], LL c[], int n) {
        int N = n * 2;
        while(N & (N - 1)) N += N & -N;
        for(int i = n; i < N; ++i) a[i] = b[i] = 0;
        transform(a, N, 1); transform(b, N, 1);
        for(int i = 0; i < N; ++i) c[i] = a[i] * b[i] % P;
        transform(c, N, -1);
    }
    void bf_convolve(LL a[], LL b[], LL c[], int n) {
        memset(c, 0, sizeof(LL) * n);
        for(int i = 0; i <= n; ++i)
            for(int j = 0; i + j <= n; ++j)
                (c[i + j] = c[i + j] + a[i] * b[j]) % P;
    }
};
FastFourierTransform<924844033, 5> FFT;

int n;
vector<int> G[maxN];
LL fac[maxN], ifac[maxN];
LL a[maxN], b[maxN], c[maxN];

int DFS(int u, int fa) {
    int sz = 1;
    for(int v : G[u]) if(v != fa) {
        sz += DFS(v, u);
    }
    if(sz < n) {
        a[sz]++;
        a[n - sz]++;
    }
    return sz;
}

LL choose(int n, int k) {
    return fac[n] * ifac[n - k] % P * ifac[k] % P;
}

int main() {
    n = readint();
    for(int i = 0; i < n - 1; ++i) {
        int x = readint(), y = readint();
        G[x].push_back(y);
        G[y].push_back(x);
    }
    fac[0] = 1;
    for(int i = 1; i <= n; ++i) fac[i] = fac[i - 1] * i % P;
    ifac[n] = FFT.qpow(fac[n], P - 2);
    for(int i = n - 1; i >= 0; --i) ifac[i] = ifac[i + 1] * (i + 1) % P;
    memset(a, 0, sizeof(a));
    memset(b, 0, sizeof(b));
    DFS(1, -1);
    for(int i = 0; i <= n; ++i) a[i] = a[i] * fac[i] % P;
    for(int i = 0; i <= n; ++i) b[i] = ifac[i];
    displaya(a, 1, n); displaya(b, 1, n);
    std::reverse(a + 1, a + n + 1);
    FFT.convolve(a, b, c, n + 1);
    std::reverse(c + 1, c + n + 1);
    for(int i = 1; i <= n; ++i) c[i] = c[i] * ifac[i] % P;
    displaya(c, 1, n);
    for(int i = 1; i <= n; ++i) {
        LL ans = n * choose(n, i) % P;
        ans = FFT.dif(ans, c[i]);
        printf("%lld\n", ans);
    }
    return 0;
}