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. 

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
const ll MOD = 1e9 + 7;
const int iinf = 1 << 29;
const long long llinf = 1ll << 60;
const double PI = 3.14159265;
#define pb push_back
#define ff first
#define ss second
#define sz(a) ((int)(a).size())
#define all(x) (x).begin(),(x).end()
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
ll mrand(ll B) {
  return (ull)rng() % B;
}

ll cross(pair<ll, ll> p1, pair<ll, ll> p2) {
    return p1.first*p2.second - p2.first*p1.second;
}

bool online(pair<ll, ll> a, pair<ll, ll> b, pair<ll, ll> c) {
    pair<ll, ll> p1{b.first-a.first, b.second-a.second};
    pair<ll, ll> p2{c.first-a.first, c.second-a.second};
    return cross(p1, p2) == 0;
}

void z_func(vector<int> &z, vector<int> &s, int n) {
    int L = 0, R = 0;
    for (int i = 1; i < n; i++) {
        if (i > R) {
            L = R = i;
            while (R < n && s[R-L] == s[R]) R++;
            z[i] = R-L; R--;
        } else {
            int k = i-L;
            if (z[k] < R-i+1) z[i] = z[k];
            else {
                L = i;
                while (R < n && s[R-L] == s[R]) R++;
                z[i] = R-L; R--;
            }
        }
    }
}

inline long long ceil(long long x, long long y) {
    return (x + y - 1LL) / y;
}

ll n, ans0, nsub1, sum0;
bool saw1;

ll precompute(int node, int par, vector<vector<int>> &g, vector<int> &parent, vector<ll> &sub) {
    if (node == 1) saw1 = true;
    parent[node] = par;
    ll nsub = 0;
    for (auto u : g[node]) {
        if (u == par) continue;

        ll res = precompute(u, node, g, parent, sub);
        nsub += res;

        if (node == 0) {
            ans0 += ((res - 1LL) * res) >> 1;
            if (saw1) {
                saw1 = false;
                nsub1 = res;
                nsub -= res;
            } else {
                sum0 += (nsub - res) * res;
            }
        }
    }
    sub[node] = nsub;
    return nsub + 1LL;
}

void work() {
    cin >> n;
    vector<vector<int>> g(n);
    for (int i = 1; i < n; i++) {
        int u, v; cin >> u >> v;
        g[u].pb(v); g[v].pb(u);
    }
    vector<ll> nsub(n); vector<int> parent(n);
    ans0 = 0; saw1 = false; sum0 = 0;
    precompute(0, -1, g, parent, nsub);
    cout << ans0 << ' ';
    vector<bool> in_path(n, false);
    in_path[0] = true;
    int p = 1, prev_p = 1;
    while (p) {
        in_path[p] = true;
        prev_p = p;
        p = parent[p];
    }
    int l = 0, r = 1;
    ll ans1 = sum0 + nsub[0] + (nsub[0] + 1LL) * (nsub1 - nsub[1] - 1LL);
    cout << ans1;

    for (int i = 2; i < n; i++) {
        if (in_path[i]) { cout << " 0"; continue; }

        p = parent[i], prev_p = i;
        in_path[i] = true;
        while (!in_path[p]) {
            in_path[p] = true;
            prev_p = p;
            p = parent[p];
        }

        if (p != l && p != r) {
            cout << ' ' << (nsub[l] + 1LL) * (nsub[r] + 1LL);
            for (int j = i + 1; j <= n; j++) cout << " 0";
            cout << '\n';
            return;
        }

        cout << ' ';
        if (p == l) {
            cout << (nsub[r] + 1LL) * (nsub[l] + 1LL - nsub[i] - 1LL);
            l = i;
        } else {
            cout << (nsub[l] + 1LL) * (nsub[r] + 1LL - nsub[i] - 1LL);
            r = i;
        }
    }

    if (n >= 2) {
        int n2 = 0, n1 = 0;
        for (int i = 0; i < n; i++) {
            if (sz(g[i]) == 1) n1++;
            if (sz(g[i]) == 2) n2++;
        }
        if (n1 == 2 && n2 == n - 2)
            cout << " 1";
        else
            cout << " 0";
    }
    cout << '\n';
}

int main() {
    ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    int nt; cin>>nt; while (nt--) work();
    //work();
    return 0;
}