#include <bits/stdc++.h>
using namespace std;
long long read() {
  char ch = getchar();
  long long x = 0;
  int op = 1;
  for (; !isdigit(ch); ch = getchar())
    if (ch == '-') op = -1;
  for (; isdigit(ch); ch = getchar()) x = (x << 1) + (x << 3) + ch - '0';
  return x * op;
}
int n, head[100005], cnt, rt, mxdep, po, mx[100005], dep[100005], fa[100005],
    son[100005], ans[100005];
struct edge {
  int to, nxt;
} e[100005 << 1];
void adde(int x, int y) {
  e[++cnt].to = y;
  e[cnt].nxt = head[x];
  head[x] = cnt;
}
void ins(int x, int y) {
  adde(x, y);
  adde(y, x);
}
void dfs(int u, int d) {
  if (d > mxdep) mxdep = d, rt = u;
  for (int i = head[u], v; i; i = e[i].nxt)
    if ((v = e[i].to) != fa[u]) {
      fa[v] = u;
      dfs(v, d + 1);
    }
}
void dfs2(int u) {
  mx[u] = dep[u];
  son[u] = 0;
  for (int i = head[u], v; i; i = e[i].nxt)
    if ((v = e[i].to) != fa[u]) {
      fa[v] = u;
      dep[v] = dep[u] + 1;
      dfs2(v);
      mx[u] = max(mx[u], mx[v]);
      if (!son[u] || mx[v] > mx[son[u]]) son[u] = v;
    }
}
int main() {
  n = read();
  for (int i = (1); i <= (n - 1); i++) {
    int x = read(), y = read();
    ins(x, y);
  }
  dfs(1, 0);
  fa[rt] = 0;
  dfs2(rt);
  priority_queue<pair<int, int> > q;
  ans[1] = 1;
  q.push(pair<int, int>(mx[rt], rt));
  po = 1;
  while (!q.empty()) {
    int val = q.top().first, u = q.top().second;
    q.pop();
    ans[++po] = ans[po - 1] + val;
    for (; u; u = son[u]) {
      for (int i = head[u], v; i; i = e[i].nxt)
        if ((v = e[i].to) != fa[u] && v != son[u])
          q.push(pair<int, int>(mx[v] - dep[v] + 1, v));
    }
  }
  for (int i = (po + 1); i <= (n); i++) ans[i] = n;
  for (int i = (1); i <= (n); i++) printf("%d ", ans[i]);
  puts("");
  return 0;
}
