#include <bits/stdc++.h>
using namespace std;
const int N = 500005;
struct edge {
  int to, next;
} e[N * 2];
int head[N], tot, n, mxv, rt;
int vis[N], sum[N], qq[N], deg[N];
int fa[N], sz[N], ans[N];
pair<int, int> mx1[N], mx2[N], q[N * 4];
void add(int x, int y) {
  e[++tot] = (edge){y, head[x]};
  head[x] = tot;
}
void dfs(int x) {
  mx1[x] = mx2[x] = pair<int, int>(0, x);
  for (int i = head[x]; i; i = e[i].next)
    if (e[i].to != fa[x]) {
      fa[e[i].to] = x;
      dfs(e[i].to);
      pair<int, int> tmp(mx1[e[i].to].first + 1, e[i].to);
      if (tmp > mx1[x]) swap(mx1[x], tmp);
      if (tmp > mx2[x]) swap(mx2[x], tmp);
    }
}
void dfs2(int x) {
  for (int i = head[x]; i; i = e[i].next)
    if (e[i].to != fa[x]) {
      pair<int, int> tmp((mx1[x].second == e[i].to ? mx2[x] : mx1[x]).first + 1,
                         x);
      if (tmp > mx1[e[i].to]) swap(mx1[e[i].to], tmp);
      if (tmp > mx2[e[i].to]) swap(mx2[e[i].to], tmp);
      dfs2(e[i].to);
    }
}
int Func(int x, int y) {
  return mx1[x].second == y ? mx2[x].first : mx1[x].first;
}
void dfs(int x, int fa, int n) {
  sz[x] = 1;
  int mx = 0;
  for (int i = head[x]; i; i = e[i].next)
    if (e[i].to != fa && !vis[e[i].to]) {
      dfs(e[i].to, x, n);
      sz[x] += sz[e[i].to];
      mx = max(mx, sz[e[i].to]);
    }
  mx = max(mx, n - sz[x]);
  if (mx < mxv) mxv = mx, rt = x;
}
void solve(int x, int n) {
  mxv = 1 << 30;
  dfs(x, 0, n);
  vis[x = rt] = 1;
  int top = 0;
  for (int i = head[x]; i; i = e[i].next) {
    q[++top] = pair<int, int>(Func(e[i].to, x) + 1, 0);
    if (!vis[e[i].to]) {
      sum[e[i].to] = 0;
      for (int j = head[e[i].to]; j; j = e[j].next)
        q[++top] = pair<int, int>(Func(e[j].to, e[i].to) + 1, e[i].to);
    }
  }
  sort(q + 1, q + top + 1);
  int tg = -2, mx = 0;
  for (int i = (int)(top); i >= (int)(1); i--) {
    if (q[i].second == 0)
      ++tg;
    else
      mx = max(mx, ++sum[q[i].second]);
    ans[q[i].first * 2] = max(ans[q[i].first * 2], tg + mx);
  }
  for (int i = head[x]; i; i = e[i].next)
    if (!vis[e[i].to])
      solve(e[i].to, (sz[e[i].to] > sz[x] ? n - sz[x] : sz[e[i].to]));
}
int main() {
  scanf("%d", &n);
  for (int i = (int)(1); i <= (int)(n - 1); i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    add(x, y);
    add(y, x);
    deg[x]++;
    deg[y]++;
  }
  for (int i = (int)(1); i <= (int)(n); i++) ans[1] = max(ans[1], deg[i] + 1);
  ans[n] = max(ans[n], 1);
  ans[n - 1] = max(ans[n - 1], 1);
  dfs(1);
  dfs2(1);
  for (int i = (int)(1); i <= (int)(n); i++) {
    *qq = 0;
    for (int j = head[i]; j; j = e[j].next) qq[++*qq] = Func(e[j].to, i) + 1;
    sort(qq + 1, qq + *qq + 1);
    for (int j = (int)(1); j <= (int)(*qq); j++) {
      ans[2 * qq[j]] = max(ans[2 * qq[j]], (*qq) - j + 1);
      ans[2 * qq[j] - 1] =
          max(ans[2 * qq[j] - 1],
              (*qq) - j + 1 + (j != 1 && qq[j - 1] == qq[j] - 1));
      if (j != (*qq) && qq[j] != qq[j + 1])
        ans[2 * qq[j] + 1] = max(ans[2 * qq[j] + 1], (*qq) - j + 1);
    }
  }
  solve(1, n);
  for (int i = (int)(n); i >= (int)(1); i--) ans[i] = max(ans[i], ans[i + 2]);
  for (int i = (int)(1); i <= (int)(n); i++) printf("%d ", ans[i]);
}
