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 <bits/stdc++.h>
using namespace std;
typedef long long ll;

inline void read(int&x){
	char c11=getchar();x=0;while(!isdigit(c11))c11=getchar();
	while(isdigit(c11))x=x*10+c11-'0',c11=getchar();
}

const int N = 601000, p = 924844033, G = 5;
struct Edge{int v,nxt;}a[N+N];
int head[N],sz[N],fac[N],inv[N];
int c[N];
int n,_;

inline int C(int nn,int mm){return (ll)fac[nn] * inv[mm]%p * inv[nn-mm]%p;}
inline int qm(const int&X){return X < p ? X : X - p;}
inline int qpow(int A,int B){
	int res = 1; while(B){
		if(B&1) res = (ll)res * A%p;
		A = (ll)A * A%p, B >>= 1;
	}return res;
}

inline void ad(){
	static int x,y; read(x), read(y);
	a[++_].v = y, a[_].nxt = head[x], head[x] = _;
	a[++_].v = x, a[_].nxt = head[y], head[y] = _;
}

void dfs(int x,int las){
	sz[x] = 1;
	for(int i=head[x];i;i=a[i].nxt)
		if(a[i].v != las){
			dfs(a[i].v,x);
			++c[sz[a[i].v]];
			sz[x] += sz[a[i].v];
		}
	++c[n-sz[x]];
}

namespace NTT{
	int rev[N];
	void ntt(int*a,int n,int sgn){
		for(int i=1;i<n;++i) if(i<rev[i]) swap(a[i], a[rev[i]]);
		for(int i=1;i<n;i<<=1){
			int gn = qpow(G,(p-1)/(i<<1));
			for(int j=0;j<n;j+=(i<<1)){
				int g = 1;
				for(int k=0;k<i;++k,g=(ll)g*gn%p){
					int x = a[j+k], y = (ll)g * a[j+k+i]%p;
					a[j+k] = qm(x+y), a[j+k+i] = qm(x-y+p);
				}
			}
		}
		if(!sgn){
			int iv = qpow(n,p-2); reverse(a+1,a+n);
			for(int i=0;i<n;++i) a[i] = (ll)iv * a[i]%p;
		}
	}
	void work(int*a,int*b,int n){
		int nn = 1, len = -1;
		while(nn <= n+n) nn <<= 1, ++len;
		for(int i=1;i<nn;++i) rev[i] = (rev[i>>1]>>1)|((i&1)<<len);
		ntt(a,nn,1), ntt(b,nn,1);
		for(int i=0;i<nn;++i) a[i] = (ll)a[i] * b[i]%p;
		ntt(a,nn,0);
	}
}

int arr[N],brr[N];

int main(){
	read(n);
	for(int i=1;i<n;++i) ad();
	dfs(1,0);
	
	fac[0] = inv[0] = 1;
	for(int i=1;i<=n;++i) fac[i] = (ll)fac[i-1] * i%p;
	inv[n] = qpow(fac[n], p-2);
	for(int i=n;i;--i) inv[i-1] = (ll)inv[i] * i%p;
	
	brr[0] = 1;
	for(int i=1;i<=n;++i){
		arr[i] = (ll)c[i] * fac[i]%p;
		brr[i] = inv[i];
	}
	reverse(arr,arr+n+1);
	NTT::work(arr,brr,n+1);
	
	for(int i=1;i<=n;++i)
		printf("%lld\n",((ll)C(n,i)*n - (ll)arr[n-i]*inv[i]%p+p)%p);
	return 0;
}