#include <bits/stdc++.h>
using namespace std;
int N;
vector<int> e[1000010];
int dep[1000010];
int len[1000010];
int hson[1000010];
vector<int> ans;
void dfs1(int x, int f, int d) {
  dep[x] = d;
  for (int i = 0; i < e[x].size(); i++) {
    int to = e[x][i];
    if (to == f) continue;
    dfs1(to, x, d + 1);
    if (dep[to] > dep[x]) {
      dep[x] = dep[to];
      hson[x] = to;
    }
  }
}
void dfs2(int x, int f, int l) {
  len[x] = l;
  for (int i = 0; i < e[x].size(); i++) {
    int to = e[x][i];
    if (to == f) continue;
    if (to == hson[x]) {
      dfs2(to, x, l + 1);
    } else {
      dfs2(to, x, 1);
    }
  }
  if (!hson[x]) {
    ans.push_back(len[x]);
  }
}
int sum = 0;
int main() {
  cin >> N;
  for (int i = 1; i < N; i++) {
    int u, v;
    scanf("%d %d", &u, &v);
    e[u].push_back(v);
    e[v].push_back(u);
  }
  dfs1(1, 1, 1);
  int x = 1;
  while (hson[x]) x = hson[x];
  memset(dep, 0, sizeof(dep));
  memset(hson, 0, sizeof(hson));
  dfs1(x, x, 1);
  dfs2(x, x, 1);
  sort(ans.begin(), ans.end());
  int cnt = 1;
  printf("1");
  for (int i = ans.size() - 1; i >= 0; i--) {
    ++cnt;
    sum += ans[i];
    printf(" %d", sum);
  }
  while (cnt < N) {
    ++cnt;
    printf(" %d", sum);
  }
  puts("");
  return 0;
}
