#include <bits/stdc++.h>
using namespace std;
bool less_vectors(const vector<long long>& a, const vector<long long>& b) {
  return a.size() < b.size();
}
struct Comparator {
  bool operator()(const std::pair<long long, long long>& lhs,
                  const std::pair<long long, long long>& rhs) const {
    if (lhs.first != rhs.first)
      return lhs.first < rhs.first;
    else
      return lhs.second < rhs.second;
  }
};
long long maxlev = 0;
vector<vector<long long> > g(200000);
vector<long long> ans;
long long root;
long long dfs0(long long s, long long p, long long lev) {
  if (lev > maxlev) {
    maxlev = lev;
    root = s;
  }
  for (auto it : g[s]) {
    if (it != p) {
      dfs0(it, s, lev + 1);
    }
  }
  return 0;
}
long long dfs(long long s, long long p) {
  vector<long long> v;
  for (auto it : g[s]) {
    if (it != p) v.push_back(dfs(it, s));
  }
  sort(v.begin(), v.end());
  if (v.size() > 0) {
    for (long long i = 0; i < v.size() - 1; i++) {
      ans.push_back(v[i]);
    }
  }
  if (v.size() > 0)
    return 1 + v[v.size() - 1];
  else
    return 1;
}
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long n;
  cin >> n;
  for (long long i = 0; i < n - 1; i++) {
    long long u, v;
    cin >> u >> v;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  if (n == 1) {
    cout << 1;
    return 0;
  }
  dfs0(1, 1, 1);
  ans.push_back(dfs(root, root) - 1);
  cout << 1 << " ";
  sort(ans.rbegin(), ans.rend());
  long long cur = 1;
  for (long long i = 0; i < ans.size(); i++) {
    cur += ans[i];
    cout << cur << " ";
  }
  for (long long i = ans.size(); i < n - 1; i++) cout << cur << " ";
  return 0;
}
