#include <bits/stdc++.h>
using namespace std;
const int M = 750;
const int N = 500500;
int P[N];
int Dp1[N];
int Dp2[N];
int Ans[2 * N];
vector<pair<int, int> > Edges;
vector<int> Adj[N];
vector<pair<int, int> > DpAdj[N];
int Cnt[N];
int CntCnt[N];
vector<int> Have[N];
int Temp3[N];
vector<int> Temp1;
vector<int> Temp2;
void max_self(int& x, int y) {
  if (x < y) x = y;
}
void DFS1(int x = 1, int p = 0) {
  P[x] = p;
  for (int y : Adj[x])
    if (y ^ p) DFS1(y, x), max_self(Dp1[x], 1 + Dp1[y]);
}
void DFS2(int x = 1, int p = 0) {
  int Max1 = 0, Max2 = 0;
  for (int y : Adj[x]) {
    if (y ^ p) {
      int Cur = Dp1[y] + 1;
      if (Cur > Max1)
        Max2 = Max1, Max1 = Cur;
      else
        max_self(Max2, Cur);
    }
  }
  for (int y : Adj[x]) {
    if (y ^ p) {
      max_self(Dp2[y], Dp2[x] + 1);
      max_self(Dp2[y], (Dp1[y] + 1 == Max1 ? Max2 : Max1) + 1);
    }
  }
  for (int y : Adj[x])
    if (y ^ p) DFS2(y, x);
}
int main() {
  int n;
  cin >> n;
  for (int i = 1; i < n; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    Adj[x].push_back(y);
    Adj[y].push_back(x);
    Edges.emplace_back(x, y);
  }
  DFS1();
  DFS2();
  for (int x = 1; x <= n; x++) {
    for (int y : Adj[x])
      DpAdj[x].emplace_back(y == P[x] ? Dp2[x] : Dp1[y] + 1, y);
    sort(DpAdj[x].begin(), DpAdj[x].end(), greater<pair<int, int> >());
    for (int i = 0; i < DpAdj[x].size(); i++) {
      max_self(Ans[2 * DpAdj[x][i].first], i + 1);
      max_self(Ans[2 * DpAdj[x][i].first - 1], i + 1);
    }
  }
  for (int x = 1; x <= n; x++) {
    for (int i = 0, j = 0; i < DpAdj[x].size(); i++) {
      while (j < i && DpAdj[x][j].first > DpAdj[x][i].first) j++;
      max_self(Ans[2 * DpAdj[x][i].first + 1], j + 1);
    }
  }
  for (int x = 1; x <= n; x++) {
    if (Adj[x].size() >= M) {
      for (int y : Adj[x])
        for (pair<int, int> z : DpAdj[y])
          if (z.second ^ x) Have[z.first].push_back(y);
      int MaxCnt = 0;
      int MinDist = n;
      for (int i = 0; i < DpAdj[x].size(); i++) {
        for (; MinDist >= DpAdj[x][i].first; MinDist--) {
          for (int y : Have[MinDist]) {
            CntCnt[Cnt[y]]--;
            max_self(MaxCnt, ++Cnt[y]);
            CntCnt[Cnt[y]]++;
          }
          max_self(Ans[2 * MinDist], MaxCnt + i);
        }
        int y = DpAdj[x][i].second;
        if (MaxCnt == Cnt[y] && CntCnt[Cnt[y]] == 1) MaxCnt--;
        CntCnt[Cnt[y]]--;
        CntCnt[--Cnt[y]]++;
        max_self(Ans[2 * (MinDist + 1)], MaxCnt + i + 1);
      }
      for (; MinDist > 0; MinDist--) {
        for (int y : Have[MinDist]) {
          CntCnt[Cnt[y]]--;
          max_self(MaxCnt, ++Cnt[y]);
          CntCnt[Cnt[y]]++;
        }
        max_self(Ans[2 * MinDist], MaxCnt + (int)DpAdj[x].size() - 1);
      }
      for (int i = 1; i <= n; i++) Cnt[i] = CntCnt[i] = 0, Have[i].clear();
    }
  }
  for (pair<int, int> p : Edges) {
    int x = p.first, y = p.second;
    if (Adj[x].size() < M && Adj[y].size() < M) {
      Temp1.clear();
      Temp2.clear();
      for (pair<int, int> z : DpAdj[x])
        if (z.second ^ y) Temp1.push_back(z.first);
      for (pair<int, int> z : DpAdj[y])
        if (z.second ^ x) Temp2.push_back(z.first);
      merge(Temp1.begin(), Temp1.end(), Temp2.begin(), Temp2.end(), Temp3,
            greater<int>());
      for (int i = 0; i < Temp1.size() + Temp2.size(); i++)
        max_self(Ans[2 * Temp3[i]], i + 1);
    }
  }
  for (int i = 1; i < 2 * N; i++) max_self(Ans[i], 1);
  for (int x = 1; x <= n; x++) max_self(Ans[1], Adj[x].size() + 1);
  for (int x = 1; x <= n; x++) max_self(Ans[max(Dp1[x], Dp2[x])], 2);
  for (int x = 1; x <= n; x++) max_self(Ans[max(Dp1[x], Dp2[x]) - 1], 2);
  for (int i = 2 * N - 3; i > 1; i--) max_self(Ans[i], Ans[i + 2]);
  for (int i = 1; i <= n; i++) printf("%d ", Ans[i]);
  puts("");
}
