#include <bits/stdc++.h>
using namespace std;
const int maxx = 600010;
const double pi = acos(-1.0);
const double eps = 1e-15;
vector<int> h;
vector<int> g[maxx];
int t, n, m, u, v;
int ans = 0, total = 0, sum = 0, cnt = 0, root = 0;
int a[maxx], son[maxx], dep[maxx], siz[maxx], fa[maxx];
void dfs(int x, int father, int dp) {
  int uu = 0;
  for (int i = 0; i < g[x].size(); i++) {
    int to = g[x][i];
    if (to == father) continue;
    uu = 1;
    dfs(to, x, dp + 1);
  }
  if (!uu && ans < dp) ans = dp, root = x;
}
void dfs1(int x, int father) {
  fa[x] = father;
  dep[x] = dep[father] + 1;
  siz[x] = dep[x];
  for (int i = 0; i < g[x].size(); i++) {
    int to = g[x][i];
    if (to == father) continue;
    dfs1(to, x);
    siz[x] = max(siz[x], siz[to]);
    if (!son[x])
      son[x] = to;
    else if (siz[son[x]] < siz[to])
      son[x] = to;
  }
}
void dfs2(int x, int topf) {
  if (!son[x]) {
    h.push_back(dep[x] - dep[topf]);
    return;
  }
  dfs2(son[x], topf);
  for (int i = 0; i < g[x].size(); i++) {
    int to = g[x][i];
    if (to == son[x] || to == fa[x]) continue;
    dfs2(to, x);
  }
}
int main() {
  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);
  }
  dfs(1, 0, 0);
  dfs1(root, 0);
  dfs2(root, 0);
  sort(h.begin(), h.end(), greater<int>());
  ans = 0;
  printf("1 ");
  for (int i = 2; i <= n; i++) {
    if (i - 2 < h.size()) ans += h[i - 2];
    printf("%d ", ans);
  }
  return 0;
}
