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;
int n, u, v, cnt = 0, h[N] = {-1}, in[N], out[N], ans[N], val[N], pa[N];
bool chk[N];
vector<int> cur;
vector<int> adj[N];
vector<pair<int, int>> ve;
multiset<int, greater<int>> second, ed, ch[N];
struct segment_tree {
  int tr[4 * N], lz[4 * N];
  void apply(int i, int v) {
    tr[i] += v;
    lz[i] += v;
  }
  void down(int i) {
    apply(i * 2, lz[i]);
    apply(i * 2 + 1, lz[i]);
    lz[i] = 0;
  }
  void update(int l, int r, int i, int L, int R, int v) {
    if (l > R || r < L || L > R) {
      return;
    } else if (L <= l && r <= R) {
      apply(i, v);
      return;
    } else {
      down(i);
      update(l, (l + r) / 2, i * 2, L, R, v);
      update((l + r) / 2 + 1, r, i * 2 + 1, L, R, v);
      tr[i] = max(tr[i * 2], tr[i * 2 + 1]);
    }
  }
  int query(int l, int r, int i, int L, int R) {
    if (l > R || r < L || L > R) {
      return 0;
    } else if (L <= l && r <= R) {
      return tr[i];
    } else {
      down(i);
      return max(query(l, (l + r) / 2, i * 2, L, R),
                 query((l + r) / 2 + 1, r, i * 2 + 1, L, R));
    }
  }
} seg;
void DFS(int u, int p = 0) {
  h[u] = h[p] + 1;
  pa[u] = p;
  in[u] = ++cnt;
  seg.update(1, n, 1, in[u], in[u], h[u]);
  for (int &v : adj[u]) {
    if (v != p) {
      DFS(v, u);
    }
  }
  out[u] = cnt;
}
void DFS_2(int u, int p = 0) {
  int pa =
      max(seg.query(1, n, 1, 1, in[u] - 1), seg.query(1, n, 1, out[u] + 1, n));
  ve.push_back({0, u});
  if (u != 1) {
    ve.push_back({pa, u});
  }
  for (int &v : adj[u]) {
    if (v != p) {
      int pa = seg.query(1, n, 1, in[v], out[v]);
      ve.push_back({pa, u});
      seg.update(1, n, 1, 1, n, 1);
      seg.update(1, n, 1, in[v], out[v], -2);
      DFS_2(v, u);
      seg.update(1, n, 1, 1, n, -1);
      seg.update(1, n, 1, in[v], out[v], 2);
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cin >> n;
  for (int i = 1; i < n; i++) {
    cin >> u >> v;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  DFS(1);
  DFS_2(1);
  for (int i = 1; i <= n; i++) {
    second.insert(val[i] = adj[i].size() + 1);
  }
  for (int i = 1; i <= n; i++) {
    for (int &v : adj[i]) {
      if (v != pa[i]) {
        ch[i].insert(val[v]);
      }
    }
    ed.insert(val[i] + *ch[i].begin() - 2);
  }
  sort(ve.begin(), ve.end(), greater<pair<int, int>>());
  for (int i = 0; i <= n; i += 2) {
    ans[i] = max(*second.begin(), *ed.begin());
    while (!ve.empty() && ve.back().first == i / 2) {
      int u = ve.back().second;
      if (!chk[u]) {
        chk[u] = true;
        cur.push_back(u);
      }
      ve.pop_back();
      second.erase(second.find(val[u]));
      second.insert(val[u] - 1);
      ed.erase(ed.find(val[u] + *ch[u].begin() - 2));
      ed.insert(val[u] - 1 + *ch[u].begin() - 2);
      if (u != 1) {
        ed.erase(ed.find(val[pa[u]] + *ch[pa[u]].begin() - 2));
        ch[pa[u]].erase(ch[pa[u]].find(val[u]));
        ch[pa[u]].insert(val[u] - 1);
        ed.insert(val[pa[u]] + *ch[pa[u]].begin() - 2);
      }
      val[u]--;
    }
    ans[i + 1] = *second.begin();
    while (!cur.empty()) {
      int u = cur.back();
      cur.pop_back();
      chk[u] = false;
      ans[i + 1] = max(ans[i + 1], val[u] + 1);
    }
  }
  for (int i = 1; i <= n; i++) {
    cout << max(ans[i], 1) << " ";
  }
}