#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
vector<int> g[N];
int n, mx, id, depth[N], freq[N];
void dfs(int u, int p, int dep) {
  if (dep >= mx) id = u, mx = dep;
  for (auto i : g[u])
    if (i != p) dfs(i, u, dep + 1);
}
void dfs(int u, int p) {
  for (auto i : g[u])
    if (i != p) dfs(i, u), depth[u] = max(depth[u], depth[i] + 1);
  freq[depth[u]]++;
}
int main() {
  scanf("%d", &n);
  for (int i = 1, a, b; i < n; i++) {
    scanf("%d%d", &a, &b);
    g[--a].push_back(--b);
    g[b].push_back(a);
  }
  dfs(0, -1, 0);
  mx = 0;
  dfs(id, -1, 0);
  dfs(id, -1);
  printf("1 ");
  int sub = 0, ans = 0, rem = n - 1;
  for (int i = n; i + 1; i--) {
    freq[i] -= sub;
    while (freq[i] > 0) {
      sub++;
      freq[i]--;
      ans += i + 1;
      rem--;
      printf("%d ", ans);
    }
  }
  while (rem--) printf("%d ", ans);
}
