#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 5;
int n;
vector<vector<int>> AdjList(MAXN);
vector<int> dist;
bitset<MAXN> vis;
vector<int> tdepth;
vector<int> parent;
struct node {
  int depth;
  int u;
};
inline bool operator<(const node& lhs, const node& rhs) {
  return lhs.depth > rhs.depth;
}
vector<node> pq;
int bfs(int source) {
  queue<int> q;
  vis.reset();
  dist.assign(MAXN, 1e9);
  dist[source] = 0;
  q.push(source);
  vis[source] = true;
  int maxDist = 0, res;
  while (!q.empty()) {
    int u = q.front();
    q.pop();
    for (int& v : AdjList[u]) {
      if (!vis[v]) {
        q.push(v);
        vis[v] = true;
        dist[v] = dist[u] + 1;
        if (dist[v] > maxDist) {
          maxDist = dist[v];
          res = v;
        }
      }
    }
  }
  return res;
}
void dfs(int u) {
  vis[u] = true;
  for (int& v : AdjList[u]) {
    if (!vis[v]) {
      dfs(v);
      if (tdepth[v] + 1 > tdepth[u]) {
        tdepth[u] = tdepth[v] + 1;
        parent[u] = v;
      }
    }
  }
  return;
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n - 1; i++) {
    int u, v;
    scanf("%d %d", &u, &v);
    AdjList[u].push_back(v);
    AdjList[v].push_back(u);
  }
  printf("1 ");
  int v = bfs(1);
  tdepth.assign(MAXN, 0);
  parent.assign(MAXN, -1);
  for (int i = 0; i < MAXN; i++) parent[i] = i;
  vis.reset();
  dfs(v);
  for (int i = 1; i <= n; i++) {
    if (i != v) {
      pq.push_back({tdepth[i], i});
    }
  }
  sort(pq.begin(), pq.end());
  bitset<MAXN> flag;
  flag[v] = true;
  int idx = 0;
  int ans = 1;
  for (int i = 0; i < n - 1; i++) {
    while (idx < n - 1 && flag[pq[idx].u]) idx++;
    if (idx < n - 1) {
      ans += pq[idx].depth + 1;
      int cur = pq[idx].u;
      while (true) {
        flag[cur] = true;
        if (parent[cur] == cur) break;
        cur = parent[cur];
      }
    }
    printf("%d ", ans);
  }
  printf("\n");
  return 0;
}
