#include <bits/stdc++.h>
using namespace std;
int depth[500100];
vector<int> adj[500100];
map<int, int> H[500100];
void dfs1(int u, int par = 0) {
  depth[u] = 0;
  for (int i = 0; i < adj[u].size(); i++) {
    int v = adj[u][i];
    if (v != par) {
      dfs1(v, u);
      depth[u] = max(depth[u], depth[v] + 1);
    }
  }
}
void dfs2(int u, int par = 0, int par_depth = 0) {
  int second_max_depth = depth[u] = 0;
  for (int i = 0; i < adj[u].size(); i++) {
    int v = adj[u][i], tmp;
    if (v == par) {
      tmp = par_depth + 1;
    } else {
      tmp = depth[v] + 1;
    }
    if (depth[u] <= tmp) {
      second_max_depth = depth[u];
      depth[u] = tmp;
    } else if (second_max_depth < tmp) {
      second_max_depth = tmp;
    }
    H[u][tmp]++;
  }
  for (int i = 0; i < adj[u].size(); i++) {
    int v = adj[u][i];
    if (v != par) {
      if (depth[v] + 1 == depth[u]) {
        dfs2(v, u, second_max_depth);
      } else {
        dfs2(v, u, depth[u]);
      }
    }
  }
}
int ans[2 * 500100];
int main() {
  int n;
  while (scanf("%d", &n) > 0) {
    for (int i = 0; i < n - 1; i++) {
      int u, v;
      scanf("%d%d", &u, &v);
      adj[u].push_back(v);
      adj[v].push_back(u);
    }
    dfs1(1);
    dfs2(1);
    for (int i = 1; i <= n; i++) {
      ans[i] = 1;
    }
    for (int u = 1; u <= n; u++) {
      ans[1] = max(ans[1], (int)adj[u].size() + 1);
      ans[depth[u]] = max(ans[depth[u]], 2);
      if (depth[u]) ans[depth[u] - 1] = max(ans[depth[u] - 1], 2);
      map<int, int>::iterator it = H[u].end();
      int acum = 0;
      do {
        it--;
        int l = it->first;
        ans[2 * l + 1] = max(ans[2 * l + 1], acum + 1);
        acum += it->second;
        ans[2 * (l - 1) + 1] = max(ans[2 * (l - 1) + 1], acum);
        ans[2 * l] = max(ans[2 * l], acum);
      } while (it != H[u].begin());
      for (int i = 0; i < adj[u].size(); i++) {
        int v = adj[u][i];
        vector<pair<int, int> > Hm;
        map<int, int>::iterator itu = H[u].begin(), itv = H[v].begin();
        while (itu != H[u].end() or itv != H[v].end()) {
          if (itu == H[u].end()) {
            Hm.push_back(*itv);
            itv++;
          } else if (itv == H[v].end()) {
            Hm.push_back(*itu);
            itu++;
          } else if (itv->first < itu->first) {
            Hm.push_back(*itv);
            itv++;
          } else {
            Hm.push_back(*itu);
            itu++;
          }
        }
        int acum = 0;
        for (int j = Hm.size() - 1; j >= 0; j--) {
          int l = Hm[j].first;
          acum += Hm[j].second;
          ans[2 * l] = max(ans[2 * l], acum - 2);
        }
      }
    }
    for (int i = n - 2; i >= 1; i--) {
      ans[i] = max(ans[i], ans[i + 2]);
    }
    for (int i = 1; i <= n; i++) {
      if (i > 1) printf(" ");
      printf("%d", ans[i]);
    }
    printf("\n");
    for (int i = 1; i <= n; i++) {
      adj[i].clear();
      H[i].clear();
    }
  }
}
