#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
const int MXN = 100005;
int sol[MXN];
int reb[MXN];
int par[MXN];
vector<int> adj[MXN];
pii bst[MXN];
int dfs1(int x, int p) {
  int mx1 = 0, mx2 = 0;
  for (int y : adj[x]) {
    if (y == p) continue;
    int res = dfs1(y, x);
    bst[x] = max(bst[x], bst[y]);
    if (res > mx1) {
      mx2 = mx1, mx1 = res;
    } else if (res > mx2) {
      mx2 = res;
    }
  }
  bst[x] = max(bst[x], {mx1 + 1 + mx2, x});
  return mx1 + 1;
}
void dfs2(int x) {
  bst[x] = {1, x};
  for (int y : adj[x]) {
    if (y == par[x]) continue;
    par[y] = x;
    dfs2(y);
    auto& [dep, leaf] = bst[y];
    bst[x] = max(bst[x], {dep + 1, leaf});
  }
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0);
  int n;
  cin >> n;
  for (int i = 1; i < n; ++i) {
    int x, y;
    cin >> x >> y;
    adj[x].push_back(y);
    adj[y].push_back(x);
  }
  dfs1(1, 0);
  int root = bst[1].second;
  dfs2(root);
  set<pii, greater<pii>> st;
  auto rem = [&](int x) {
    do {
      reb[x] = true;
      for (int y : adj[x]) {
        if (reb[y] || y == par[x]) continue;
        st.insert(bst[y]);
      }
      x = par[x];
    } while (x && !reb[x]);
  };
  sol[1] = 1;
  sol[2] = bst[root].first;
  rem(bst[root].second);
  pii nxt;
  for (int y : adj[root]) {
    if (reb[y]) continue;
    nxt = max(nxt, bst[y]);
  }
  if (nxt.first) {
    sol[2] += nxt.first;
    rem(nxt.second);
    st.erase(nxt);
  }
  for (int i = 3; i <= n; ++i) {
    sol[i] = sol[i - 1];
    if (st.size()) {
      auto [dep, leaf] = *st.begin();
      st.erase(st.begin());
      sol[i] += dep;
      rem(leaf);
    }
  }
  sol[1] = 1;
  for (int i = 1; i <= n; ++i) {
    cout << sol[i] << ' ';
  }
  cout << '\n';
}
