#include <bits/stdc++.h>
using namespace std;
const int N = 5e5 + 7;
void Max(int &x, int y) {
  if (x < y) x = y;
}
int n, deg[N], cnt[N], Fa[N], pnt[N], dep[N], g[N], f1[N], f2[N], sum[N],
    mxd[N], sxd[N], glen[N];
vector<int> tmp[N], G[N], e[N];
void dfs1(int x) {
  for (int v : e[x])
    if (v ^ Fa[x]) {
      Fa[v] = x, dfs1(v);
      if (mxd[v] + 1 > mxd[x])
        sxd[x] = mxd[x], mxd[x] = mxd[v] + 1;
      else if (mxd[v] + 1 > sxd[x])
        sxd[x] = mxd[v] + 1;
    }
}
void dfs2(int x) {
  if (x ^ 1) tmp[x].push_back(glen[x]);
  for (int v : e[x])
    if (v ^ Fa[x])
      tmp[x].push_back(mxd[v] + 1),
          glen[v] = max(glen[x], mxd[v] + 1 == mxd[x] ? sxd[x] : mxd[x]) + 1,
          dfs2(v);
}
void work(int x) {
  sort(tmp[x].begin(), tmp[x].end());
  for (int now : tmp[x]) cnt[now]++;
  int sz = tmp[x].size(), las = 0;
  for (int now : tmp[x])
    if (now ^ las) {
      Max(f1[now - 1], sz), Max(f1[now], sz - cnt[now] + 1), Max(f2[now], sz);
      sz -= cnt[now], las = now;
    }
  for (int now : tmp[x]) cnt[now]--;
}
int maxson[N];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0), cout.tie(0);
  cin >> n;
  for (int i = 1, iE = n; i <= iE; i++) f1[i] = f2[i] = 1, maxson[i] = -1e9;
  for (int i = 1, iE = n - 1; i <= iE; i++) {
    int u, v;
    cin >> u >> v, deg[u]++, deg[v]++, e[u].push_back(v), e[v].push_back(u);
  }
  dfs1(1), dfs2(1);
  for (int i = 1, iE = n; i <= iE; i++) Max(f1[0], deg[i] + 1), work(i);
  for (int i = 1, iE = n; i <= iE; i++)
    for (int t : tmp[i]) G[t].push_back(i);
  int las = 0;
  for (int i = n, iE = 1; i >= iE; i--) {
    for (int t : G[i]) {
      int tmp = (glen[t] >= i) + (mxd[t] + 1 >= i);
      sum[t]++, Max(maxson[Fa[t]], sum[t] - tmp);
      Max(f2[i], sum[t] + maxson[t]), Max(f2[i], sum[t] + sum[Fa[t]] - tmp),
          Max(f2[i], sum[t]), Max(f1[i - 1], sum[t]);
      if (las != t) Max(f1[i], sum[t]);
      las = t;
    }
  }
  for (int i = n, iE = 1; i >= iE; i--)
    Max(f1[i - 1], f1[i]), Max(f2[i - 1], f2[i]);
  for (int i = 1, iE = n; i <= iE; i++)
    if (i % 2)
      cout << f1[i / 2] << " ";
    else
      cout << f2[i / 2] << " ";
  cout << endl;
  return 0;
}
