#include <bits/stdc++.h>
using namespace std;
inline void chkmax(int& a, int b) {
  if (a < b) a = b;
}
const int N = (int)5e5 + 5;
vector<int> g[N];
map<int, int> to[N];
vector<pair<int, int> > zip[N];
int dfs(int v, int p) {
  int res = 0;
  for (int u : g[v]) {
    if (u == p) continue;
    to[v][u] = dfs(u, v) + 1;
    res = max(res, to[v][u]);
  }
  return res;
}
void dfsReRoot(int v, int p) {
  set<pair<int, int> > S;
  for (auto [u, h] : to[v]) S.insert({h, u});
  for (int u : g[v]) {
    if (u == p) continue;
    S.erase({to[v][u], u});
    to[u][v] = (S.empty() ? 0 : (--S.end())->first) + 1;
    dfsReRoot(u, v);
    S.insert({to[v][u], u});
  }
}
int main() {
  int n;
  scanf("%d", &n);
  vector<pair<int, int> > edges;
  for (int i = 1; i < n; ++i) {
    int u, v;
    scanf("%d %d", &u, &v);
    --u;
    --v;
    edges.push_back({u, v});
    g[u].push_back(v);
    g[v].push_back(u);
  }
  dfs(0, -1);
  dfsReRoot(0, -1);
  vector<int> ans(2 * n + 1, 1);
  for (int v = 0; v < n; ++v) {
    map<int, int> cnt;
    for (auto& [u, h] : to[v]) ++cnt[h];
    chkmax(ans[1], (int)(g[v]).size() + 1);
    int sum = (int)(g[v]).size();
    for (auto& [h, x] : cnt) {
      zip[v].push_back({h, x});
      if (sum > 1) chkmax(ans[2 * h], sum);
      sum -= x;
      if (sum > 0) chkmax(ans[2 * h + 1], sum + 1);
    }
  }
  for (int h = n; h > 0; --h) chkmax(ans[h - 1], ans[h]);
  auto update = [&](int v, int h, int delta) {
    for (auto& [hh, x] : zip[v]) {
      if (hh == h) {
        x += delta;
        return;
      }
    }
  };
  for (auto [u, v] : edges) {
    update(v, to[v][u], -1);
    update(u, to[u][v], -1);
    static vector<pair<int, int> > united;
    united.clear();
    merge((zip[v]).begin(), (zip[v]).end(), (zip[u]).begin(), (zip[u]).end(),
          back_inserter(united));
    int sum = (int)(g[u]).size() + (int)(g[v]).size() - 2;
    for (auto [h, x] : united) {
      chkmax(ans[2 * h], sum);
      sum -= x;
    }
    update(v, to[v][u], +1);
    update(u, to[u][v], +1);
  }
  for (int h = n; h - 2 > 0; --h) chkmax(ans[h - 2], ans[h]);
  for (int i = 1; i <= n; ++i) printf("%d ", ans[i]);
}
