#include <bits/stdc++.h>
const int N = 100005;
struct Edge {
  int u, v, to;
} edge[N * 2];
int head[N];
int deep[N];
int e;
int ans[N];
int dir[N];
int maxdeep[N];
int wsnb[N];
struct Point {
  int u, num;
  Point(int _u, int _num) {
    u = _u;
    num = _num;
  }
  bool operator<(const Point a) const { return num < a.num; }
};
std::priority_queue<Point> q;
void Init() {
  e = 0;
  memset(deep, 0, sizeof deep);
  memset(head, -1, sizeof head);
  memset(maxdeep, 0, sizeof maxdeep);
}
void add(int u, int v) {
  edge[e].u = u;
  edge[e].v = v;
  edge[e].to = head[u];
  head[u] = e++;
}
void dfs(int u, int fa) {
  wsnb[u] = fa;
  maxdeep[u] = 1;
  dir[u] = -1;
  for (int i = head[u]; i != -1; i = edge[i].to) {
    int v = edge[i].v;
    if (v == fa) continue;
    deep[v] = deep[u] + 1;
    dfs(v, u);
    if (maxdeep[v] + 1 > maxdeep[u]) {
      dir[u] = v;
      maxdeep[u] = maxdeep[v] + 1;
    }
  }
}
void solve(int u, int fa) {
  for (int i = head[u]; i != -1; i = edge[i].to) {
    int v = edge[i].v;
    if (v != dir[u] && v != fa) {
      q.push(Point(v, maxdeep[v]));
    }
  }
  if (dir[u] != -1) solve(dir[u], u);
}
int main() {
  int n;
  scanf("%d", &n);
  Init();
  for (int i = 1; i < n; i++) {
    int u, v;
    scanf("%d %d", &u, &v);
    add(u, v);
    add(v, u);
  }
  dfs(1, 0);
  int s = 0;
  int op = 0;
  for (int i = 1; i <= n; i++) {
    if (deep[i] > s) {
      s = deep[i];
      op = i;
    }
  }
  dfs(op, 0);
  ans[1] = 0;
  q.push(Point(op, maxdeep[op]));
  for (int i = 2; i <= n; i++) {
    ans[i] = ans[i - 1];
    if (!q.empty()) {
      Point tmp = q.top();
      q.pop();
      ans[i] += tmp.num;
      int u = tmp.u;
      solve(u, wsnb[u]);
    }
  }
  ans[1] = 1;
  for (int i = 1; i <= n; i++) {
    if (i == 1)
      printf("%d", ans[i]);
    else
      printf(" %d", ans[i]);
  }
  printf("\n");
  return 0;
}
