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 <iostream> 
#include <cstdio> 
#include <cstdlib> 
#include <cstring> 
#include <cmath> 
#include <algorithm> 
using namespace std; 
inline int gi() {
    register int data = 0, w = 1;
    register char ch = 0;
    while (!isdigit(ch) && ch != '-') ch = getchar(); 
    if (ch == '-') w = -1, ch = getchar(); 
    while (isdigit(ch)) data = 10 * data + ch - '0', ch = getchar(); 
    return w * data; 
} 
const int Mod = 924844033, G = 5; 
int fpow(int x, int y) { 
	int res = 1; 
	while (y) { 
		if (y & 1) res = 1ll * res * x % Mod; 
		x = 1ll * x * x % Mod; 
		y >>= 1; 
	} 
	return res; 
} 
const int iG = fpow(G, Mod - 2); 
const int MAX_N = 2e5 + 5; 
int Limit, rev[MAX_N << 2]; 
void FFT_prepare(int len) { 
	int p = 0; 
	for (Limit = 1; Limit <= len; Limit <<= 1) ++p; 
	for (int i = 1; i < Limit; i++) rev[i] = (rev[i >> 1] >> 1) | ((i & 1) << (p - 1)); 
} 
void NTT(int *p, int op) { 
	for (int i = 1; i < Limit; i++) if (i < rev[i]) swap(p[i], p[rev[i]]); 
	for (int i = 1; i < Limit; i <<= 1) { 
		int rot = fpow(op == 1 ? G : iG, (Mod - 1) / (i << 1)); 
		for (int j = 0; j < Limit; j += i << 1) 
			for (int k = 0, w = 1; k < i; k++, w = 1ll * w * rot % Mod) { 
				int x = p[j + k], y = 1ll * w * p[i + j + k] % Mod; 
				p[j + k] = (x + y) % Mod, p[i + j + k] = (x - y + Mod) % Mod; 
			} 
	} 
	if (!op) { 
		int inv = fpow(Limit, Mod - 2); 
		for (int i = 0; i < Limit; i++) p[i] = 1ll * p[i] * inv % Mod; 
	} 
} 
struct Graph { int to, next; } e[MAX_N << 1]; 
int fir[MAX_N], e_cnt; 
void clearGraph() { memset(fir, -1, sizeof(fir)); e_cnt = 0; } 
void Add_Edge(int u, int v) { e[e_cnt] = (Graph){v, fir[u]}, fir[u] = e_cnt++; } 
int N, f[MAX_N << 2], g[MAX_N << 2], h[MAX_N << 2];
int siz[MAX_N], cnt[MAX_N]; 
void dfs(int x, int fa) { 
	siz[x] = 1; 
	for (int i = fir[x]; ~i; i = e[i].next) {
		int v = e[i].to; if (v == fa) continue; 
		dfs(v, x), siz[x] += siz[v]; 
		cnt[siz[v]]++; 
	} 
	cnt[N - siz[x]]++; 
} 
int fac[MAX_N], ifc[MAX_N]; 
int C(int n, int m) { 
	if (n < 0 || m < 0 || n < m) return 0; 
	else return 1ll * fac[n] * ifc[n - m] % Mod * ifc[m] % Mod; 
} 
int main () { 
	clearGraph(); 
	N = gi(); 
	for (int i = 1; i < N; i++) { 
		int u = gi(), v = gi(); 
		Add_Edge(u, v), Add_Edge(v, u); 
	} 
	fac[0] = 1; for (int i = 1; i <= N; i++) fac[i] = 1ll * fac[i - 1] * i % Mod; 
	ifc[N] = fpow(fac[N], Mod - 2); 
	for (int i = N - 1; ~i; i--) ifc[i] = 1ll * ifc[i + 1] * (i + 1) % Mod;
	dfs(1, 0); 
	for (int i = 1; i <= N; i++) g[i] = 1ll * cnt[i] * fac[i] % Mod; 
	for (int i = 0; i <= N; i++) h[i] = ifc[i]; 
	reverse(&g[0], &g[N + 1]); 
	FFT_prepare(N << 1); 
	NTT(g, 1), NTT(h, 1); 
	for (int i = 0; i < Limit; i++) f[i] = 1ll * g[i] * h[i] % Mod; 
	NTT(f, 0); 
	for (int i = 1; i <= N; i++) { 
		int ans = 1ll * N * C(N, i) % Mod; 
		ans = (ans - 1ll * ifc[i] * f[N - i] % Mod + Mod) % Mod; 
		printf("%d\n", ans); 
	} 
    return 0; 
}