#include <bits/stdc++.h>
using namespace std;
vector<int> edge[100010], ans;
int n, father[100010], depth[100010];
bool vis[100010];
priority_queue<pair<int, int> > pq;
void dfs(int u) {
  bool flag = false;
  for (auto &v : edge[u]) {
    if (vis[v] || father[u] == v) continue;
    father[v] = u;
    depth[v] = depth[u] + 1;
    flag = true;
    dfs(v);
  }
  if (!flag && !vis[u]) pq.push(make_pair(depth[u], u));
}
int main() {
  int x, y;
  scanf("%d", &n);
  for (int i = 1; i < n; ++i) {
    scanf("%d%d", &x, &y);
    edge[x].push_back(y);
    edge[y].push_back(x);
  }
  if (n == 1)
    puts("1");
  else {
    ans.push_back(1);
    dfs(1);
    int u = pq.top().second, d = pq.top().first;
    while (!pq.empty()) pq.pop();
    vis[u] = true;
    father[u] = 0;
    depth[u] = 0;
    dfs(u);
    while (!pq.empty()) {
      u = pq.top().second;
      d = pq.top().first;
      pq.pop();
      if (vis[u] || depth[u] != d) continue;
      ans.push_back(ans.back() + depth[u]);
      while (!vis[u]) {
        vis[u] = true;
        depth[u] = 0;
        dfs(u);
        u = father[u];
      }
    }
    while (ans.size() < n) ans.push_back(ans.back());
    for (auto &i : ans) printf("%d ", i);
  }
  return 0;
}
