#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 10;
const int inf = 1e9;
int gi() {
  int x = 0, o = 1;
  char ch = getchar();
  while (!isdigit(ch) && ch != '-') ch = getchar();
  if (ch == '-') o = -1, ch = getchar();
  while (isdigit(ch)) x = x * 10 + ch - '0', ch = getchar();
  return x * o;
}
bool chkmax(int &a, int b) { return a < b ? a = b, 1 : 0; }
struct dat {
  int mx1, mx2;
  void insert(int v) {
    if (mx1 < v)
      mx2 = mx1, mx1 = v;
    else
      mx2 = max(mx2, v);
  }
} p[N];
int n, fa[N], f[N], g[N], ans[N];
vector<int> E[N];
vector<pair<int, int> > vec[N];
void dfs1(int u, int ff) {
  fa[u] = ff;
  p[u] = (dat){0, -inf};
  for (auto v : E[u])
    if (v ^ ff) dfs1(v, u), p[u].insert(f[v] + 1);
  f[u] = p[u].mx1;
}
void dfs2(int u) {
  for (auto v : E[u])
    if (v ^ fa[u])
      g[v] = max(p[u].mx1 == f[v] + 1 ? p[u].mx2 : p[u].mx1, g[u] + 1), dfs2(v);
}
int main() {
  cin >> n;
  for (int i = 1, u, v; i < n; i++)
    u = gi(), v = gi(), E[u].push_back(v), E[v].push_back(u);
  dfs1(1, 0);
  g[1] = -inf;
  dfs2(1);
  for (int i = 1; i <= n; i++) ans[i] = 1;
  for (int i = 1; i <= n; i++) {
    map<int, int> cnt;
    for (auto j : E[i])
      if (j == fa[i])
        ++cnt[g[i] + 1];
      else
        ++cnt[f[j] + 1];
    for (auto x : cnt) vec[i].push_back(x);
    reverse(vec[i].begin(), vec[i].end());
    int sum = 0;
    for (auto x : vec[i])
      chkmax(ans[2 * x.first + 1], sum + 1), sum += x.second,
          chkmax(ans[2 * x.first], sum), chkmax(ans[2 * x.first - 1], sum);
  }
  for (int i = 2; i <= n; i++) {
    int p = 0, q = 0, sum = 0;
    auto &A = vec[i], &B = vec[fa[i]];
    while (p < int(A.size()) || q < int(B.size())) {
      if (p < int(A.size()) && (q == int(B.size()) || A[p].first > B[q].first))
        sum += A[p].second, chkmax(ans[2 * A[p].first], sum - 2), ++p;
      else
        sum += B[q].second, chkmax(ans[2 * B[q].first], sum - 2), ++q;
    }
  }
  for (int i = n - 2; i > 1; i--) chkmax(ans[i], ans[i + 2]);
  ans[1] = 0;
  for (int i = 1; i <= n; i++) chkmax(ans[1], int(E[i].size()) + 1);
  for (int i = 1; i <= n; i++) cout << ans[i] << ' ';
  return 0;
}
