#include <bits/stdc++.h>
using namespace std;
using uint = unsigned int;
using ll = long long;
using ld = long double;
using ull = unsigned long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << H;
  debug_out(T...);
}
template <typename T1, typename T2>
ostream &operator<<(ostream &out, const pair<T1, T2> &item) {
  out << '(' << item.first << ", " << item.second << ')';
  return out;
}
template <typename T>
ostream &operator<<(ostream &out, const vector<T> &v) {
  for (const auto &item : v) out << item << ' ';
  return out;
}
const int N = 500010;
int oddAns[N], evenAns[N];
int fth[N], depth[N], depth2[N], depthUp[N];
vector<int> adj[N];
vector<pii> cnt[N];
void update(int v, int d) {
  if (d > depth[v])
    depth2[v] = depth[v], depth[v] = d;
  else
    depth2[v] = max(depth2[v], d);
}
void dfs(int v, int p = -1) {
  for (auto u : adj[v]) {
    if (u == p) continue;
    fth[u] = v;
    dfs(u, v);
    update(v, 1 + depth[u]);
  }
}
void dfsUp(int v, int p = -1) {
  for (auto u : adj[v]) {
    if (u == p) continue;
    depthUp[u] =
        1 + max(depthUp[v], (depth[v] == 1 + depth[u] ? depth2[v] : depth[v]));
    dfsUp(u, v);
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  int n, a, b;
  cin >> n;
  for (int i = 1; i < n; ++i) {
    cin >> a >> b;
    adj[a].push_back(b);
    adj[b].push_back(a);
  }
  dfs(1);
  dfsUp(1);
  for (int i = 1; i <= n; ++i) {
    for (auto j : adj[i])
      if (j == fth[i])
        cnt[i].push_back({depthUp[i], 1});
      else
        cnt[i].push_back({1 + depth[j], 1});
    sort(cnt[i].rbegin(), cnt[i].rend());
    int j, k;
    for (k = 0, j = 1; j < cnt[i].size(); ++j)
      if (cnt[i][k].first == cnt[i][j].first)
        ++cnt[i][k].second;
      else
        cnt[i][++k] = cnt[i][j];
    cnt[i].erase(cnt[i].begin() + k + 1, cnt[i].end());
  }
  for (int i = 1; i <= n; ++i) {
    int s = 0;
    for (int j = 0; j < cnt[i].size(); ++j) {
      s += cnt[i][j].second;
      if (s > 1)
        oddAns[2 * cnt[i][j].first - 1] =
            max(oddAns[2 * cnt[i][j].first - 1], s);
      if (j + 1 < cnt[i].size())
        oddAns[2 * cnt[i][j + 1].first + 1] =
            max(oddAns[2 * cnt[i][j + 1].first + 1], s + 1);
      if (s > 1)
        evenAns[2 * cnt[i][j].first] = max(evenAns[2 * cnt[i][j].first], s);
    }
  }
  for (int i = 2; i <= n; ++i) {
    int s1 = 0, s2 = 0, f = fth[i], val;
    for (int j = 0, k = 0; j < cnt[i].size() || k < cnt[f].size();) {
      if (j == cnt[i].size() ||
          (k < cnt[f].size() && cnt[i][j].first < cnt[f][k].first))
        s2 += cnt[f][k].second, val = cnt[f][k].first, ++k;
      else
        s1 += cnt[i][j].second, val = cnt[i][j].first, ++j;
      if (s1 && s2) evenAns[2 * val] = max(evenAns[2 * val], s1 + s2 - 2);
    }
  }
  oddAns[n + 1] = evenAns[n + 1] = 1;
  for (int i = n; i >= 1; --i) oddAns[i] = max(oddAns[i], oddAns[i + 1]);
  for (int i = n; i >= 1; --i) evenAns[i] = max(evenAns[i], evenAns[i + 1]);
  for (int i = 1; i <= n; ++i)
    oddAns[1] = max(oddAns[1], 1 + (int)adj[i].size());
  for (int i = 1; i <= n; ++i) cout << (i % 2 ? oddAns[i] : evenAns[i]) << ' ';
  cout << '\n';
  return 0;
}
