#include <bits/stdc++.h>
using namespace std;
int n;
const int N = 300000;
vector<int> bi[N];
int cnt[N], res[N], dep[N];
void dfs1(int t, int f) {
  for (int i = 0; i < bi[t].size(); ++i)
    if (bi[t][i] != f) {
      dep[bi[t][i]] = dep[t] + 1;
      dfs1(bi[t][i], t);
    }
}
int dfs2(int t, int f) {
  int w = 0;
  for (int i = 0; i < bi[t].size(); ++i)
    if (bi[t][i] != f) w = max(w, dfs2(bi[t][i], t));
  cnt[w]--, cnt[++w]++;
  return w;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i < n; ++i) {
    int a, b;
    scanf("%d%d", &a, &b);
    bi[a].push_back(b);
    bi[b].push_back(a);
  }
  dfs1(1, 0);
  int w = 0;
  cnt[0] = n;
  for (int i = 1; i <= n; ++i)
    if (dep[i] > dep[w]) w = i;
  dfs2(w, 0);
  res[1] = 1;
  for (int i = n, j = 1, w = 0; i >= 0; --i)
    while (cnt[i]--) res[++j] = (w += i);
  for (int i = 1; i <= n; ++i) printf("%d ", res[i]);
  puts("");
}
