#include <bits/stdc++.h>
using namespace std;
const long long inf = INT_MAX, df = 1e5 + 7;
vector<long long> len;
struct edge {
  long long to, next;
} e[df << 2];
long long i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, fa[df],
    head[df], dp[df], dep[df], root, son[df];
inline long long read() {
  long long x = 0, y = 1;
  char ch = getchar();
  while (ch > '9' || ch < '0') y = (ch == '-') ? -1 : 1, ch = getchar();
  while (ch >= '0' && ch <= '9')
    x = (x << 3) + (x << 1) + ch - '0', ch = getchar();
  return x * y;
};
inline void add(long long u, long long v) {
  e[k].to = v, e[k].next = head[u], head[u] = k++;
  return;
}
void dfs(long long u) {
  dep[u] = dep[fa[u]] + 1;
  for (long long i = head[(u)], v = e[i].to; i != -1;
       i = e[i].next, v = e[i].to)
    if (v != fa[u]) fa[v] = u, dfs(v);
  if (dep[u] > dep[root]) root = u;
  return;
}
void dfs1(long long u) {
  long long maxn = 0;
  for (long long i = head[(u)], v = e[i].to; i != -1;
       i = e[i].next, v = e[i].to) {
    if (v != fa[u]) fa[v] = u, dfs1(v);
    if (maxn < dp[v]) maxn = dp[v], son[u] = v;
  }
  dp[u] = dp[son[u]] + 1;
  for (long long i = head[(u)], v = e[i].to; i != -1;
       i = e[i].next, v = e[i].to) {
    if (v != fa[u] && v != son[u]) len.push_back(dp[v]);
  }
  return;
}
int main() {
  n = read();
  for (long long i = (1); i <= (n); ++i) head[i] = -1;
  for (long long i = (1); i <= (n - 1); ++i) {
    u = read(), v = read(), add(u, v), add(v, u);
  }
  dfs(1);
  memset(fa, 0, sizeof(fa));
  dfs1(root);
  len.push_back(dp[root]);
  printf("1 ");
  if (n == 1) return 0;
  long long ans = 0;
  sort(len.begin(), len.end());
  for (long long i = (len.size() - 1); i >= (0); --i) {
    printf("%lld ", ans = ans + len[i]);
  }
  n = n - len.size() - 1;
  while (n--) printf("%lld ", ans);
  return 0;
}
