#include <bits/stdc++.h>
using namespace std;
const int N = 734343;
vector<int> G[N], H[N];
vector<pair<int, int>> H1[N];
int deg[N], ans[N], dep[N], p[N], down[N];
int n;
void dfs(int x) {
  down[x] = 1;
  ans[1] = max(ans[1], int(G[x].size()) + 1);
  for (auto y : G[x]) {
    if (y == p[x]) continue;
    p[y] = x;
    dep[y] = dep[x] + 1;
    dfs(y);
    down[x] = max(down[x], down[y] + 1);
  }
}
void dfs1(int x) {
  int max1 = 0, max2 = 0;
  int max3 = 0, max4 = 0;
  for (auto y : G[x]) {
    if (y == p[x]) continue;
    H[x].push_back(down[y]);
    if (down[y] > max3) {
      max4 = max3;
      max3 = down[y];
    } else if (down[y] > max4) {
      max4 = down[y];
    }
  }
  sort(H[x].begin(), H[x].end(), greater<int>());
  int cnt = 0, lastp = -1, j = 0;
  for (auto it : H[x]) {
    ++j;
    ans[it * 2] = max(ans[it * 2], j);
    if (it != lastp) {
      if (cnt) {
        ans[it * 2 + 1] = max(ans[it * 2 + 1], j);
      }
      lastp = it;
      cnt = 0;
    } else {
      ans[it * 2 - 1] = max(ans[it * 2 - 1], j);
    }
    ++cnt;
    if (max1 == 0)
      max1 = it;
    else if (max2 == 0)
      max2 = it;
  }
  for (auto y : G[x]) {
    if (y == p[x]) continue;
    if (down[y] == max1)
      H[y].push_back(max2 + 1);
    else
      H[y].push_back(max1 + 1);
    dfs1(y);
  }
  cnt = 0;
  if (p[x])
    for (int i = 1; i <= max4; ++i) {
      int temp =
          upper_bound(H[p[x]].begin(), H[p[x]].end(), i, greater<int>()) -
          H[p[x]].begin();
      temp += upper_bound(H[x].begin(), H[x].end(), i, greater<int>()) -
              H[x].begin();
      ans[i * 2] = max(ans[i * 2], temp - 2);
    }
}
int main() {
  int cases = 1;
  for (int iii = 1; iii <= cases; ++iii) {
    scanf("%d", &n);
    for (int i = 1; i < n; ++i) {
      int x, y;
      scanf("%d%d", &x, &y);
      G[x].push_back(y);
      G[y].push_back(x);
    }
    p[1] = 0;
    dfs(1);
    dfs1(1);
    for (int i = n; i >= 1; --i) {
      ans[i] = max(ans[i], ans[i + 2]);
      ans[i] = max(ans[i], 1);
    }
    for (int i = 1; i <= n; ++i) {
      printf("%d%c", ans[i], " \n"[i == n]);
    }
  }
}
