#include <bits/stdc++.h>
using namespace std;
struct edge {
  int to, nxt;
} ed[200020];
int edcnt = 0;
int hd[100010];
inline void adde(int u, int v) {
  ed[++edcnt].to = v;
  ed[edcnt].nxt = hd[u];
  hd[u] = edcnt;
}
int n, dep[100010], rt, son[100010], md[100010];
void dfs1(int u, int fa) {
  dep[u] = dep[fa] + 1;
  if (dep[rt] < dep[u]) rt = u;
  for (int id = hd[u]; id; id = ed[id].nxt) {
    int v = ed[id].to;
    if (v == fa) continue;
    dfs1(v, u);
  }
}
void dfs2(int u, int fa) {
  md[u] = 1;
  for (int id = hd[u]; id; id = ed[id].nxt) {
    int v = ed[id].to;
    if (v == fa) continue;
    dfs2(v, u);
    md[u] = max(md[u], md[v] + 1);
    if (md[son[u]] < md[v]) son[u] = v;
  }
}
int res[100010], cnt = 0;
void dfs3(int u, int fa, int len) {
  if (ed[hd[u]].nxt == 0 && u != fa) {
    res[++cnt] = len;
    return;
  }
  dfs3(son[u], u, len + 1);
  for (int id = hd[u]; id; id = ed[id].nxt) {
    int v = ed[id].to;
    if (v == fa || v == son[u]) continue;
    dfs3(v, u, 1);
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 1, u, v; i < n; ++i) {
    scanf("%d%d", &u, &v);
    adde(u, v);
    adde(v, u);
  }
  dfs1(1, 1);
  dfs2(rt, rt);
  dfs3(rt, rt, 0);
  int ans = 1;
  printf("%d ", ans);
  sort(res + 1, res + 1 + cnt, greater<int>());
  for (int i = 2; i <= n; i++) {
    ans += res[i - 1];
    printf("%d ", ans);
  }
  puts("");
}
