#include <bits/stdc++.h>
using namespace std;
vector<int> ad[100001];
int fre[100001] = {0}, m[100001] = {0}, m1[100001] = {0};
bool v[100001] = {0}, v1[100001] = {0};
int id, mx = 0;
void dfs(int no, int dep) {
  v[no] = 1;
  int te = 0, ma = 0;
  if (dep > mx) {
    mx = dep;
    id = no;
  }
  for (int i = 0; i < ad[no].size(); i++) {
    if (v[ad[no][i]] == 0) {
      dfs(ad[no][i], dep + 1);
    }
  }
}
int dfs2(int no) {
  v1[no] = 1;
  int te = 0, ma = 0;
  for (int i = 0; i < ad[no].size(); i++) {
    if (v1[ad[no][i]] == 0) {
      te = dfs2(ad[no][i]);
      if (te > ma) {
        ma = te;
        m[no] = ad[no][i];
      }
    }
  }
  return ma + 1;
}
int dfs1(int no, bool bo) {
  v1[no] = 1;
  int te = 0, ma = 0;
  for (int i = 0; i < ad[no].size(); i++) {
    if (v1[ad[no][i]] == 0) {
      if (m[no] == ad[no][i]) {
        te = dfs1(ad[no][i], 0);
      } else {
        te = dfs1(ad[no][i], 1);
      }
      if (te > ma) {
        ma = te;
      }
    }
  }
  if (bo == 1) {
    fre[ma + 1]++;
  }
  return ma + 1;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  int t1, t2;
  for (int i = 0; i < n - 1; i++) {
    cin >> t1 >> t2;
    ad[t1].push_back(t2);
    ad[t2].push_back(t1);
  }
  dfs(1, 0);
  dfs2(id);
  for (int i = 0; i < 100001; i++) {
    v1[i] = 0;
  }
  dfs1(id, 1);
  int re = 1;
  int su = 0;
  cout << 1 << " ";
  for (int i = 100000; i >= 1; i--) {
    while (fre[i] > 0 && su + i <= n) {
      re++;
      fre[i]--;
      su += i;
      cout << su << " ";
    }
  }
  while (re < n) {
    re++;
    cout << n << " ";
  }
  cout << "\n";
  return 0;
}
