#include <bits/stdc++.h>
using namespace std;
int n;
vector<int> e[100200];
bool used[100200];
bool marked[100200];
void clearused() {
  for (int i = 0; i <= n; ++i) used[i] = 0;
}
pair<int, int> deepest(int ind, int depth) {
  used[ind] = 1;
  pair<int, int> ans = {ind, depth};
  for (int x : e[ind]) {
    if (!used[x]) {
      auto cans = deepest(x, depth + 1);
      if (cans.second > ans.second) ans = cans;
    }
  }
  return ans;
}
void copy0(int ind) {
  for (int x : e[ind]) {
    e[0].push_back(x);
  }
}
bool mark(int curr, int target) {
  used[curr] = 1;
  if (curr == target) {
    marked[curr] = 1;
    copy0(curr);
    return 1;
  }
  for (int x : e[curr]) {
    if (!used[x]) {
      if (mark(x, target)) {
        marked[curr] = 1;
        copy0(curr);
        return 1;
      }
    }
  }
  return 0;
}
vector<int> d;
int f(int ind, int depth) {
  used[ind] = 1;
  if (e[ind].size() == 1) return depth;
  int bd = -1;
  for (int x : e[ind]) {
    if (!used[x] && !marked[x]) {
      int cd = f(x, depth + 1);
      if (bd == -1)
        bd = cd;
      else {
        if (cd > bd) swap(bd, cd);
        d.push_back(cd - depth);
      }
    }
  }
  return bd;
}
int ans[100200];
int main() {
  cin >> n;
  for (int i = 1; i < n; ++i) {
    int a, b;
    cin >> a >> b;
    e[a].push_back(b);
    e[b].push_back(a);
  }
  auto d1 = deepest(1, 0);
  clearused();
  auto d2 = deepest(d1.first, 0);
  ans[0] = 1;
  ans[1] = d2.second + 1;
  clearused();
  mark(d1.first, d2.first);
  clearused();
  int cd = f(0, 0);
  if (cd != -1) {
    d.push_back(cd);
  }
  sort(d.begin(), d.end());
  for (int i = d.size() - 1; i >= 0; --i) {
    ans[1 + d.size() - i] = ans[d.size() - i] + d[i];
  }
  for (int i = 0; i < n; ++i) {
    if (i < d.size() + 2)
      cout << ans[i] << " ";
    else
      cout << ans[1 + d.size()] << " ";
  }
  cout << "\n";
  return 0;
}
