#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10, inf = 0x3f3f3f3f;
int n, rt, tot, num[N], dep[N], son[N], f[N];
vector<int> edge[N];
void dfs1(int u, int fa, int d) {
  dep[u] = d;
  for (int i = (0), iend = (edge[u].size() - 1); i <= iend; i++) {
    int v = edge[u][i];
    if (v != fa) dfs1(v, u, d + 1);
  }
  rt = dep[rt] > dep[u] ? rt : u;
}
void dfs2(int u, int fa) {
  for (int i = (0), iend = (edge[u].size() - 1); i <= iend; i++) {
    int v = edge[u][i];
    if (v != fa) dfs2(v, u);
    son[u] = f[son[u]] > f[v] ? son[u] : v;
  }
  f[u] = f[son[u]] + 1;
  for (int i = (0), iend = (edge[u].size() - 1); i <= iend; i++) {
    int v = edge[u][i];
    if (v != fa && v != son[u]) num[++tot] = f[v];
  }
}
int main() {
  scanf("%d", &n);
  for (int i = (1), iend = (n - 1); i <= iend; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    edge[u].push_back(v);
    edge[v].push_back(u);
  }
  dfs1(1, 0, 1);
  dfs2(rt, 0);
  num[++tot] = f[rt];
  sort(num + 1, num + 1 + tot, greater<int>());
  printf("1");
  if (n == 1) return 0;
  for (int i = (1), iend = (tot); i <= iend; i++)
    printf(" %d", num[i] = num[i] + num[i - 1]);
  for (int i = (tot + 2), iend = (n); i <= iend; i++) printf(" %d", n);
  return 0;
}
