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++ (GCC 5.4.1) (judge verdict: Wrong Answer)

#include<bits/stdc++.h>
using namespace std;
const int mod=924844033,maxn=200010;
int hea[maxn],nxt[maxn*2],to[maxn*2],a[maxn<<2],b[maxn<<2],n,tot;
inline int read()
{
	int x=0,f=1;char ch=getchar();
	for(;ch<'0'||ch>'9';ch=getchar())if(ch=='-')f=-1;
	for(;ch>='0'&&ch<='9';x=(x<<1)+(x<<3)+ch-'0',ch=getchar());
	return x*f;
}
void add(int x,int y)
{
	nxt[++tot]=hea[x];
	hea[x]=tot;
	to[tot]=y;
}
int powmod(int a,int b)
{
	int ans=1;
	while(b)
	{
		if(b&1)ans=1ll*ans*a%mod;
		a=1ll*a*a%mod;
		b>>=1;
	}
	return ans;
}
int dfs(int x,int fa)
{
	int s=1;
	for(int i=hea[x];i;i=nxt[i])if(to[i]!=fa)
	{
		int t=dfs(to[i],x);
		a[t]++;
		s+=t;
	}
	if(s<n)a[n-s]++;
	return s;
}
void NTT(int n,int *x,int f)
{
	for(int i=0,j=0;i<n;i++)
	{
		if(j<i)swap(x[i],x[j]);
		for(int l=n>>1;(j^=l)<l;l>>=1);
	}
	for(int i=2;i<=n;i<<=1)
	{
		int m=i>>1,wn=powmod(5,(mod-1)/i);
		if(f==-1)wn=powmod(wn,mod-2);
		for(int j=0;j<n;j+=i)
			for(int k=0,w=1;k<m;k++)
			{
				int t=1ll*w*x[j+k+m]%mod;
				x[j+k+m]=(x[j+k]-t+mod)%mod;
				x[j+k]=(x[j+k]+t)%mod;
				w=1ll*w*wn%mod;
			}
	}
	int t=powmod(n,mod-2);
	if(f==-1)
		for(int i=0;i<n;i++)
			x[i]=1ll*x[i]*t%mod;
}
int main()
{
	n=read();
	int x,y,s=1;
	for(int i=1;i<n;i++)
	{
		x=read(),y=read();
		add(x,y);
		add(y,x);
	}
	dfs(1,0);
	b[0]=1;
	for(int i=1;i<=n;i++)
	{
		s=1ll*s*i%mod;
		a[i]=1ll*a[i]*s%mod;
		b[i]=powmod(s,mod-2);
	}
	for(int i=0;i<=n>>1;i++)
		swap(a[i],a[n-i]);
	int n1=1,t=n<<1;
	while(n1<t)n1<<=1;
	NTT(n1,a,1),NTT(n1,b,1);
	for(int i=0;i<n1;i++)
		a[i]=1ll*a[i]*b[i]%mod;
	NTT(n1,a,-1);
	int s1=1,s2=1;
	for(int i=1;i<=n;i++)
	{
		s1=1ll*s1*i%mod;
		s2=1ll*s2*(n-i+1)%mod;
		int t=powmod(s1,mod-2);
		printf("%lld\n",(1ll*n*s2*t%mod-1ll*t*a[n-i]%mod+mod)%mod);
	}
	return 0;
}