#include <bits/stdc++.h>
using namespace std;
template <typename T>
void maxtt(T& t1, T t2) {
  t1 = max(t1, t2);
}
template <typename T>
void mintt(T& t1, T t2) {
  t1 = min(t1, t2);
}
bool debug = 0;
int n, m, k;
string direc = "URDL";
const long long MOD2 = (long long)998244353 * (long long)998244353;
long long ln, lk, lm;
void etp(bool f = 0) {
  puts(f ? "YES" : "NO");
  exit(0);
}
void addmod(int& x, int y, int mod = 998244353) {
  x += y;
  if (x >= mod) x -= mod;
  if (x < 0) x += mod;
  assert(x >= 0 && x < mod);
}
void et(int x = -1) {
  printf("%d\n", x);
  exit(0);
}
long long fastPow(long long x, long long y, int mod = 998244353) {
  long long ans = 1;
  while (y > 0) {
    if (y & 1) ans = (x * ans) % mod;
    x = x * x % mod;
    y >>= 1;
  }
  return ans;
}
long long gcd1(long long x, long long y) { return y ? gcd1(y, x % y) : x; }
vector<int> mp[500135], V[500135];
int ans[500135], fa[500135], dp[500135];
void dfs(int x, int pa) {
  fa[x] = pa;
  dp[x] = 1;
  for (int c : mp[x])
    if (c != pa) {
      dfs(c, x);
      maxtt(dp[x], dp[c] + 1);
    }
}
void dfs2(int x, int pa, int mxD) {
  V[mxD].push_back(x);
  int m1 = mxD, m2 = mxD;
  for (int c : mp[x])
    if (c != pa) {
      V[dp[c]].push_back(x);
      if (dp[c] > m1) {
        m2 = m1;
        m1 = dp[c];
      } else if (dp[c] > m2)
        m2 = dp[c];
    }
  for (int c : mp[x])
    if (c != pa) {
      if (dp[c] == m1)
        dfs2(c, x, m2 + 1);
      else
        dfs2(c, x, m1 + 1);
    }
}
int cc[500135], lt[500135], ms[500135];
void up(int len, int cc) {
  if (len > 1) maxtt(ans[len], cc);
}
void fmain(int tid) {
  scanf("%d", &n);
  for (int i = 0, u, v; i < n - 1; i++) {
    scanf("%d%d", &u, &v);
    mp[u].push_back(v);
    mp[v].push_back(u);
  };
  for (int(i) = 1; (i) <= (int)(n); (i)++) ans[i] = 1;
  for (int(i) = 1; (i) <= (int)(n); (i)++) maxtt(ans[1], (int)mp[i].size() + 1);
  dfs(1, 0);
  dfs2(1, 0, 0);
  for (int i = n; i >= 1; i--)
    for (auto v : V[i]) {
      ++cc[v];
      up(2 * min(i, lt[v] - 1) + 1, cc[v]);
      lt[v] = i;
      up(2 * i, cc[v]);
      up(2 * i, cc[v] + max(ms[v], cc[fa[v]]) - 2);
      maxtt(ms[fa[v]], cc[v]);
    }
  for (int i = n - 2; i >= 2; i--) maxtt(ans[i], ans[i + 2]);
  for (int(i) = 1; (i) <= (int)(n); (i)++) printf("%d ", ans[i]);
}
int main() {
  int t = 1;
  for (int(i) = 1; (i) <= (int)(t); (i)++) {
    fmain(i);
  }
  return 0;
}
