#include <bits/stdc++.h>
using namespace std;
const int maxn = 5e5 + 79;
class maxi_decrease {
 public:
  vector<int> v;
  void insert(int val) {
    if (val < 0) return;
    if (v.size() <= val) v.resize(val + 1, 0);
    v[val]++;
  }
  void decrease(int val) {
    if (val < 0) return;
    v[val]--;
    if (val > 0) v[val - 1]++;
    if (v.back() == 0) v.pop_back();
  }
  int get_max() { return v.size() - 1; }
};
vector<vector<int> > g(maxn);
vector<int> dp(maxn, 0), p(maxn, -1), que_dec, que_odd, que_nxt, extra(maxn, 0);
maxi_decrease odd, even, alldp;
vector<maxi_decrease> my(maxn);
void dfs(int v) {
  for (int i : g[v]) {
    if (p[v] == i) continue;
    p[i] = v;
    dfs(i);
  }
}
void decrease_extra(int v) {
  if (extra[v])
    odd.decrease(dp[v] + 1);
  else {
    extra[v] = true;
    que_odd.push_back(v);
  }
}
void decrease_dp_val(int v) {
  if (p[v] != -1) {
    int cur_val = my[p[v]].get_max() + dp[p[v]] - 2;
    my[p[v]].decrease(dp[v]);
    if (cur_val > my[p[v]].get_max() + dp[p[v]] - 2) even.decrease(cur_val);
  }
  decrease_extra(v);
  alldp.decrease(dp[v]);
  even.decrease(dp[v] + my[v].get_max() - 2);
  dp[v]--;
  if (dp[v] == 1)
    for (int i : g[v]) que_nxt.push_back(i);
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  for (int i = 0, u, v; i < n - 1; i++) {
    cin >> u >> v;
    g[--u].push_back(--v);
    g[v].push_back(u);
  }
  dfs(0);
  for (int i = 0; i < n; i++) {
    dp[i] = g[i].size();
    if (p[i] != -1) my[p[i]].insert(dp[i]);
    if (dp[i] == 1)
      for (int j : g[i]) que_dec.push_back(j);
    odd.insert(dp[i] + 1);
    alldp.insert(dp[i]);
    decrease_extra(i);
  }
  for (int i = 0; i < n; i++) even.insert(dp[i] + my[i].get_max() - 2);
  vector<int> ans(n + 2, 1);
  for (int i = 0; i * 2 + 1 <= n; i++) {
    ans[i * 2 + 1] = max({1, odd.get_max(), alldp.get_max()});
    ans[i * 2 + 2] = max({1, even.get_max(), alldp.get_max()});
    que_nxt.clear();
    for (int v : que_odd) {
      extra[v] = false;
      odd.decrease(dp[v] + 1);
    }
    que_odd.clear();
    for (int v : que_dec) decrease_dp_val(v);
    que_dec = que_nxt;
  }
  for (int i = 1; i <= n; i++) cout << ans[i] << " ";
  cout << "\n";
  return 0;
}
