#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
int n;
vector<int> way[maxn];
int d[maxn];
vector<int> p;
void dfs(int u, int last) {
  d[u] = d[last] + 1;
  for (auto v : way[u]) {
    if (v == last) continue;
    dfs(v, u);
  }
}
void get(int u, int last) {
  for (auto v : way[u]) {
    if (v == last) continue;
    get(v, u);
  }
  int x = 0;
  for (auto v : way[u]) {
    if (v == last) continue;
    if (x == 0 || d[v] > d[x]) x = v;
  }
  d[u] = d[x] + 1;
  for (auto v : way[u])
    if (v != last && v != x) p.push_back(d[v]);
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n - 1; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    way[x].push_back(y);
    way[y].push_back(x);
  }
  dfs(1, 0);
  int u = 1;
  for (int i = 1; i <= n; i++)
    if (d[i] > d[u]) u = i;
  get(u, 0);
  p.push_back(d[u]);
  sort(p.rbegin(), p.rend());
  int ans = 0;
  printf("%d ", 1);
  for (int i = 2, j = 0; i <= n; i++) {
    if (j < p.size()) ans += p[j++];
    printf("%d ", ans);
  }
}
