description: You are given a tree with n nodes. As a reminder, a tree is a connected undirected graph without cycles.
  
  Let a_1, a_2, …, a_n be a sequence of integers. Perform the following operation exactly n times: 
  
    * Select an unerased node u. Assign a_u := number of unerased nodes adjacent to u. Then, erase the node u along with all edges that have it as an endpoint. 
  
  
  
  For each integer k from 1 to n, find the number, modulo 998 244 353, of different sequences a_1, a_2, …, a_n that satisfy the following conditions:
  
    * it is possible to obtain a by performing the aforementioned operations exactly n times in some order. 
    * \operatorname{gcd}(a_1, a_2, …, a_n) = k. Here, \operatorname{gcd} means the greatest common divisor of the elements in a. 
  
  Input
  
  The first line contains a single integer t (1 ≤ t ≤ 10 000) — the number of test cases.
  
  The first line of each test case contains a single integer n (2 ≤ n ≤ 10^5).
  
  Each of the next n - 1 lines contains two integers u and v (1 ≤ u, v ≤ n) indicating there is an edge between vertices u and v. It is guaranteed that the given edges form a tree.
  
  It is guaranteed that the sum of n over all test cases doesn't exceed 3 ⋅ 10^5.
  
  Output
  
  For each test case, print n integers in a single line, where for each k from 1 to n, the k-th integer denotes the answer when \operatorname{gcd} equals to k.
  
  Example
  
  Input
  
  
  2
  3
  2 1
  1 3
  2
  1 2
  
  
  Output
  
  
  3 1 0
  2 0
  
  Note
  
  In the first test case, 
  
  <image>
  
    * If we delete the nodes in order 1 → 2 → 3 or 1 → 3 → 2, then the obtained sequence will be a = [2, 0, 0] which has \operatorname{gcd} equals to 2. 
    * If we delete the nodes in order 2 → 1 → 3, then the obtained sequence will be a = [1, 1, 0] which has \operatorname{gcd} equals to 1. 
    * If we delete the nodes in order 3 → 1 → 2, then the obtained sequence will be a = [1, 0, 1] which has \operatorname{gcd} equals to 1. 
    * If we delete the nodes in order 2 → 3 → 1 or 3 → 2 → 1, then the obtained sequence will be a = [0, 1, 1] which has \operatorname{gcd} equals to 1. 
  
  
  
  Note that here we are counting the number of different sequences, not the number of different orders of deleting nodes.
solution: #include <bits/stdc++.h>
  inline char gc() {
    static const int L = 23333;
    static char sxd[L], *sss = sxd, *ttt = sxd;
    if (sss == ttt) {
      ttt = (sss = sxd) + fread(sxd, 1, L, stdin);
      if (sss == ttt) {
        return EOF;
      }
    }
    return *sss++;
  }
  template <class T>
  inline bool read(T& x) {
    x = 0;
    char c = gc();
    bool flg = false;
    for (; !isdigit(c); c = gc()) {
      if (c == '-') {
        flg = true;
      } else if (c == EOF) {
        return false;
      }
    }
    for (; isdigit(c); c = gc()) {
      x = (x * 10) + (c ^ 48);
    }
    if (flg) {
      x = -x;
    }
    return true;
  }
  template <class T>
  inline void write(T x) {
    if (x < 0) {
      x = -x;
      putchar('-');
    }
    if (x > 9) {
      write(x / 10);
      x %= 10;
    }
    putchar(x | 48);
  }
  template <class T>
  inline void writeln(T x) {
    write(x);
    puts("");
  }
  template <class T>
  inline void writesp(T x) {
    write(x);
    putchar(' ');
  }
  using namespace std;
  const int maxn = 100005;
  int gcd(int a, int b) {
    while (b) {
      int t = a % b;
      a = b;
      b = t;
    }
    return a;
  }
  int n;
  struct Edge {
    int to, nxt;
  } e[maxn << 1];
  int first[maxn];
  int du[maxn];
  int dubk[maxn];
  int cnt;
  void add_edge(int u, int v) {
    du[u]++, du[v]++;
    e[++cnt].nxt = first[u];
    first[u] = cnt;
    e[cnt].to = v;
    e[++cnt].nxt = first[v];
    first[v] = cnt;
    e[cnt].to = u;
  }
  int final_ans[maxn];
  void init() {
    cnt = 0;
    for (int i = 1; i <= n; ++i) {
      first[i] = du[i] = final_ans[i] = 0;
    }
  }
  bool np[maxn];
  int factor[maxn];
  int prime[maxn];
  void oula(const int n = 100000) {
    np[1] = true;
    int cnt = 0;
    for (int i = 2; i <= n; ++i) {
      if (!np[i]) {
        prime[++cnt] = i;
        factor[i] = i;
      }
      for (int j = 1; j <= cnt && (long long)i * prime[j] <= n; ++j) {
        np[i * prime[j]] = true;
        factor[i * prime[j]] = prime[j];
        if (!(i % prime[j])) {
          break;
        }
      }
    }
  }
  bool vis[maxn];
  int nn[maxn];
  int bfs(int xx) {
    for (int i = 1; i <= n; ++i) {
      vis[i] = false;
      nn[i] = du[i] = dubk[i];
    }
    queue<int> q;
    while (!q.empty()) {
      q.pop();
    }
    for (int i = 1; i <= n; ++i) {
      if (du[i] <= 1) {
        q.push(i);
        vis[i] = true;
      }
    }
    int ans = n - 1;
    while (!q.empty()) {
      int now = q.front();
      q.pop();
      bool flg = false;
      if (du[now]) {
        int tmpans = gcd(ans, nn[now]);
        if (tmpans % xx) {
          nn[now]--;
          ans = gcd(ans, nn[now]);
        } else {
          ans = tmpans;
          flg = true;
        }
      } else {
        ans = gcd(ans, nn[now]);
      }
      if (ans % xx) {
        return 1;
      }
      for (int i = first[now]; i; i = e[i].nxt) {
        int to = e[i].to;
        if (!vis[to]) {
          du[to]--;
          if (flg) {
            nn[to]--;
          }
          if (du[to] <= 1) {
            q.push(to);
            vis[to] = true;
          }
        }
      }
    }
    return ans;
  }
  const int mod = 998244353;
  int ksm(int a, int b) {
    int ans = 1;
    for (; b; b >>= 1, a = (long long)a * a % mod) {
      if (b & 1) {
        ans = (long long)ans * a % mod;
      }
    }
    return ans;
  }
  void solve() {
    read(n);
    init();
    for (int i = 1; i < n; ++i) {
      int u, v;
      read(u), read(v);
      add_edge(u, v);
    }
    for (int i = 1; i <= n; ++i) {
      dubk[i] = du[i];
    }
    int tt = n - 1;
    int tmpans = 0;
    while (tt > 1) {
      int pme = factor[tt];
      while (!(tt % pme)) {
        tt /= pme;
      }
      int nowans = bfs(pme);
      if (nowans > 1 && !final_ans[nowans]) {
        final_ans[nowans] = 1;
        tmpans++;
      }
    }
    final_ans[1] = ksm(2, n - 1) - tmpans;
    if (final_ans[1] < 0) {
      final_ans[1] += mod;
    }
    for (int i = 1; i <= n; ++i) {
      writesp(final_ans[i]);
    }
    puts("");
  }
  int main() {
    oula();
    int T;
    read(T);
    while (T--) {
      solve();
    }
    return 0;
  }
  