#include <bits/stdc++.h>
using namespace std;
vector<int> g[100010];
int deg[100010];
int par[100010];
int ans[100010];
int dp[100010];
int lev[100010];
void dfs(int x, int anc) {
  int nxt = -1;
  dp[x] = 0;
  par[x] = -1;
  for (auto i : g[x]) {
    if (i - anc) {
      dfs(i, x);
      if (nxt == -1 || dp[nxt] < dp[i]) {
        dp[x] = 1 + dp[i];
        nxt = i;
      }
    }
  }
  if (nxt != -1) {
    par[nxt] = x;
  }
}
int main(int argc, char const *argv[]) {
  int n;
  scanf("%d", &n);
  for (int i = 1; i < n; i++) {
    int p, q;
    scanf("%d %d", &p, &q);
    g[p].push_back(q);
    g[q].push_back(p);
    ++deg[p];
    ++deg[q];
  }
  if (n == 2) {
    printf("1 2\n");
    exit(0);
  }
  queue<int> Q;
  vector<int> leaf;
  for (int i = 1; i <= n; i++) {
    if (deg[i] == 1) {
      Q.push(i);
      leaf.push_back(i);
    }
  }
  int maxlevel = 0;
  while (!Q.empty()) {
    int x = Q.front();
    Q.pop();
    deg[x] = 0;
    for (int i : g[x]) {
      --deg[i];
      if (deg[i] == 1) {
        lev[i] = 1 + lev[x];
        maxlevel = max(maxlevel, lev[i]);
        Q.push(i);
      }
    }
  }
  int root = 1;
  for (int i = 1; i <= n; i++) {
    if (maxlevel == lev[i]) {
      root = i;
      break;
    }
  }
  dfs(root, 0);
  vector<int> v;
  for (int i : leaf) {
    int len = 0;
    int cur = i;
    while (cur != -1) {
      ++len;
      cur = par[cur];
    }
    v.push_back(len);
  }
  sort(v.begin(), v.end());
  reverse(v.begin(), v.end());
  for (int i = 1; i <= v.size(); i++) {
    ans[i] = ans[i - 1] + v[i - 1];
  }
  for (int i = v.size() + 1; i <= n; i++) {
    ans[i] = ans[i - 1];
  }
  ans[1] = 1;
  for (int i = 1; i <= n; i++) {
    printf("%d ", ans[i]);
  }
  printf("\n");
  return 0;
}
