#include <bits/stdc++.h>
using namespace std;
const int maxn = 500500;
int n;
vector<int> g[maxn], p[maxn], q[maxn];
int pr[maxn];
int f[maxn], fu[maxn];
int D, L;
int c[maxn], cc[maxn];
int rs[maxn];
void pfs(int v, int par = -1) {
  pr[v] = par;
  for (int i = 0; i < g[v].size(); i++) {
    int u = g[v][i];
    if (u != par) {
      pfs(u, v);
      f[v] = max(f[v], f[u] + 1);
    } else {
      g[v][i] = g[v].back();
      g[v].pop_back();
      i--;
    }
  }
}
void qfs(int v) {
  int tmp = fu[v];
  for (int u : g[v]) {
    fu[u] = max(fu[u], tmp + 1);
    tmp = max(tmp, f[u] + 1);
  }
  reverse(g[v].begin(), g[v].end());
  tmp = fu[v];
  for (int u : g[v]) {
    fu[u] = max(fu[u], tmp + 1);
    tmp = max(tmp, f[u] + 1);
    qfs(u);
  }
}
int ask(int k) {
  if (k == 1) return D + 1;
  int ret = 1;
  if (L >= k) ret = 2;
  if (k % 2) return max(ret, c[k / 2 + 1]);
  return max(ret, max(c[k / 2], cc[k / 2]));
}
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  for (int i = 0; i < n - 1; i++) {
    int v, u;
    cin >> v >> u;
    v--, u--;
    g[v].push_back(u);
    g[u].push_back(v);
  }
  for (int i = 0; i < n; i++) D = max(D, int(g[i].size()));
  pfs(0);
  qfs(0);
  for (int v = 0; v < n; v++) {
    for (int u : g[v]) p[v].push_back(f[u] + 1);
    q[v] = p[v];
    p[v].push_back(0);
    sort(p[v].begin(), p[v].end());
    q[v].push_back(fu[v]);
    sort(q[v].begin(), q[v].end());
    if (q[v].size() > 1)
      L = max(L, q[v][0] + q[v][1]);
    else
      L = max(L, q[v][0]);
  }
  for (int v = 0; v < n; v++) {
    for (int i = 0; i < q[v].size(); i++) {
      int x = q[v][i];
      c[x] = max(c[x], int(q[v].size()) - i);
      if (x and i + 1 < q[v].size() and x < q[v][i + 1])
        rs[x * 2 + 1] = max(rs[x * 2 + 1], int(q[v].size()) - i);
    }
    if (!v) continue;
    int d = pr[v];
    int up = 0;
    if (q[d].size() > 2) up = q[d][q[d].size() - 2];
    for (int i = 1; i + 1 < p[v].size(); i++) {
      for (int l = p[v][i - 1] + 1; l <= p[v][i]; l++) {
        int zz = q[d].end() - lower_bound(q[d].begin(), q[d].end(), l);
        cc[l] = max(cc[l], int(zz + (p[v].size() - i) - 1));
      }
    }
  }
  for (int i = n; i >= 0; i--) {
    c[i] = max(c[i], c[i + 1]);
    cc[i] = max(cc[i], cc[i + 1]);
  }
  for (int i = 1; i <= n; i++) cout << max(rs[i], ask(i)) << " ";
  cout << endl;
  return 0;
}
