#include <bits/stdc++.h>
#define N 200010
#define ll long long
#define ull unsigned long long
#define mo (ll)((ll)1e9+7)
#define squ(x) ((x)*(x))
#define db double
#define all(x) x.begin(),x.end()
#define cmax(a,b) a=max(a,b)
#define cmin(a,b) a=min(a,b)
#define rep(i,l,r) for(register int i=l;i<=r;++i)
#define drep(i,r,l)for(register int i=r;i>=l;--i)
#define pb push_back
#define inline inline __attribute__((always_inline))
using namespace std;

inline ll read() {
	ll x = 0, f = 1; char ch = getchar();
	while (ch < '0' || ch > '9') {if (ch == '-')f = -1; ch = getchar();}
	while (ch >= '0' && ch <= '9') {x = x * 10 + ch - '0'; ch = getchar();}
	return x * f;
}
int n, sz[N], mi[N], u, v, pv, pu;
vector<int> g[N];
bool vis[N];
ll le, ans[N];
void dfs(int u, int fa = -1) {
	sz[u] = 1, mi[u] = u;
	for (int v : g[u]) {
		if (v == fa)continue;
		dfs(v, u);
		sz[u] += sz[v];
		cmin(mi[u], mi[v]);
	}
}
void find(int val) {
	if (v == val || u == val) {
		ll a, b;
		if (pv == -1 || sz[pv] > sz[v])a = sz[v];
		else a = n - sz[pv];
		if (pu == -1 || sz[pu] > sz[u])b = sz[u];
		else b = n - sz[pu];
		ans[val] = le - a * b;
		le = a * b;
		return;
	}
	for (int it : g[v]) {
		if (it == pv)continue;
		if (mi[it] == val) {
			if (v == u)pu = it;
			pv = v;
			v = it;
			vis[it] = 1;
			find(val);
			return;
		}
	}
	for (int it : g[u]) {
		if (it == pu)continue;
		if (mi[it] == val) {
			if (v == u)pv = it;
			pu = u;
			u = it;
			vis[it] = 1;
			find(val);
			return;
		}
	}
	ans[val] = le;
	le = 0;
}
int main() {
	int t = read();
	while (t--) {
		n = read();
		rep(i, 0, n - 1)g[i].clear(), sz[i] = 0, mi[i] = n, ans[i] = 0, vis[i] = 0;
		rep(i, 1, n - 1) {
			int u = read(), v = read();
			g[u].pb(v), g[v].pb(u);
		}
		le = n * 1ll * (n - 1) / 2;
		u = v = 0;
		pu = pv = -1;
		dfs(0);
		for (int v : g[0])ans[0] += sz[v] * 1ll * (sz[v] - 1) / 2;
		le -= ans[0];
		rep(i, 1, n - 1)if (vis[i] == 1 || !le)ans[i] = 0;
		else find(i);
		ans[n] = le;
		rep(i, 0, n)printf("%lld ", ans[i]);
		printf("\n");
	}
	return 0;
}
### Prompt

In Cpp, your task is to solve the following problem:

You are given a tree with n nodes, numerated from 0 to n-1. For each k between 0 and n, inclusive, you have to count the number of unordered pairs (u,v), u ≠ v, such that the MEX of all the node labels in the shortest path from u to v (including end points) is k.

The MEX of a sequence of integers is the smallest non-negative integer that does not belong to the sequence.

Input

The first line contains a single integer t (1 ≤ t ≤ 10^4) — the number of test cases. 

The first line of each test case contains a single integer n (2 ≤ n ≤ 2 ⋅ 10^{5}).

The next n-1 lines of each test case describe the tree that has to be constructed. These lines contain two integers u and v (0 ≤ u,v ≤ n-1) denoting an edge between u and v (u ≠ v).

It is guaranteed that the given edges form a tree.

It is also guaranteed that the sum of n for all test cases does not exceed 2 ⋅ 10^{5}.

Output

For each test case, print n+1 integers: the number of paths in the tree, such that the MEX of all the node labels in that path is k for each k from 0 to n.

