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;
vector<int> g[N];
vector<pair<int, int> > updates[N];
int par[N], depth[N], max_dn[N], ent[N], ext[N], eid[N];
int cur_sz[N], ans[N], tree[4 * N], lazy[4 * N];
int nxt = 2, diameter = 0;
void dfs1(int u, int p);
void dfs2(int u, int up_d);
void update(int i, int l, int r, int ql, int qr, int x);
void propagate(int i, int lc, int rc);
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  for (int i = 0; i < n - 1; ++i) {
    int u, v;
    cin >> u >> v;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  dfs1(1, 0);
  dfs2(1, 0);
  multiset<int> vtx_sizes;
  for (int i = 1; i <= n; ++i) {
    cur_sz[i] = (g[i].size() + (i != 1));
    vtx_sizes.insert(cur_sz[i]);
    ans[1] = max(ans[1], cur_sz[i] + 1);
  }
  for (int i = 2; i <= n; ++i) {
    update(1, 2, n, eid[i], eid[i], cur_sz[i] + cur_sz[par[i]] - 2);
  }
  for (int d = 1; 2 * d - 1 <= n; ++d) {
    for (auto &p : updates[d]) {
      int u = p.first, v = p.second;
      vtx_sizes.erase(vtx_sizes.find(cur_sz[u]));
      --cur_sz[u];
      vtx_sizes.insert(cur_sz[u]);
      update(1, 2, n, ent[u], ext[u] - 1, -1);
      update(1, 2, n, eid[u], eid[u], -1);
      int pos = (v == par[u] ? eid[u] : eid[v]);
      update(1, 2, n, pos, pos, -n);
    }
    ans[2 * d] = max(ans[2 * d], (vtx_sizes.empty() ? 0 : *vtx_sizes.rbegin()));
    ans[2 * d - 1] =
        max(ans[2 * d - 1], (vtx_sizes.empty() ? 0 : *vtx_sizes.rbegin()));
    ans[2 * d] = max(ans[2 * d], tree[1]);
  }
  for (int i = 1; i <= n; ++i) {
    if (i <= diameter) {
      ans[i] = max(ans[i], 2);
    }
    cout << max(1, ans[i]) << ' ';
  }
  cout << endl;
}
void dfs1(int u, int p) {
  par[u] = p;
  depth[u] = depth[p] + 1;
  for (int i = 0; i < g[u].size(); ++i) {
    if (g[u][i] == p) {
      g[u].erase(g[u].begin() + i);
      break;
    }
  }
  max_dn[u] = 0;
  for (auto &v : g[u]) {
    dfs1(v, u);
    max_dn[u] = max(max_dn[u], 1 + max_dn[v]);
  }
}
void dfs2(int u, int up_d) {
  diameter = max(diameter, up_d);
  multiset<pair<int, int> > temp;
  if (up_d) {
    temp.insert({up_d, par[u]});
  }
  ent[u] = nxt;
  for (auto &v : g[u]) {
    eid[v] = nxt++;
    temp.insert({max_dn[v] + 1, v});
  }
  int cnt = temp.size();
  for (auto it = temp.begin(); next(it) != temp.end(); ++it, --cnt) {
    auto nx = next(it);
    if (nx->first > it->first) {
      ans[2 * it->first + 1] = max(ans[2 * it->first + 1], cnt);
    }
  }
  ext[u] = nxt;
  for (auto &p : temp) {
    int d = p.first, v = p.second;
    updates[d + 1].push_back({u, v});
  }
  for (auto &v : g[u]) {
    temp.erase({max_dn[v] + 1, v});
    int nxt_up = max(1, (temp.empty() ? 0 : 1 + temp.rbegin()->first));
    dfs2(v, nxt_up);
    temp.insert({max_dn[v] + 1, v});
  }
}
void update(int i, int l, int r, int ql, int qr, int x) {
  if (l > qr or ql > r) {
    return;
  } else if (ql <= l and r <= qr) {
    tree[i] += x;
    lazy[i] += x;
  } else {
    int mid = (l + r) / 2, lc = 2 * i, rc = lc + 1;
    propagate(i, lc, rc);
    update(lc, l, mid, ql, qr, x);
    update(rc, mid + 1, r, ql, qr, x);
    tree[i] = max(tree[lc], tree[rc]);
  }
}
void propagate(int i, int lc, int rc) {
  tree[lc] += lazy[i];
  tree[rc] += lazy[i];
  lazy[lc] += lazy[i];
  lazy[rc] += lazy[i];
  lazy[i] = 0;
}