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;

#define int long long

#define rep(i,n) for(int i=0;i<(n);i++)
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
typedef vector<int>vint;
typedef pair<int,int>pint;
typedef vector<pint>vpint;

template<typename A,typename B>inline void chmin(A &a,B b){if(a>b)a=b;}
template<typename A,typename B>inline void chmax(A &a,B b){if(a<b)a=b;}


const int mod=924844033;
inline void add(int &a,int b){
    a+=b;
    if(a>=mod)a-=mod;
}
int mpow(int n,int m){
    int ret=1;
    while(m){
        if(m&1)ret=ret*n%mod;
        n=n*n%mod;
        m>>=1;
    }
    return ret;
}
const int FACT_SIZE=1111111;
int fact[FACT_SIZE];
int inv[FACT_SIZE];
struct fact_exec{
    fact_exec(){
        fact[0]=1;
        for(int i=1;i<FACT_SIZE;i++)fact[i]=fact[i-1]*i%mod;
        inv[FACT_SIZE-1]=mpow(fact[FACT_SIZE-1],mod-2);
        for(int i=FACT_SIZE-2;i>=0;i--)inv[i]=inv[i+1]*(i+1)%mod;
    }
}factexec;
int nCk(int n,int k){
    if(n<0|k<0||k>n)return 0;
    return fact[n]*inv[k]%mod*inv[n-k]%mod;
}
int nPk(int n,int k){
    if(n<0||k<0||k>n)return 0;
    return fact[n]*inv[n-k]%mod;
}

struct NumberTheoreticTransform{
	int mod;
    int root;
	NumberTheoreticTransform(int mod,int root):mod(mod),root(root){}

	int mul(int x,int y){
		return x*y%mod;
	}
	int add(int x,int y){
		return (x+=y)>=mod?x-mod:x;
	}

	int pow(int x,int y){
		int res=1;
		while(y){
			if(y&1)res=mul(res,x);
			x=mul(x,x);
			y>>=1;
		}
		return res;
	}

	int inv(int x){
		return pow(x,mod-2);
	}

	void ntt(vector<int>&f,bool rev=false){
		int n=f.size();
        for(int i=0,j=1;j<n-1;j++){
            for(int k=n>>1;k>(i^=k);k/=2);
            if(i>j)swap(f[i],f[j]);
        }

     	for(int m=2;m<=n;m*=2){
            int wr=pow(root,(mod-1)/m);
            if(rev)wr=inv(wr);
            for(int i=0;i<n;i+=m){
                int w=1;
                for(int j=0;j<m/2;j++){
                    int f0=f[i+j],f1=mul(w,f[i+j+m/2]);
                    f[i+j]=add(f0,f1);
                    f[i+j+m/2]=add(f0,mod-f1);
                    w=mul(w,wr);
                }
            }
        }
        if(rev){
        	int v=inv(n);
        	for(int i=0;i<n;i++)f[i]=mul(f[i],v);
		}
	}
	vector<int>multiply(vector<int>A,vector<int>B){
        int n=1;
        while(n<A.size()+B.size()-1)n<<=1;
        A.resize(n);B.resize(n);
        ntt(A);
        ntt(B);
        for(int i=0;i<n;i++)A[i]=mul(A[i],B[i]);
        ntt(A,true);
        A.resize(A.size()+B.size()-1);
        return A;
    }
}ntt(mod,5);


int N;
vint G[222222];
int ans[222222];

int S[1<<18];

int sz[222222];
void dfs(int v,int p){
    sz[v]=1;
    for(auto u:G[v]){
        if(u==p)continue;
        dfs(u,v);
        sz[v]+=sz[u];
        S[sz[u]]++;
    }
    if(N!=sz[v])S[N-sz[v]]++;
}

vint po[18];

vint calc(int k,int l){
    if(k==0){
        return {S[l]};
    }
    int r=l+(1<<k);

    int m=(l+r)/2;

    vint a=calc(k-1,l);
    vint b=calc(k-1,m);
    b=ntt.multiply(b,po[k-1]);
    while(b.size()>(1<<k))b.pop_back();
    rep(i,a.size())add(b[i],a[i]);
    return b;
}

signed main(){
    po[0]={1,1};


    for(int i=1;i<18;i++){
        po[i]=ntt.multiply(po[i-1],po[i-1]);

        while(po[i].size()>(1<<i)+1)po[i].pop_back();
    }

    scanf("%lld",&N);
    rep(i,N-1){
        int a,b;
        scanf("%lld%lld",&a,&b);
        a--;b--;
        G[a].pb(b);G[b].pb(a);
    }
    dfs(0,-1);

    vint a=calc(18,0);
    for(int k=1;k<=N;k++){
        int tmp=nCk(N,k)*N%mod;
        add(tmp,mod-a[k]);
        printf("%lld\n",tmp);
    }
    return 0;
}