#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
struct node {
  int to, nxt;
} edge[N << 1];
int n, num, head[N], ans[N], rt, dep[N], a[N], cnt, f[N], son[N];
inline int read() {
  int x = 0, w = 1;
  char c = getchar();
  while (!isdigit(c) && c != '-') c = getchar();
  if (c == '-') c = getchar(), w = -1;
  while (isdigit(c)) {
    x = (x << 1) + (x << 3) + c - '0';
    c = getchar();
  }
  return x * w;
}
inline void add_edge(int from, int to) {
  edge[++num] = (node){to, head[from]};
  head[from] = num;
}
void dfs(int k, int fa) {
  dep[k] = dep[fa] + 1;
  for (register int i = head[k]; i; i = edge[i].nxt) {
    int v = edge[i].to;
    if (v != fa) dfs(v, k);
  }
  if (dep[k] > dep[rt]) rt = k;
}
void DFS(int k, int fa) {
  for (register int i = head[k]; i; i = edge[i].nxt) {
    int v = edge[i].to;
    if (v == fa) continue;
    DFS(v, k);
    if (f[son[k]] < f[v]) son[k] = v;
  }
  f[k] = f[son[k]] + 1;
  for (register int i = head[k]; i; i = edge[i].nxt) {
    int v = edge[i].to;
    if (v != fa && v != son[k]) a[++cnt] = f[v];
  }
}
int main() {
  n = read();
  for (register int i = 1; i < n; i++) {
    int x = read(), y = read();
    add_edge(x, y);
    add_edge(y, x);
  }
  dfs(1, 0);
  DFS(rt, 0);
  a[++cnt] = f[rt];
  sort(a + 1, a + cnt + 1);
  for (register int i = cnt; i; i--) ans[cnt - i + 2] = ans[cnt - i + 1] + a[i];
  ans[1] = 1;
  for (register int i = 1; i <= n; i++)
    printf("%d ", i <= cnt + 1 ? ans[i] : n);
  return 0;
}
