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 = 5e5 + 10;
int heights[N * 2];
int edges[N * 2];
int nedges;
vector<int> adj[N];
vector<pair<int, int> > depths[N];
int res[N];
int sumDepths[N];
int best[N], secondBest[N];
int getH(int edge) {
  if (heights[edge] != -1) return heights[edge];
  int u = edges[edge];
  int h = 0;
  for (auto it = adj[u].begin(); it != adj[u].end(); it++) {
    if (*it == (edge ^ 1)) continue;
    h = max(h, getH(*it) + 1);
  }
  heights[edge] = h;
  return h;
}
void dfs(int node, int edgeToParent, int bestToParent) {
  if (edgeToParent != -1) heights[edgeToParent] = bestToParent;
  for (int e : adj[node]) {
    if (e == edgeToParent) continue;
    int nbest = bestToParent + 1;
    if (heights[e] + 1 == best[node]) {
      nbest = max(nbest, secondBest[node]);
    } else {
      nbest = max(nbest, best[node]);
    }
    dfs(edges[e], e ^ 1, nbest);
  }
}
int main() {
  int n;
  scanf("%d", &n);
  nedges = 0;
  for (int i = 1; i < n; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    adj[u].push_back(nedges);
    adj[v].push_back(nedges + 1);
    edges[nedges++] = v;
    edges[nedges++] = u;
  }
  memset(heights, -1, sizeof(heights));
  for (int w : adj[1]) {
    getH(w);
  }
  for (int i = 1; i <= n; i++) {
    best[i] = 0;
    secondBest[i] = 0;
    for (int e : adj[i]) {
      if (heights[e] + 1 > best[i]) {
        secondBest[i] = best[i];
        best[i] = heights[e] + 1;
      } else if (heights[e] + 1 > secondBest[i]) {
        secondBest[i] = heights[e] + 1;
      }
    }
  }
  dfs(1, -1, -1);
  for (int i = 1; i <= n; i++) res[i] = 1;
  int maxDegree = 0;
  for (int node = 1; node <= n; node++) {
    maxDegree = max(maxDegree, (int)adj[node].size());
    vector<int> hs;
    for (auto it = adj[node].begin(); it != adj[node].end(); it++) {
      int h = getH(*it) + 1;
      hs.push_back(h);
    }
    sort(hs.begin(), hs.end());
    int children = hs.size();
    for (int i = 0; i < hs.size(); i++) {
      int t = 2 * hs[i];
      if (i + 1 == hs.size() || hs[i + 1] > hs[i]) {
        t++;
      }
      if (t <= n) res[t] = max(res[t], children--);
    }
    sumDepths[node] = hs.size();
    int c = 1;
    for (int i = 1; i < hs.size(); i++) {
      if (hs[i] != hs[i - 1]) {
        depths[node].push_back(make_pair(hs[i - 1], c));
        c = 1;
      } else {
        c++;
      }
    }
    if (hs.size() > 0) {
      depths[node].push_back(make_pair(hs[hs.size() - 1], c));
    }
    sort(depths[node].begin(), depths[node].end());
  }
  for (int i = n - 1; i > 1; i--) {
    res[i] = max(res[i], res[i + 1]);
  }
  for (int i = 0; i < nedges; i += 2) {
    int u = edges[i];
    int v = edges[i + 1];
    if (adj[u].size() <= 2 || adj[v].size() <= 2) continue;
    int huv = getH(i + 1) + 1;
    int hvu = getH(i) + 1;
    int children = sumDepths[u] + sumDepths[v];
    for (int j = 0, k = 0;
         j < depths[u].size() - 1 && k < depths[v].size() - 1;) {
      int t, c;
      if (depths[v][k].first < depths[u][j].first) {
        t = depths[v][k].first;
        c = depths[v][k].second;
        k++;
      } else {
        t = depths[u][j].first;
        c = depths[u][j].second;
        j++;
      }
      if (2 * t <= n)
        res[2 * t] = max(res[2 * t], children - (huv >= t) - (hvu >= t));
      children -= c;
    }
  }
  for (int i = n - 2; i > 1; i--) {
    res[i] = max(res[i], res[i + 2]);
  }
  printf("%d", maxDegree + 1);
  for (int i = 2; i <= n; i++) {
    printf(" %d", res[i]);
  }
  printf("\n");
  return 0;
}