Example

Input


2
4
0 1
0 2
2 3
2
1 0


Output


1 2 1 1 1 
0 0 1 

Note

  1. In example case 1, <image>
    * For k = 0, there is 1 path that is from 2 to 3 as MEX([2, 3]) = 0. 
    * For k = 1, there are 2 paths that is from 0 to 2 as MEX([0, 2]) = 1 and 0 to 3 as MEX([0, 2, 3]) = 1. 
    * For k = 2, there is 1 path that is from 0 to 1 as MEX([0, 1]) = 2. 
    * For k = 3, there is 1 path that is from 1 to 2 as MEX([1, 0, 2]) = 3 
    * For k = 4, there is 1 path that is from 1 to 3 as MEX([1, 0, 2, 3]) = 4. 
  2. In example case 2, <image>
    * For k = 0, there are no such paths. 
    * For k = 1, there are no such paths. 
    * For k = 2, there is 1 path that is from 0 to 1 as MEX([0, 1]) = 2. 

### Response

```cpp
#include <bits/stdc++.h>
#define N 200010
#define ll long long
#define ull unsigned long long
#define mo (ll)((ll)1e9+7)
#define squ(x) ((x)*(x))
#define db double
#define all(x) x.begin(),x.end()
#define cmax(a,b) a=max(a,b)
#define cmin(a,b) a=min(a,b)
#define rep(i,l,r) for(register int i=l;i<=r;++i)
#define drep(i,r,l)for(register int i=r;i>=l;--i)
#define pb push_back
#define inline inline __attribute__((always_inline))
using namespace std;

inline ll read() {
	ll x = 0, f = 1; char ch = getchar();
	while (ch < '0' || ch > '9') {if (ch == '-')f = -1; ch = getchar();}
	while (ch >= '0' && ch <= '9') {x = x * 10 + ch - '0'; ch = getchar();}
	return x * f;
}
int n, sz[N], mi[N], u, v, pv, pu;
vector<int> g[N];
bool vis[N];
ll le, ans[N];
void dfs(int u, int fa = -1) {
	sz[u] = 1, mi[u] = u;
	for (int v : g[u]) {
		if (v == fa)continue;
		dfs(v, u);
		sz[u] += sz[v];
		cmin(mi[u], mi[v]);
	}
}
void find(int val) {
	if (v == val || u == val) {
		ll a, b;
		if (pv == -1 || sz[pv] > sz[v])a = sz[v];
		else a = n - sz[pv];
		if (pu == -1 || sz[pu] > sz[u])b = sz[u];
		else b = n - sz[pu];
		ans[val] = le - a * b;
		le = a * b;
		return;
	}
	for (int it : g[v]) {
		if (it == pv)continue;
		if (mi[it] == val) {
			if (v == u)pu = it;
			pv = v;
			v = it;
			vis[it] = 1;
			find(val);
			return;
		}
	}
	for (int it : g[u]) {
		if (it == pu)continue;
		if (mi[it] == val) {
			if (v == u)pv = it;
			pu = u;
			u = it;
			vis[it] = 1;
			find(val);
			return;
		}
	}
	ans[val] = le;
	le = 0;
}
int main() {
	int t = read();
	while (t--) {
		n = read();
		rep(i, 0, n - 1)g[i].clear(), sz[i] = 0, mi[i] = n, ans[i] = 0, vis[i] = 0;
		rep(i, 1, n - 1) {
			int u = read(), v = read();
			g[u].pb(v), g[v].pb(u);
		}
		le = n * 1ll * (n - 1) / 2;
		u = v = 0;
		pu = pv = -1;
		dfs(0);
		for (int v : g[0])ans[0] += sz[v] * 1ll * (sz[v] - 1) / 2;
		le -= ans[0];
		rep(i, 1, n - 1)if (vis[i] == 1 || !le)ans[i] = 0;
		else find(i);
		ans[n] = le;
		rep(i, 0, n)printf("%lld ", ans[i]);
		printf("\n");
	}
	return 0;
}
```