#include <bits/stdc++.h>
using namespace std;
const int N = 100005;
struct E {
  int to, next;
} mem[N << 1];
int rt, num, n, x, y, ans, now, lft;
int dep[N], head[N], sum[N];
void add(int x, int y) {
  num++;
  mem[num].to = y;
  mem[num].next = head[x];
  head[x] = num;
}
void dfs1(int k, int pre) {
  int j, u;
  dep[k] = 1;
  for (j = head[k]; j; j = mem[j].next) {
    u = mem[j].to;
    if (u == pre) continue;
    dfs1(u, k);
    dep[k] = max(dep[k], dep[u] + 1);
  }
  sum[dep[k]]++;
}
void dfs2(int k, int pre) {
  int j, u;
  for (j = head[k]; j; j = mem[j].next) {
    u = mem[j].to;
    if (u == pre) continue;
    dep[u] = dep[k] + 1;
    dfs2(u, k);
  }
}
int main() {
  int i;
  scanf("%d", &n);
  for (i = 1; i < n; i++) {
    scanf("%d%d", &x, &y);
    add(x, y);
    add(y, x);
  }
  if (n == 1) {
    printf("1\n");
    return 0;
  }
  dep[1] = 1;
  dfs2(1, 0);
  rt = 0;
  for (i = 1; i <= n; i++)
    if (dep[i] > dep[rt]) rt = i;
  dep[rt] = 1;
  dfs2(rt, 0);
  rt = 0;
  for (i = 1; i <= n; i++)
    if (dep[i] > dep[rt]) rt = i;
  dep[rt] = 1;
  dfs1(rt, 0);
  printf("1 ");
  now = 0;
  lft = n - 1;
  for (i = n; i >= 1; i--) {
    sum[i] -= now;
    while (sum[i] > 0) {
      sum[i]--;
      now++;
      lft--;
      ans += i;
      printf("%d ", ans);
    }
  }
  for (i = 1; i <= lft; i++) printf("%d ", ans);
  return 0;
}
