#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 7;
const int oo = 2e5 + 7;
vector<int> adj[N];
bool mk[N];
int dst[N], pp[N];
queue<int> q;
priority_queue<pair<int, int>> leaf;
priority_queue<int> ans;
inline void addEdge(int u, int v) {
  adj[u].emplace_back(v);
  adj[v].emplace_back(u);
}
pair<int, int> dfs(int u, int p = -1) {
  pair<int, int> ans = {1, u};
  for (int v : adj[u])
    if (v != p) {
      pair<int, int> cur = dfs(v, u);
      ++cur.first;
      if (ans < cur) ans = cur;
    }
  return ans;
}
inline void insert(int u) {
  q.push(u);
  dst[u] = 0;
  mk[u] = true;
}
void go(int u, int ed, int p = -1) {
  if (u == ed) {
    insert(u);
    return;
  }
  for (int v : adj[u])
    if (v != p) {
      go(v, ed, u);
      if (mk[v]) {
        insert(u);
        break;
      }
    }
}
inline int recalc(int u) {
  if (mk[u]) return 0;
  mk[u] = 1;
  return 1 + recalc(pp[u]);
}
int main() {
  int n;
  scanf("%d", &n);
  printf("1");
  if (n == 1) {
    printf("\n");
    return 0;
  }
  for (int i = 1; i < n; ++i) {
    int u, v;
    scanf("%d%d", &u, &v);
    addEdge(u, v);
    dst[i] = oo;
  }
  dst[n] = oo;
  int x0 = dfs(1).second;
  int x1, d;
  tie(d, x1) = dfs(x0);
  go(x0, x1);
  while (!q.empty()) {
    int u = q.front();
    q.pop();
    for (int v : adj[u])
      if (dst[u] + 1 < dst[v]) {
        dst[v] = dst[u] + 1;
        pp[v] = u;
        q.push(v);
      }
  }
  for (int u = 1; u <= n; ++u)
    if (adj[u].size() == 1 && dst[u]) leaf.emplace(dst[u], u);
  while (!leaf.empty()) {
    int u = leaf.top().second;
    leaf.pop();
    ans.push(recalc(u));
  }
  int acc = d, cur = 2;
  printf(" %d", acc);
  while (!ans.empty()) {
    ++cur;
    acc += ans.top();
    ans.pop();
    printf(" %d", acc);
  }
  while (++cur <= n) printf(" %d", acc);
  printf("\n");
  return 0;
}
