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;
struct lhy {
  int x, y, z;
};
const int N = 1e6 + 50;
struct Edge {
  int x, y, next;
} edge[N];
int tot;
int fa[N], son[N], du[N], deep1[N], deep2[N], ans[N], vis[N], sum[N];
vector<int> nowv;
vector<lhy> nowp;
inline void add(int x, int y) {
  edge[++tot].x = x;
  edge[tot].y = y;
  edge[tot].next = son[x];
  son[x] = tot;
  du[x]++;
}
void dfs(int x) {
  for (int i = son[x]; i; i = edge[i].next) {
    int y = edge[i].y;
    if (y == fa[x]) continue;
    fa[y] = x;
    dfs(y);
    deep1[x] = max(deep1[x], deep1[y] + 1);
  }
}
void dfs1(int x) {
  int nowp = 0;
  for (int i = son[x]; i; i = edge[i].next) {
    int y = edge[i].y;
    if (y == fa[x]) continue;
    if (deep1[y] + 1 == deep1[x]) nowp = y;
  }
  int nowm = 0;
  for (int i = son[x]; i; i = edge[i].next) {
    int y = edge[i].y;
    if (y == fa[x]) continue;
    if (y != nowp) {
      deep2[y] = max(deep2[x] + 1, deep1[x] + 1),
      nowm = max(nowm, deep1[y] + 1);
    }
  }
  if (nowp) deep2[nowp] = max(deep2[x] + 1, nowm + 1);
  for (int i = son[x]; i; i = edge[i].next) {
    int y = edge[i].y;
    if (y == fa[x]) continue;
    dfs1(y);
  }
}
void getans(int x) {
  nowv.clear();
  for (int i = son[x]; i; i = edge[i].next) {
    int y = edge[i].y;
    if (y == fa[x]) continue;
    nowv.push_back(deep1[y] + 1);
  }
  nowv.push_back(deep2[x]);
  sort(nowv.begin(), nowv.end());
  nowv.push_back(nowv[nowv.size() - 1] + 1);
  int nowsame = 0;
  for (int i = nowv.size() - 2; i >= 0; i--) {
    if (nowv[i]) {
      ans[2 * nowv[i] - 1] =
          max(ans[2 * nowv[i] - 1], (int)nowv.size() - i - 1);
      ans[2 * nowv[i]] = max(ans[2 * nowv[i]], (int)nowv.size() - i - 1);
    }
    if (nowv[i] == nowv[i + 1])
      nowsame++;
    else
      nowsame = 0;
    ans[2 * nowv[i] + 1] =
        max(ans[2 * nowv[i] + 1], (int)nowv.size() - i - 1 - nowsame);
  }
  nowv.clear();
  for (int i = son[x]; i; i = edge[i].next) {
    int y = edge[i].y;
    if (y == fa[x]) continue;
    getans(y);
  }
}
inline int cmp(const lhy &a, const lhy &b) { return a.y < b.y; }
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i < n; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    add(x, y);
    add(y, x);
  }
  for (int i = 1; i <= n; i++) ans[1] = max(ans[1], du[i] + 1);
  dfs(1);
  dfs1(1);
  getans(1);
  for (int x = 1; x <= n; x++) {
    nowp.clear();
    for (int i = son[x]; i; i = edge[i].next) {
      int y = edge[i].y;
      if (y == fa[x]) continue;
      nowp.push_back((lhy){y, deep1[y] + 1, 1});
      for (int j = son[y]; j; j = edge[j].next) {
        int yy = edge[j].y;
        if (yy == x) continue;
        nowp.push_back((lhy){y, deep1[yy] + 1, 0});
      }
    }
    nowp.push_back((lhy){0, deep2[x], 1});
    sort(nowp.begin(), nowp.end(), cmp);
    int nowsum = 0, nowmax = 0;
    for (int i = nowp.size() - 1; i >= 0; i--) {
      if (nowp[i].z == 1) {
        nowsum++;
        if (nowp[i].x > 0) vis[nowp[i].x] = 1;
      } else {
        sum[nowp[i].x]++;
        nowmax = max(nowmax, sum[nowp[i].x] - vis[nowp[i].x]);
      }
      int tmp = 0;
      if (nowp[i].z == 1) {
        tmp = nowsum + nowmax;
        ans[2 * nowp[i].y] = max(ans[2 * nowp[i].y], tmp);
      } else {
        tmp = nowsum - vis[nowp[i].x] + sum[nowp[i].x];
        ans[2 * nowp[i].y] = max(ans[2 * nowp[i].y], tmp);
      }
    }
  }
  for (int i = n; i; i--) {
    ans[i] = max(ans[i], ans[i + 2]);
    ans[i] = max(ans[i], 1);
  }
  for (int i = 1; i <= n; i++) printf("%d ", ans[i]);
}