#include <bits/stdc++.h>
using namespace std;
int n, dp[600000], rl[600000], gl[600000];
vector<int> e[600000], l[600000];
vector<pair<int, int>> h[600000];
void add(int i, int v) {
  if (v <= 1) return;
  gl[v] = max(gl[v], i);
}
void remove(int i, int v) {
  if (v <= 1) return;
  rl[v] = max(rl[v], i);
}
void dfs(int i = 0, int p = -1) {
  dp[i] = 1;
  l[i].push_back(0);
  for (int j : e[i]) {
    if (j == p) continue;
    dfs(j, i);
    l[i].push_back(dp[j]);
    dp[i] = max(dp[i], dp[j] + 1);
  }
}
void down(int i = 0, int p = -1, int pl = -1) {
  if (p != -1) l[i].push_back(pl + 1);
  sort(l[i].begin(), l[i].end());
  for (int j : e[i]) {
    if (j == p) continue;
    if (dp[j] == l[i].back())
      down(j, i, l[i][((int)(l[i]).size()) - 2]);
    else
      down(j, i, l[i].back());
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout << fixed << setprecision(12);
  cin >> n;
  int a, b;
  for (int i = 0; i < n - 1; i++) {
    cin >> a >> b, a--, b--;
    e[a].push_back(b);
    e[b].push_back(a);
  }
  dfs();
  down();
  for (int i = 0; i < n; i++) {
    int j = 0;
    int la = 0;
    while (j < ((int)(l[i]).size())) {
      h[i].push_back({l[i][j], ((int)(l[i]).size()) - j});
      if (l[i][j] > 0) {
        for (int k : e[i]) {
          int kk = l[k].end() - lower_bound(l[k].begin(), l[k].end(), l[i][j]);
          add(2 * l[i][j] + 1, ((int)(l[i]).size()) - j - 1 + kk - 1);
        }
        remove(2 * la + 2, ((int)(l[i]).size()) - j + 1);
        add(2 * l[i][j] + 1, ((int)(l[i]).size()) - j);
        remove(2 * l[i][j] + 1, ((int)(l[i]).size()) - j);
      }
      la = l[i][j];
      while (j < ((int)(l[i]).size()) && la == l[i][j]) j++;
    }
  }
  int ind = n + 20, indd = n + 20;
  rl[1] = n + 1;
  gl[1] = n + 1;
  for (int i = 1; i <= n; i++) {
    while (rl[ind] <= i) ind--;
    while (gl[indd] <= i) indd--;
    cout << (((i & 1) == 1) ? ind : indd) << (i < n ? " " : "\n");
  }
}
