#include <bits/stdc++.h>
using namespace std;
vector<int> d[100001], t;
int n, m, u, v, res, dep[100001], fa[100001], f[100001], nxt[100001];
bool cmp(int x, int y) { return x > y; }
void dfs(int x) {
  for (int i = 0; i < d[x].size(); i++)
    if (fa[x] != d[x][i])
      dep[d[x][i]] = dep[x] + 1, fa[d[x][i]] = x, dfs(d[x][i]);
}
void rua(int x) {
  f[x] = 1;
  for (int i = 0; i < d[x].size(); i++)
    if (fa[x] != d[x][i]) {
      fa[d[x][i]] = x, rua(d[x][i]);
      if (f[x] < f[d[x][i]] + 1) f[x] = f[d[x][i]] + 1, nxt[x] = d[x][i];
    }
  for (int i = 0; i < d[x].size(); i++)
    if (fa[x] != d[x][i] && nxt[x] != d[x][i]) t.push_back(f[d[x][i]]);
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i < n; i++) {
    scanf("%d%d", &u, &v);
    d[u].push_back(v);
    d[v].push_back(u);
  }
  dfs(1);
  for (int i = 1; i <= n; i++) m = dep[i] > dep[m] ? i : m;
  fa[m] = 0, rua(m), t.push_back(f[m]);
  sort(t.begin(), t.end(), cmp);
  while (t.size() < n - 1) t.push_back(0);
  printf("1");
  for (int i = 0; i < n - 1; i++) printf(" %d", res += t[i]);
  return printf("\n"), 0;
}
