#include <bits/stdc++.h>
using namespace std;
const int oo = 0x3f3f3f3f;
const long long ooo = 9223372036854775807ll;
const int _cnt = 1000 * 1000 + 7;
const int _p = 1000 * 1000 * 1000 + 7;
const int N = 100005;
const double PI = acos(-1.0);
const double eps = 1e-9;
int o(int x) { return x % _p; }
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
int lcm(int a, int b) { return a / gcd(a, b) * b; }
void file_put() {
  freopen("filename.in", "r", stdin);
  freopen("filename.out", "w", stdout);
}
int n, d[N], no[N], x, y, s, t, ret = -oo, ans[N], p[N], k = 0;
vector<int> V[N];
priority_queue<pair<int, int> > Q;
bool flag[N];
void dfs(int x, int f) {
  p[x] = f, d[x] = d[f] + 1, no[x] = x;
  int ret = d[x];
  for (__typeof((V[x]).begin()) it = (V[x]).begin(); it != (V[x]).end(); it++) {
    if (*it == f) continue;
    dfs(*it, x);
    if (d[no[*it]] > ret) ret = d[no[*it]], no[x] = no[*it];
  }
}
int main() {
  scanf("%d", &n);
  for (int i = (1); i <= (n - 1); ++i)
    scanf("%d%d", &x, &y), V[x].push_back(y), V[y].push_back(x);
  d[1] = 1, dfs(1, 0);
  for (int i = (1); i <= (n); ++i)
    if (d[i] > ret) ret = d[i], s = i;
  memset(d, 0, sizeof(d)), d[s] = 1, dfs(s, 0), ret = -oo;
  Q.push(make_pair(1, s));
  while (!Q.empty()) {
    pair<int, int> tt = Q.top();
    Q.pop();
    x = tt.second, y = tt.first, ++k, ans[k] = ans[k - 1] + y;
    for (int i = x; i && !flag[i]; i = p[i]) {
      flag[i] = 1;
      for (__typeof((V[i]).begin()) it = (V[i]).begin(); it != (V[i]).end();
           it++) {
        if (*it == p[i]) continue;
        if (!flag[*it]) Q.push(make_pair(d[no[*it]] - d[i], no[*it]));
      }
    }
  }
  for (int i = (k + 1); i <= (n); ++i) ans[i] = ans[i - 1];
  for (int i = (1); i <= (n); ++i) printf("%d ", ans[i]);
  printf("\n");
  return 0;
}
