#include <bits/stdc++.h>
using namespace std;
const int N_MAX = 5e5, magic = 0;
int n, down[N_MAX - 1], up[N_MAX - 1], sol[N_MAX + 1];
bool seen[N_MAX];
pair<int, int> E[N_MAX - 1];
vector<int> G[N_MAX];
int DFS1(int u) {
  int ans = 0;
  seen[u] = true;
  for (int e : G[u]) {
    if (seen[E[e].first] && seen[E[e].second]) continue;
    if (E[e].second == u) swap(E[e].first, E[e].second);
    down[e] = DFS1(E[e].second) + 1;
    ans = max(ans, down[e]);
  }
  return ans;
}
void DFS2(int u) {
  int e1 = -1, e2 = -1, upp = 1;
  for (int e : G[u]) {
    if (E[e].second == u) {
      upp = up[e] + 1;
      continue;
    }
    if (e1 == -1)
      e1 = e;
    else if (down[e] > down[e1]) {
      e2 = e1;
      e1 = e;
    } else if (e2 == -1 || down[e] > down[e2]) {
      e2 = e;
    }
  }
  for (int e : G[u]) {
    if (E[e].second == u) continue;
    up[e] = upp;
    if (e != e1 && down[e1] + 1 > up[e]) up[e] = down[e1] + 1;
    if (e == e1 && e2 != -1 && down[e2] + 1 > up[e]) up[e] = down[e2] + 1;
    DFS2(E[e].second);
  }
}
vector<int> s;
void solve_odd() {
  for (int v = 0; v < n; v++) {
    s.clear();
    for (int e : G[v]) {
      if (E[e].first == v)
        s.push_back(down[e]);
      else
        s.push_back(up[e]);
    }
    sort(s.begin(), s.end(), greater<int>());
    for (int i = 1; i < s.size(); i++) {
      int l = (s[i - 1] > s[i] ? s[i] + 1 : s[i]);
      sol[2 * l - 1] = max(sol[2 * l - 1], i + 1);
      sol[2 * s[i]] = max(sol[2 * s[i]], i + 1);
    }
  }
  sol[1] = 0;
  for (int v = 0; v < n; v++) sol[1] = max(sol[1], (int)G[v].size() + 1);
  for (int k = (n % 2 ? n - 2 : n - 3); 0 < k; k -= 2)
    sol[k] = max(sol[k], sol[k + 2]);
}
int ok[N_MAX];
void solve(int k) {
  k /= 2;
  for (int v = 0; v < n; v++) {
    ok[v] = 0;
    for (int e : G[v]) {
      int x = (E[e].first == v ? down[e] : up[e]);
      if (x >= k) ok[v]++;
    }
  }
  for (int e = 0; e < n - 1; e++) {
    if (ok[E[e].first] > 1 && ok[E[e].second] > 1)
      sol[2 * k] = max(sol[2 * k], ok[E[e].first] + ok[E[e].second] - 2);
  }
}
vector<pair<int, int>> b[N_MAX];
void solve_big_even() {
  for (int v = 0; v < n; v++) {
    for (int e : G[v]) {
      int x = (E[e].first == v ? down[e] : up[e]);
      if (x >= magic) b[v].push_back({x, e});
    }
    sort(b[v].begin(), b[v].end(), greater<pair<int, int>>());
  }
  for (int e = 0; e < n - 1; e++) {
    if (b[E[e].first].size() < 2 || b[E[e].second].size() < 2) continue;
    s.clear();
    int u = E[e].first, v = E[e].second;
    int i1 = (b[u][0].second == e ? 1 : 0);
    int i2 = (b[v][0].second == e ? 1 : 0);
    while (i1 < b[u].size() || i2 < b[v].size()) {
      if (i2 == b[v].size() ||
          (i1 < b[u].size() && b[u][i1].first > b[v][i2].first)) {
        s.push_back(b[u][i1].first);
        i1++;
        if (i1 < b[u].size() && b[u][i1].second == e) i1++;
      } else {
        s.push_back(b[v][i2].first);
        i2++;
        if (i2 < b[v].size() && b[v][i2].second == e) i2++;
      }
    }
    for (int i = 1; i < s.size(); i++)
      sol[2 * s[i]] = max(sol[2 * s[i]], i + 1);
  }
  for (int k = (n % 2 ? n - 3 : n - 2); 2 * magic <= k; k -= 2)
    sol[k] = max(sol[k], sol[k + 2]);
}
int main() {
  cin >> n;
  for (int i = 0; i < n - 1; i++) {
    int u, v;
    cin >> u >> v;
    u--;
    v--;
    E[i] = {u, v};
    G[u].push_back(i);
    G[v].push_back(i);
  }
  DFS1(0);
  DFS2(0);
  for (int k = 1; k <= n; k++) sol[k] = 1;
  solve_odd();
  for (int k = 2; k < 2 * magic; k += 2) solve(k);
  solve_big_even();
  for (int k = 1; k <= n; k++) cout << sol[k] << " ";
  cout << endl;
  return 0;
}
