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;
int n, q;
long long d1[500001], b1[500001];
long long d2[500001], b2[500001];
vector<int> adj[500001];
vector<int> r[500001];
int cs[500001];
int bc[500001];
void kurorz(vector<int>& v) {
  if (v.empty()) return;
  for (int i = 0; i < v.size(); i++)
    if (v[i] > v.back()) swap(v[i], v.back());
  int orz = v.back();
  int mx = 0;
  for (int i = 0; i < v.size() - 1; i++) mx = max(mx, v[i]);
  for (int i = 0; i < v.size() - 1; i++) cs[v[i]]++;
  int ptr = 0;
  for (int i = 0; i <= mx; i++) {
    for (int j = 0; j < cs[i]; j++) v[ptr++] = i;
    cs[i] = 0;
  }
}
vector<pair<int, int> > s;
vector<pair<int, int> > t;
int cnt[500001], duh[500001];
void kuroni(int id, int p) {
  s.clear();
  if (bc[id] == 0) return;
  int mx = 0;
  for (auto cur : adj[id]) {
    if (cur == p) continue;
    if (cur == bc[id]) continue;
    int ptr = 0;
    for (auto t : r[cur]) {
      cnt[t]++;
      duh[t] = max(duh[t], (int)r[cur].size() - ptr);
      mx = max(mx, t);
      ptr++;
    }
  }
  int ptr = 0;
  for (auto t : r[bc[id]]) {
    if (t > mx) break;
    cnt[t]++;
    duh[t] = max(duh[t], (int)r[bc[id]].size() - ptr);
    ptr++;
  }
  for (int i = 0; i <= mx; i++) {
    for (int j = 0; j < cnt[i]; j++) s.push_back({i, duh[i]});
    cnt[i] = duh[i] = 0;
  }
  ptr = -1;
  for (auto t : r[bc[id]]) {
    ptr++;
    if (t <= mx) continue;
    s.push_back({t, r[bc[id]].size() - ptr});
  }
}
void dfs(int id, int p) {
  for (auto cur : adj[id]) {
    if (cur == p) continue;
    dfs(cur, id);
    if (d2[id] < d1[cur] + 1) {
      d2[id] = d1[cur] + 1;
      b2[id] = cur;
    }
    if (d2[id] > d1[id]) {
      swap(d1[id], d2[id]);
      swap(b1[id], b2[id]);
    }
    if (d1[cur] >= d1[bc[id]]) bc[id] = cur;
    r[id].push_back(d1[cur] + 1);
  }
  kurorz(r[id]);
}
vector<int> v;
long long ans[1000001];
long long ans2[1000001];
void dfs2(int id, int p, long long pd) {
  bool duh = false;
  for (auto cur : adj[id]) {
    if (cur == p) continue;
    if (cur == b1[id])
      dfs2(cur, id, max(pd, d2[id]) + 1);
    else
      dfs2(cur, id, max(pd, d1[id]) + 1);
    if (adj[cur].size() >= 3) duh = true;
  }
  v.clear();
  for (auto cur : adj[id]) {
    if (cur == p) continue;
    v.push_back(1 + d1[cur]);
  }
  kurorz(v);
  if (id != 1) v.push_back(pd);
  for (int i = (int)v.size() - 1; i >= 1; i--) {
    if (v[i] < v[i - 1]) swap(v[i - 1], v[i]);
  }
  int sz = v.size();
  if (v.size() >= 2) {
    int x = v.back();
    int y = v[v.size() - 2];
    ans[x + y] = max(ans[x + y], 2LL);
  }
  ans[1] = max(ans[1], (long long)v.size() + 1);
  kuroni(id, p);
  int zs = s.size();
  for (int i = (int)s.size() - 1; i >= 1; i--) {
    s[i - 1].second = max(s[i - 1].second, s[i].second);
  }
  s.push_back({(long long)1e9, 0});
  for (int i = 0; i < (int)v.size() - 1; i++) {
    int cur = v[i];
    ans[cur * 2] = max(ans[cur * 2], (long long)sz - i);
    if (v[i + 1] != v[i])
      ans[cur * 2 + 1] = max(ans[cur * 2 + 1], (long long)sz - i);
  }
  for (int i = 0; i < (int)v.size(); i++) {
    int cur = v[i];
    int j =
        lower_bound(s.begin(), s.end(), (pair<int, int>){cur, 0}) - s.begin();
    ans2[cur * 2] = max(ans2[cur * 2], (long long)(sz - i) + s[j].second - 1);
  }
  for (int i = 0; i < (int)s.size() - 1; i++) {
    int cur = s[i].first;
    int j = lower_bound(v.begin(), v.end(), cur) - v.begin();
    ans2[cur * 2] = max(ans2[cur * 2], (long long)(sz - j) + s[i].second - 1);
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n;
  for (int i = 1; i < n; i++) {
    int u, v;
    cin >> u >> v;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  dfs(1, 0);
  dfs2(1, 0, 0);
  for (int i = 2 * n - 1; i >= 1; i--) ans[i] = max(ans[i + 1], ans[i]);
  for (int i = 2 * n - 2; i >= 2; i--) ans2[i] = max(ans2[i + 2], ans2[i]);
  for (int i = 1; i <= n; i++) {
    ans[i] = max(ans[i], ans2[i]);
    cout << max(ans[i], 1LL) << ' ';
  }
  cout << endl;
}