#include <bits/stdc++.h>
using namespace std;
struct lhy {
  int x, y, z;
};
const int N = 5e5 + 50;
struct Edge {
  int x, y, next;
} edge[N << 1];
int tot;
int fa[N], son[N], du[N], deep1[N], deep2[N], ans[N << 1], vis[N], sum[N];
vector<int> nowv;
vector<lhy> nowp;
inline void add(int x, int y) {
  edge[++tot].x = x;
  edge[tot].y = y;
  edge[tot].next = son[x];
  son[x] = tot;
  du[x]++;
}
void dfs(int x) {
  for (int i = son[x]; i; i = edge[i].next) {
    int y = edge[i].y;
    if (y == fa[x]) continue;
    fa[y] = x;
    dfs(y);
    deep1[x] = max(deep1[x], deep1[y] + 1);
  }
}
void dfs1(int x) {
  int nowp = 0;
  for (int i = son[x]; i; i = edge[i].next) {
    int y = edge[i].y;
    if (y == fa[x]) continue;
    if (deep1[y] + 1 == deep1[x]) nowp = y;
  }
  int nowm = 0;
  for (int i = son[x]; i; i = edge[i].next) {
    int y = edge[i].y;
    if (y == fa[x]) continue;
    if (y != nowp) {
      deep2[y] = max(deep2[x] + 1, deep1[x] + 1),
      nowm = max(nowm, deep1[y] + 1);
    }
  }
  if (nowp) deep2[nowp] = max(deep2[x] + 1, nowm + 1);
  for (int i = son[x]; i; i = edge[i].next) {
    int y = edge[i].y;
    if (y == fa[x]) continue;
    dfs1(y);
  }
}
void getans(int x) {
  nowv.clear();
  for (int i = son[x]; i; i = edge[i].next) {
    int y = edge[i].y;
    if (y == fa[x]) continue;
    nowv.push_back(deep1[y] + 1);
  }
  nowv.push_back(deep2[x]);
  sort(nowv.begin(), nowv.end());
  nowv.push_back(nowv[nowv.size() - 1] + 1);
  int nowsame = 0;
  for (int i = nowv.size() - 2; i >= 0; i--) {
    if (nowv[i]) {
      ans[2 * nowv[i] - 1] =
          max(ans[2 * nowv[i] - 1], (int)nowv.size() - i - 1);
      ans[2 * nowv[i]] = max(ans[2 * nowv[i]], (int)nowv.size() - i - 1);
    }
    if (nowv[i] == nowv[i + 1])
      nowsame++;
    else
      nowsame = 0;
    ans[2 * nowv[i] + 1] =
        max(ans[2 * nowv[i] + 1], (int)nowv.size() - i - 1 - nowsame);
  }
  nowv.clear();
  for (int i = son[x]; i; i = edge[i].next) {
    int y = edge[i].y;
    if (y == fa[x]) continue;
    getans(y);
  }
}
inline int cmp(const lhy &a, const lhy &b) { return a.y < b.y; }
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i < n; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    add(x, y);
    add(y, x);
  }
  for (int i = 1; i <= n; i++) {
    ans[i] = 1;
    ans[1] = max(ans[1], du[i] + 1);
  }
  dfs(1);
  dfs1(1);
  getans(1);
  for (int x = 1; x <= n; x++) {
    nowp.clear();
    for (int i = son[x]; i; i = edge[i].next) {
      int y = edge[i].y;
      if (y == fa[x]) continue;
      nowp.push_back((lhy){y, deep1[y] + 1, 1});
      for (int j = son[y]; j; j = edge[j].next) {
        int yy = edge[j].y;
        if (yy == x) continue;
        nowp.push_back((lhy){y, deep1[yy] + 1, 0});
      }
    }
    nowp.push_back((lhy){0, deep2[x], 1});
    sort(nowp.begin(), nowp.end(), cmp);
    int nowsum = 0, nowmax = 0;
    for (int i = nowp.size() - 1; i >= 0; i--) {
      if (nowp[i].z == 1) {
        nowsum++;
        if (nowp[i].x > 0) vis[nowp[i].x] = 1;
      } else {
        sum[nowp[i].x]++;
        nowmax = max(nowmax, sum[nowp[i].x] - vis[nowp[i].x]);
      }
      int tmp = 0;
      if (nowp[i].z == 1) {
        tmp = nowsum + nowmax;
        ans[2 * nowp[i].y] = max(ans[2 * nowp[i].y], tmp);
      } else {
        tmp = nowsum - vis[nowp[i].x] + sum[nowp[i].x];
        ans[2 * nowp[i].y] = max(ans[2 * nowp[i].y], tmp);
      }
    }
  }
  for (int i = n; i; i--) {
    ans[i] = max(ans[i], ans[i + 2]);
  }
  for (int i = 1; i <= n; i++) printf("%d ", ans[i]);
}
