#include <bits/stdc++.h>
using namespace std;
template <class U, class T>
void Max(U &first, T second) {
  if (first < second) first = second;
}
template <class U, class T>
void Min(U &first, T second) {
  if (first > second) first = second;
}
template <class T>
void add(int &a, T b) {
  a = (a + b) % 1000000007;
}
int pow(int a, int b) {
  int ans = 1;
  while (b) {
    if (b & 1) ans = 1LL * ans * a % 1000000007;
    a = 1LL * a * a % 1000000007;
    b >>= 1;
  }
  return ans;
}
int d[100010], p[100010], n, ch[100010], dp[100010], vis[100010];
vector<int> g[100010];
int bfs(int s) {
  queue<int> q;
  memset(d, -1, sizeof(d));
  d[s] = 0;
  q.push(s);
  while (!q.empty()) {
    int u = q.front();
    q.pop();
    for (auto &v : g[u]) {
      if (d[v] == -1) {
        p[v] = u;
        d[v] = d[u] + 1;
        q.push(v);
      }
    }
  }
  for (int i = 0; i < n; i++)
    if (d[i] > d[s]) s = i;
  return s;
}
void dfs(int u, int fa = -1) {
  ch[u] = -1;
  for (auto &v : g[u]) {
    if (v == fa || vis[v]) continue;
    d[v] = d[u] + 1;
    dfs(v, u);
    if (dp[v] > dp[u]) {
      dp[u] = dp[v];
      ch[u] = v;
    }
  }
  dp[u]++;
}
vector<int> ans;
void go(int u, int fa, int rt) {
  int cnt = 0;
  for (auto &v : g[u]) {
    if (v == fa || vis[v]) continue;
    cnt++;
    if (v != ch[u]) {
      go(v, u, u);
    } else
      go(v, u, rt);
  }
  if (cnt == 0 && !vis[u]) ans.push_back(d[u] - d[rt]);
}
int main() {
  int ca = 0, T, m, k, i, j, K;
  scanf("%d", &n);
  for (int i = 1; i < n; i++) {
    scanf("%d%d", &j, &k), j--, k--;
    g[j].push_back(k), g[k].push_back(j);
  }
  int s = bfs(0), t = bfs(s), D = d[t] + 1;
  int first = t;
  vector<int> q;
  while (first != s) {
    vis[first] = 1;
    q.push_back(first);
    first = p[first];
  }
  q.push_back(s);
  vis[s] = 1;
  for (int i = 0; i < q.size(); i++) {
    int u = q[i];
    d[u] = 0;
    dfs(u, -1);
    go(u, -1, u);
  }
  printf("1 ");
  if (n > 1) printf("%d ", D);
  if (n > 2) {
    sort(ans.begin(), ans.end());
    reverse(ans.begin(), ans.end());
    int s = D;
    for (int i = 0; i < ans.size(); i++) s += ans[i], printf("%d ", s);
    m = 2 + ans.size();
    for (int i = m; i < n; i++) printf("%d ", s);
  }
  puts("");
}
