#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
int n, u, v, rt, d[maxn], son[maxn], h[maxn];
int head[maxn], cnt;
struct edge {
  int to, next;
} e[maxn << 1];
vector<int> val;
void adde(int u, int v) {
  e[++cnt].to = v;
  e[cnt].next = head[u];
  head[u] = cnt;
}
void dfs1(int u, int fa) {
  d[u] = d[fa] + 1;
  int num = 0;
  for (int i = head[u]; i; i = e[i].next) {
    int v = e[i].to;
    if (v == fa) continue;
    dfs1(v, u);
    num++;
  }
  if (!num) {
    if (!rt || d[u] >= d[rt]) rt = u;
  }
}
void dfs2(int u, int fa) {
  d[u] = d[fa] + 1;
  h[u] = d[u];
  for (int i = head[u]; i; i = e[i].next) {
    int v = e[i].to;
    if (v == fa) continue;
    dfs2(v, u);
    h[u] = max(h[u], h[v]);
    if (!son[u])
      son[u] = v;
    else if (h[son[u]] < h[v])
      son[u] = v;
  }
}
void dfs3(int u, int fa, int tp) {
  if (!son[u]) {
    val.push_back(d[u] - d[tp]);
    return;
  }
  dfs3(son[u], u, tp);
  for (int i = head[u]; i; i = e[i].next) {
    int v = e[i].to;
    if (v == fa) continue;
    if (v == son[u]) continue;
    dfs3(v, u, u);
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i < n; i++) {
    scanf("%d%d", &u, &v);
    adde(u, v);
    adde(v, u);
  }
  rt = 0;
  long long ans = 0;
  dfs1(1, 0);
  dfs2(rt, 0);
  dfs3(rt, 0, 0);
  printf("1 ");
  sort(val.begin(), val.end(), greater<int>());
  for (int i = 2; i <= n; i++) {
    if (i - 2 < val.size()) ans += val[i - 2];
    printf("%lld ", ans);
  }
  return 0;
}
