Problem: Let G be a simple graph. Let W be a non-empty subset of vertices. Then W is almost-k-uniform if for each pair of distinct vertices u,v ∈ W the distance between u and v is either k or k+1.

You are given a tree on n vertices. For each i between 1 and n, find the maximum size of an almost-i-uniform set.

Input

The first line contains a single integer n (2 ≤ n ≤ 5 ⋅ 10^5) – the number of vertices of the tree.

Then n-1 lines follows, the i-th of which consisting of two space separated integers u_i, v_i (1 ≤ u_i, v_i ≤ n) meaning that there is an edge between vertices u_i and v_i. 

It is guaranteed that the given graph is tree. 

Output

Output a single line containing n space separated integers a_i, where a_i is the maximum size of an almost-i-uniform set.

Examples

Input


5
1 2
1 3
1 4
4 5


Output


4 3 2 1 1


Input


6
1 2
1 3
1 4
4 5
4 6


Output


4 4 2 1 1 1

Note

Consider the first example. 

  * The only maximum almost-1-uniform set is \{1, 2, 3, 4\}. 
  * One of the maximum almost-2-uniform sets is or \{2, 3, 5\}, another one is \{2, 3, 4\}. 
  * A maximum almost-3-uniform set is any pair of vertices on distance 3. 
  * Any single vertex is an almost-k-uniform set for k ≥ 1. 



In the second sample there is an almost-2-uniform set of size 4, and that is \{2, 3, 5, 6\}.

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
const int N = 500005;
struct edge {
  int to, next;
} e[N * 2];
int head[N], tot, n, mxv, rt;
int vis[N], sum[N], qq[N], deg[N];
int fa[N], sz[N], ans[N];
pair<int, int> mx1[N], mx2[N], q[N * 4];
void add(int x, int y) {
  e[++tot] = (edge){y, head[x]};
  head[x] = tot;
}
void dfs(int x) {
  mx1[x] = mx2[x] = pair<int, int>(0, x);
  for (int i = head[x]; i; i = e[i].next)
    if (e[i].to != fa[x]) {
      fa[e[i].to] = x;
      dfs(e[i].to);
      pair<int, int> tmp(mx1[e[i].to].first + 1, e[i].to);
      if (tmp > mx1[x]) swap(mx1[x], tmp);
      if (tmp > mx2[x]) swap(mx2[x], tmp);
    }
}
void dfs2(int x) {
  for (int i = head[x]; i; i = e[i].next)
    if (e[i].to != fa[x]) {
      pair<int, int> tmp((mx1[x].second == e[i].to ? mx2[x] : mx1[x]).first + 1,
                         x);
      if (tmp > mx1[e[i].to]) swap(mx1[e[i].to], tmp);
      if (tmp > mx2[e[i].to]) swap(mx2[e[i].to], tmp);
      dfs2(e[i].to);
    }
}
int Func(int x, int y) {
  return mx1[x].second == y ? mx2[x].first : mx1[x].first;
}
void dfs(int x, int fa, int n) {
  sz[x] = 1;
  int mx = 0;
  for (int i = head[x]; i; i = e[i].next)
    if (e[i].to != fa && !vis[e[i].to]) {
      dfs(e[i].to, x, n);
      sz[x] += sz[e[i].to];
      mx = max(mx, sz[e[i].to]);
    }
  mx = max(mx, n - sz[x]);
  if (mx < mxv) mxv = mx, rt = x;
}
void solve(int x, int n) {
  mxv = 1 << 30;
  dfs(x, 0, n);
  vis[x = rt] = 1;
  int top = 0;
  for (int i = head[x]; i; i = e[i].next) {
    q[++top] = pair<int, int>(Func(e[i].to, x) + 1, 0);
    if (!vis[e[i].to]) {
      sum[e[i].to] = 0;
      for (int j = head[e[i].to]; j; j = e[j].next)
        q[++top] = pair<int, int>(Func(e[j].to, e[i].to) + 1, e[i].to);
    }
  }
  sort(q + 1, q + top + 1);
  int tg = -2, mx = 0;
  for (int i = (int)(top); i >= (int)(1); i--) {
    if (q[i].second == 0)
      ++tg;
    else
      mx = max(mx, ++sum[q[i].second]);
    ans[q[i].first * 2] = max(ans[q[i].first * 2], tg + mx);
  }
  for (int i = head[x]; i; i = e[i].next)
    if (!vis[e[i].to])
      solve(e[i].to, (sz[e[i].to] > sz[x] ? n - sz[x] : sz[e[i].to]));
}
int main() {
  scanf("%d", &n);
  for (int i = (int)(1); i <= (int)(n - 1); i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    add(x, y);
    add(y, x);
    deg[x]++;
    deg[y]++;
  }
  for (int i = (int)(1); i <= (int)(n); i++) ans[1] = max(ans[1], deg[i] + 1);
  ans[n] = max(ans[n], 1);
  ans[n - 1] = max(ans[n - 1], 1);
  dfs(1);
  dfs2(1);
  for (int i = (int)(1); i <= (int)(n); i++) {
    *qq = 0;
    for (int j = head[i]; j; j = e[j].next) qq[++*qq] = Func(e[j].to, i) + 1;
    sort(qq + 1, qq + *qq + 1);
    for (int j = (int)(1); j <= (int)(*qq); j++) {
      ans[2 * qq[j]] = max(ans[2 * qq[j]], (*qq) - j + 1);
      ans[2 * qq[j] - 1] =
          max(ans[2 * qq[j] - 1],
              (*qq) - j + 1 + (j != 1 && qq[j - 1] == qq[j] - 1));
      if (j != (*qq) && qq[j] != qq[j + 1])
        ans[2 * qq[j] + 1] = max(ans[2 * qq[j] + 1], (*qq) - j + 1);
    }
  }
  solve(1, n);
  for (int i = (int)(n); i >= (int)(1); i--) ans[i] = max(ans[i], ans[i + 2]);
  for (int i = (int)(1); i <= (int)(n); i++) printf("%d ", ans[i]);
}