#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int maxn = 5e5 + 5;
inline int mul(int x, int y) {
  long long z = 1LL * x * y;
  return z - z / mod * mod;
}
inline int add(int x, int y) {
  x += y;
  if (x >= mod) x -= mod;
  return x;
}
inline void upd(int &x, int y) { x = max(x, y); }
vector<int> g[maxn];
map<int, int> q[maxn];
int d[maxn], sz[maxn];
int ans[maxn];
void dfs0(int u, int fa) {
  d[u] = 0;
  q[u][0]++;
  for (auto v : g[u]) {
    if (v == fa) continue;
    dfs0(v, u);
    d[u] = max(d[u], d[v] + 1);
    q[u][d[v] + 1]++;
  }
}
void dfs1(int u, int fa, int pre) {
  pair<int, int> mx0, mx1;
  mx0 = pair<int, int>(pre, fa);
  mx1 = pair<int, int>(-1, -1);
  for (auto v : g[u]) {
    if (v == fa) continue;
    if (d[v] + 1 > mx0.first) {
      mx1 = mx0;
      mx0 = pair<int, int>(d[v] + 1, v);
    } else if (d[v] + 1 > mx1.first)
      mx1 = pair<int, int>(d[v] + 1, v);
  }
  if (pre != 0) q[u][pre]++;
  for (auto &e : q[u]) {
    swap(e.second, sz[u]);
    sz[u] += e.second;
  }
  int x = 0, m = sz[u];
  pair<int, int> lst = pair<int, int>(-100, 0);
  for (auto e : q[u]) {
    int y = m - e.second;
    if (pre >= e.first) y--;
    auto wr = q[fa].lower_bound(e.first);
    int w = 0;
    if (wr != q[fa].end()) {
      w = sz[fa] - (*wr).second;
    }
    upd(ans[e.first * 2], w + y - 1);
    if (lst.first >= 0) {
      upd(ans[lst.first * 2 + 1], m - e.second + 1);
      upd(ans[lst.first * 2], m - e.second + 1);
    }
    upd(ans[e.first * 2], m - e.second);
    if (e.first > 0) upd(ans[e.first * 2 - 1], m - e.second);
    lst = e;
  }
  map<int, int> sq;
  for (auto v : g[u]) {
    if (v == fa) continue;
    if (v == mx0.second)
      dfs1(v, u, mx1.first + 1);
    else
      dfs1(v, u, mx0.first + 1);
    for (auto e : q[v]) sq[e.first] = max(sq[e.first], e.second);
  }
  vector<pair<int, int> > sf;
  for (auto e : sq) sf.push_back(e);
  int ll = sf.size();
  for (int i = ll - 2; i >= 0; --i)
    sf[i].second = max(sf[i].second, sf[i + 1].second);
  for (auto e : q[u]) {
    int sk = lower_bound(sf.begin(), sf.end(), pair<int, int>(e.first, 0)) -
             sf.begin();
    if (sk >= ll) break;
    upd(ans[e.first * 2], sf[sk].second - 1 + m - e.second);
  }
  q[u].clear();
  q[u][0]++;
  for (auto v : g[u]) {
    if (v == fa) continue;
    q[u][d[v] + 1]++;
  }
  sz[u] = 0;
  for (auto &e : q[u]) {
    swap(e.second, sz[u]);
    sz[u] += e.second;
  }
  for (auto &e : q[u]) e.second = sz[u] - e.second;
}
int main() {
  int n, u, v;
  scanf("%d", &n);
  for (int i = 1; i < n; ++i) {
    scanf("%d%d", &u, &v);
    g[u].push_back(v);
    g[v].push_back(u);
  }
  ans[n] = 1;
  ans[n - 1] = 1;
  dfs0(1, 0);
  dfs1(1, 0, 0);
  for (int i = n - 1; i > 0; --i) ans[i] = max(ans[i], ans[i + 2]);
  for (int i = 1; i <= n; ++i) printf("%d%c", ans[i], " \n"[i == n]);
  ;
  return 0;
}
