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 __int128_t LL;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define F first
#define S second
#define pb push_back
mt19937 rnd;

const int N = 4e5 + 10;
ll cnt[N], ans[N];

#define data my_data

const int L = 22;
int depth[N], sz[N], in[N], out[N];
vector<int> g[N];
vector<int> tour;
int data[N], table[N][L];
int lg[N], pw[L];

void init(int n) {
    for (int i = 0; i <= n + 3; i++) {
        g[i].clear();
        cnt[i] = 0;
        ans[i] = 0;
        sz[i] = 0;
        in[i] = 0;
        out[i] = 0;
    }
    tour.clear();
}

void dfs_lca(int v = 0, int p = 0) {
    in[v] = tour.size();
    tour.pb(v);
    sz[v] = 1;
    for (int to : g[v]) {
        if (to != p) {
            depth[to] = depth[v] + 1;
            dfs_lca(to, v);
            sz[v] += sz[to];
            tour.pb(v);
        }
    }
    out[v] = tour.size() - 1;
}

void build_sparse_table(int n) {
    pw[0] = 1;
    for (int i = 1; i <= L - 1; i++) {
        pw[i] = pw[i - 1] << 1;
    }
    for (int i = 1, k = 0; i <= n + n - 1; i <<= 1, k++) {
        for (int j = 0; j <= i - 1 && i + j <= n + n - 1; j++) {
            lg[i + j] = k;
        }
    }
    for (int i = 1; i <= n; i++) {
        table[i][0] = i;
    }
    for (int k = 1; k <= L - 1; k++) {
        for (int i = 1; i + pw[k] - 1 <= n; i++) {
            if (data[table[i][k - 1]] < data[table[i + pw[k - 1]][k - 1]]) {
                table[i][k] = table[i][k - 1];
            }
            else {
                table[i][k] = table[i + pw[k - 1]][k - 1];
            }
        }
    }
}

int get_pos_min(int l, int r) {
    if (data[table[l][lg[r - l + 1]]] < data[table[r - pw[lg[r - l + 1]] + 1][lg[r - l + 1]]]) {
        return table[l][lg[r - l + 1]];
    }
    else {
        return table[r - pw[lg[r - l + 1]] + 1][lg[r - l + 1]];
    }
}

int lca(int u, int v) {
    if (out[u] > out[v]) {
        swap(u, v);
    }
    return tour[get_pos_min(in[u] + 1, out[v] + 1) - 1];
}

void precalc_lca() {
    dfs_lca();
    for (int i = 1; i <= tour.size(); i++) {
        data[i] = depth[tour[i - 1]];
    }
    build_sparse_table(tour.size());
}

int main() {
    ios_base::sync_with_stdio(0); cin.tie(0);
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
#endif

    int t;
    cin >> t;
    while (t--) {
        int n;
        cin >> n;
        init(n);
        for (int i = 1; i <= n - 1; i++) {
            int u, v;
            cin >> u >> v;
            g[u].pb(v);
            g[v].pb(u);
        }
        precalc_lca();
        for (int to : g[0]) {
            ans[0] += 1ll * sz[to] * (sz[to] - 1) / 2;
        }
        cnt[0] = 1ll * n * (n - 1) / 2 - ans[0];
        int lef = 0, root = 0, rig = 0, ptr_lef = 0, ptr_rig = 0;
        for (int v = 1; v <= n - 1; v++) {
            if (lca(lef, v) == v && lca(v, root) == root) {

            }
            else if (lca(rig, v) == v && lca(v, root) == root) {

            }
            else if (lca(v, lef) == lef && lca(v, rig) == root) {
                if (lef == root) {
                    for (int to : g[root]) {
                        if (lca(v, to) == to) {
                            ptr_lef = to;
                        }
                    }
                }
                lef = v;
            }
            else if (lca(v, rig) == rig && lca(v, lef) == root) {
                if (rig == root) {
                    for (int to : g[root]) {
                        if (lca(v, to) == to) {
                            ptr_rig = to;
                        }
                    }
                }
                rig = v;
            }
            else {
                break;
            }
            if (lef == root) {
                cnt[v] = 1ll * (n - sz[ptr_rig]) * sz[rig];
            }
            else if (rig == root) {
                cnt[v] = 1ll * (n - sz[ptr_lef]) * sz[lef];
            }
            else {
                cnt[v] = 1ll * sz[lef] * sz[rig];
            }
        }
        for (int i = 0; i <= n; i++) {
            if (i) ans[i] = cnt[i - 1] - cnt[i];
            cout << ans[i] << " ";
        }
        cout << "\n";
    }

#ifdef LOCAL
    cerr << "\nTime elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
#endif
    return 0;
}