#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int n, fa[N], st[N], ed[N], pos[N], dep[N], vi[N], Q[N], rt, cnt;
int mx[N << 2], mk[N << 2];
vector<int> e[N];
void getrt() {
  int L = 0, R = 1;
  Q[1] = 1;
  while (L < R) {
    int u = Q[++L];
    for (auto v : e[u])
      if (!vi[v]) {
        vi[v] = 1;
        Q[++R] = v;
      }
  }
  memset(vi, 0, sizeof vi);
  rt = Q[R];
}
void dfs(int u, int f, int d) {
  fa[u] = f, dep[u] = d, pos[st[u] = ++cnt] = u;
  for (auto v : e[u])
    if (v != f) {
      dfs(v, u, d + 1);
    }
  ed[u] = cnt;
}
void pushup(int u) { mx[u] = max(mx[u << 1], mx[u << 1 | 1]); }
void pushdn(int u) {
  mk[u << 1] += mk[u];
  mk[u << 1 | 1] += mk[u];
  mx[u << 1] += mk[u];
  mx[u << 1 | 1] += mk[u];
  mk[u] = 0;
}
void build(int u, int l, int r) {
  if (l == r)
    mx[u] = dep[pos[l]] - 1;
  else {
    int mi = l + r >> 1;
    build(u << 1, l, mi);
    build(u << 1 | 1, mi + 1, r);
    pushup(u);
  }
}
void upd(int u, int l, int r, int L, int R, int w) {
  if (L <= l && r <= R)
    mx[u] += w, mk[u] += w;
  else {
    pushdn(u);
    int mi = l + r >> 1;
    if (L <= mi) upd(u << 1, l, mi, L, R, w);
    if (R > mi) upd(u << 1 | 1, mi + 1, r, L, R, w);
    pushup(u);
  }
}
pair<int, int> qry(int u, int l, int r) {
  if (l == r) return make_pair(mx[u], l);
  pushdn(u);
  int mi = l + r >> 1;
  if (mx[u << 1] > mx[u << 1 | 1]) return qry(u << 1, l, mi);
  return qry(u << 1 | 1, mi + 1, r);
}
void modi(int u) {
  if (vi[u]) return;
  vi[u] = 1;
  upd(1, 1, n, st[u], ed[u], -1);
  modi(fa[u]);
}
int main() {
  cin >> n;
  for (int i = 1; i <= n - 1; ++i) {
    int x, y;
    cin >> x >> y;
    e[x].push_back(y);
    e[y].push_back(x);
  }
  getrt();
  dfs(rt, 0, 1);
  build(1, 1, n);
  vi[rt] = 1;
  int ans = 1;
  cout << ans;
  for (int i = 2; i <= n; ++i) {
    auto pr = qry(1, 1, n);
    ans += pr.first;
    cout << ' ' << ans;
    modi(pos[pr.second]);
  }
}
