#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
struct E {
  int to, nxt;
} data[N << 1];
int len = 1, n, h[N], dep[N], f[N], q[N], son[N];
bool v[N];
int rt, cnt, S, T, ans;
inline int rd() {
  int x = 0;
  int f = 1;
  char s = getchar();
  while (!isdigit(s)) f = (s == '-' ? -1 : f), s = getchar();
  while (isdigit(s)) x = (x << 1) + (x << 3) + s - '0', s = getchar();
  return x * f;
}
inline void ins(int x, int y) {
  data[++len].to = y;
  data[len].nxt = h[x];
  h[x] = len;
  data[++len].to = x;
  data[len].nxt = h[y];
  h[y] = len;
}
void dfs(int x, int fa) {
  dep[x] = dep[fa] + 1;
  for (int i = h[x]; i; i = data[i].nxt) {
    int y = data[i].to;
    if (y == fa) continue;
    dfs(y, x);
  }
  if (dep[x] > dep[rt]) rt = x;
  return;
}
void dfs1(int x, int fa) {
  for (int i = h[x]; i; i = data[i].nxt) {
    int y = data[i].to;
    if (y == fa) continue;
    dfs1(y, x);
    if (f[y] > f[son[x]]) son[x] = y;
  }
  f[x] = f[son[x]] + 1;
  for (int i = h[x]; i; i = data[i].nxt) {
    int y = data[i].to;
    if (y == fa) continue;
    if (y != fa && y != son[x]) q[++cnt] = f[y];
  }
}
bool cmp(int x, int y) { return x > y; }
int main() {
  n = rd();
  printf("%d ", 1);
  if (n == 1) {
    return 0;
  }
  for (int i = 1; i < n; i++) {
    int x = rd();
    int y = rd();
    ins(x, y);
  }
  rt = 0;
  dep[0] = 0;
  f[0] = 0;
  dfs(1, 0);
  dfs1(rt, 0);
  q[++cnt] = f[rt];
  sort(q + 1, q + cnt + 1, cmp);
  ans = 0;
  for (int i = 2; i <= n; i++) {
    if (i - 1 <= cnt) ans += q[i - 1];
    printf("%d ", ans);
  }
  return 0;
}
