#include <bits/stdc++.h>
using namespace std;
vector<long long> g[100005], ans;
int maxd = 0, rt = 1;
void findroot(int node, int p, int d) {
  if (d > maxd) maxd = d, rt = node;
  for (long long i = 0; i < (long long)g[node].size(); ++i)
    if (g[node][i] != p) findroot(g[node][i], node, d + 1);
}
int dfs(int node, int p) {
  vector<long long> v;
  for (long long i = 0; i < (long long)g[node].size(); ++i)
    if (g[node][i] != p) v.push_back(dfs(g[node][i], node));
  sort(v.begin(), v.end());
  if ((long long)v.size() > 0)
    for (long long i = 0; i < (long long)v.size() - 1; ++i) ans.push_back(v[i]);
  if ((long long)v.size() > 0)
    return v[(long long)v.size() - 1] + 1;
  else
    return 1;
}
int main() {
  int n;
  cin >> n;
  for (long long i = 0; i < n - 1; ++i) {
    int u, v;
    cin >> u >> v;
    g[u].push_back(v), g[v].push_back(u);
  }
  findroot(1, 1, 1);
  ans.push_back(dfs(rt, rt) - 1);
  cout << "1 ";
  sort(ans.rbegin(), ans.rend());
  int t = 1;
  for (long long i = 0; i < (long long)ans.size(); ++i) {
    t += ans[i];
    cout << t << " ";
  }
  for (long long i = (long long)ans.size(); i < n - 1; ++i) cout << t << " ";
  return 0;
}
