#include <bits/stdc++.h>
using namespace std;
int n;
vector<int> adj[100050];
pair<int, int> dfs(int x, int p) {
  pair<int, int> ret(0, x);
  for (auto c : adj[x]) {
    if (c == p) continue;
    pair<int, int> r = dfs(c, x);
    r.first++;
    ret = max(ret, r);
  }
  return ret;
}
vector<int> v;
int dfs2(int x, int p) {
  vector<int> vv;
  for (auto c : adj[x]) {
    if (c == p) continue;
    int ret2 = dfs2(c, x);
    vv.push_back(ret2);
  }
  if (vv.empty()) return 1;
  sort(vv.begin(), vv.end());
  for (int i = 0; i < vv.size() - 1; i++) {
    v.push_back(vv[i]);
  }
  return vv.back() + 1;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i < n; i++) {
    int u, v;
    scanf("%d", &u);
    scanf("%d", &v);
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  int ret1 = dfs(1, -1).second;
  v.push_back(dfs2(ret1, -1));
  sort(v.begin(), v.end());
  reverse(v.begin(), v.end());
  printf("1 ");
  int ans = 0;
  for (int i = 2; i <= n; i++) {
    if (i - 2 < v.size()) ans += v[i - 2];
    printf("%d ", ans);
  }
}
