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)

//ProblemF.cpp

#include <iostream>

static std::istream & ip = std::cin;
static std::ostream & op = std::cout;

#if OJ_MYPC
#include <ojio.h>
#endif

#ifndef OPENOJIO
#define OPENOJIO
#endif

#if 1 || DEFINE
/***************************************************************/
typedef unsigned long long u64;
typedef long long s64;

typedef unsigned uint;

#define ABS(x) ((x) > 0 ? (x) : -(x))

#define MIN(x, y) ((x) < (y) ? (x) : (y))
#define MAX(x, y) ((x) > (y) ? (x) : (y))

#define MIN3(x, y, z) MIN(x, MIN(y, z))
#define MAX3(x, y, z) MAX(x, MAX(y, z))

#define FillZero(arr) memset(arr, 0, sizeof(arr));

/***************************************************************/
#endif //1 || DEFINE

#include <string>
#include <vector>
#include <map>
#include <set>
#include <bitset>
#include <queue>
#include <stack>
#include <utility>
#include <algorithm>
#include <iomanip>
#include <cstring>
#include <cmath>
#include <cstdio>

#include <functional> 
#include <assert.h>

//001
//op << setfill('0') << setw(3) << setiosflags(ios::right) << 1;

//op << fixed << setprecision(20);

using namespace std;

//ProblemF.cpp

#define MAXN 200010
#define MOD 924844033LL

#define N (1 << 19)
#define W 10179

template<int _MOD>
class ModInt {
public:
	static const int Mod = _MOD;

private:
	unsigned x;

public:
	ModInt() : x(0) {}
	ModInt(int sig) { int sigt = sig % Mod; if (sigt < 0) sigt += Mod; x = sigt; }
	ModInt(long long sig) { int sigt = sig % Mod; if (sigt < 0) sigt += Mod; x = sigt; }
	int get() const { return (int)x; }

	ModInt &operator+=(const ModInt& b) { if ((x += b.x) >= Mod) x -= Mod; return *this; }
	ModInt &operator-=(const ModInt& b) { if ((x += Mod - b.x) >= Mod) x -= Mod; return *this; }
	ModInt &operator*=(const ModInt& b) { x = (unsigned long long)x * b.x % Mod; return *this; }
	ModInt &operator/=(const ModInt& b) { return *this *= b.inverse(); }

	friend ModInt operator+ (const ModInt& a, const ModInt& b) { return ModInt(a) += b; }
	friend ModInt operator- (const ModInt& a, const ModInt& b) { return ModInt(a) -= b; }
	friend ModInt operator* (const ModInt& a, const ModInt& b) { return ModInt(a) *= b; }
	friend ModInt operator/ (const ModInt& a, const ModInt& b) { return ModInt(a) /= b; }
	friend bool operator== (const ModInt& a, const ModInt& b) { return a.get() == b.get(); }
	friend bool operator!= (const ModInt& a, const ModInt& b) { return a.get() != b.get(); }

	friend std::ostream& operator<<(std::ostream& ostr, const ModInt & a) { return ostr << a.get(); }
	friend std::istream& operator >> (std::istream& istr, const ModInt & a) { long long t; if (istr >> t) a = t; return istr; }

	ModInt pow(unsigned long long p) const {
		ModInt a = *this;
		ModInt rst = 1;
		while (p) {
			if (p & 1) rst *= a;

			p >>= 1;
			a *= a;
		}
		return rst;
	}

	ModInt inverse() const {
		signed a = x, b = Mod, u = 1, v = 0;
		while (b) {
			signed t = a / b;
			a -= t * b; std::swap(a, b);
			u -= t * v; std::swap(u, v);
		}
		return ModInt(u);
	}
};

template<typename Type>
class FFT {
public:
	const int n;
	const Type w;

public:
	FFT(int n, Type w) : n(n), w(w) {
		assert(n > 0);
		Type wk = (Type)1;
		for (int i = 1; i < n; ++i) {
			wk *= w;
			assert(wk != (Type)1);
		}
		assert(wk * w == (Type)1);
		for (--n; n; n >>= 1) assert(n & 1);
	}

	void calc(std::vector<Type>& rst, const std::vector<Type>& p, int ope = 1) {
		assert(p.size() <= n);
		rst = p;

		calc(rst, ope);
	}

	void calc(vector<Type>& p, int ope = 1) {
		assert((int)p.size() <= n);
		p.resize(n, 0);

		Type ww = ope > 0 ? w : 1 / w;
		for (int m = n, mi = 0; m >= 2; m >>= 1, mi++) {
			int mh = m >> 1;

			Type wc = (Type)1;
			for (int i = 0; i < mh; ++i) {
				for (int j = i; j < n; j += m) {
					int k = j + mh;
					Type tmp = p[j] - p[k];
					p[j] += p[k];
					p[k] = wc * tmp;
				}
				wc *= ww;
			}
			ww *= ww;
		}
		int i = 0;
		for (int j = 1; j < n - 1; ++j) {
			for (int k = n >> 1; k >(i ^= k); k >>= 1);
			if (j < i) std::swap(p[i], p[j]);
		}
	}
};

int main(int argc, char* argv[])
{
	OPENOJIO;

	typedef ModInt<MOD> mint;

	static mint fac[MAXN + 1];
	fac[0] = fac[1] = 1;
	for (int i = 2; i <= MAXN; ++i) fac[i] = fac[i - 1] * i;

	static mint fac_inv[MAXN + 1];
	for (int i = 0; i <= MAXN; ++i) {
		fac_inv[i] = 1 / fac[i];
		assert(fac_inv[i] * fac[i] == 1);
	}

	int n;
	vector<vector<int> > nears;

	ip >> n;

	nears.resize(n);
	for (int i = 0; i < n - 1; ++i) {
		int a, b;
		ip >> a >> b;
		--a; --b;

		nears[a].push_back(b);
		nears[b].push_back(a);
	}

	vector<int> count_sons;
	count_sons.resize(n, 0);

	function<int (int, int)> get_count_sons = [&] (int cur, int father) -> int {
		count_sons[cur] = 1;
		for (auto son : nears[cur]) {
			if (son == father) continue;
			count_sons[cur] += get_count_sons(son, cur);
		}
		return count_sons[cur];
	};

	get_count_sons(0, -1);

	vector<int> b;
	b.resize(n, 0);

	for (int i = 1; i < n; ++i) {
		b[count_sons[i]]++;
		b[n - count_sons[i]]++;
	}

	vector<mint> c(N, 0);
	vector<mint> d(N, 0);

	for (int i = 0; i < n; ++i)
		c[i] = b[i] * fac[i];

	d[0] = 1;
	for (int i = 1; i < n; ++i)
		d[N - i] = fac_inv[i];

	FFT<mint> fft(N, W);
	fft.calc(c);
	fft.calc(d);

	for (int i = 0; i < c.size(); ++i) c[i] *= d[i];
	fft.calc(c, -1);
	mint N_inv = (mint)1 / N;
	assert(N * N_inv == 1);
	for (int i = 0; i < c.size(); ++i) c[i] *= N_inv;

	vector<mint> &rst = d;
	for (int i = 1; i <= n; ++i)
	{
		rst[i] = n * fac[n] * fac_inv[i] * fac_inv[n - i] - fac_inv[i] * c[i];
	}

	for (int i = 1; i <= n; ++i)
	{
		op << rst[i] << endl;
	}

	return 0;
}
/***************************************************************/