#include <bits/stdc++.h>
using namespace std;
int n, m, tot;
int now[100005], pre[100005 * 2], son[100005 * 2];
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  for (; ch < '0' || ch > '9'; ch = getchar())
    if (ch == '-') f = -1;
  for (; ch >= '0' && ch <= '9'; ch = getchar()) x = x * 10 + ch - '0';
  return x * f;
}
void add(int a, int b) { son[++tot] = b, pre[tot] = now[a], now[a] = tot; }
void link(int a, int b) { add(a, b), add(b, a); }
pair<int, int> dfs(int x, int fa) {
  pair<int, int> ret(0, x);
  for (int p = now[x]; p; p = pre[p])
    if (son[p] != fa) {
      pair<int, int> res = dfs(son[p], x);
      ++res.first;
      ret = max(ret, res);
    }
  return ret;
}
vector<int> path;
bool find_path(int x, int des, int fa) {
  if (x == des) return path.push_back(x), 1;
  for (int p = now[x]; p; p = pre[p])
    if (son[p] != fa) {
      if (find_path(son[p], des, x)) return path.push_back(x), 1;
    }
  return 0;
}
int mx_dep[100005], heavy[100005];
bool vis[100005];
void solve(int x, int fa) {
  for (int p = now[x]; p; p = pre[p])
    if (son[p] != fa && !vis[son[p]]) {
      solve(son[p], x);
      if (mx_dep[son[p]] > mx_dep[heavy[x]]) heavy[x] = son[p];
    }
  mx_dep[x] = mx_dep[heavy[x]] + 1;
}
struct my_priority_queue {
  pair<int, int> a[100005];
  int cnt;
  pair<int, int> top() { return a[1]; }
  void push(pair<int, int> x) { a[++cnt] = x, push_heap(a + 1, a + cnt + 1); }
  void pop() { pop_heap(a + 1, a + cnt + 1), --cnt; }
  bool empty() { return !cnt; }
} heap;
int main() {
  n = read();
  if (n == 1) {
    puts("1");
    return 0;
  }
  for (int i = 1, x, y; i < n; i++) x = read(), y = read(), link(x, y);
  pair<int, int> l = dfs(1, 0), r = dfs(l.second, 0);
  find_path(l.second, r.second, 0);
  int res = path.size();
  printf("%d %d ", 1, res);
  int num = 2;
  for (int i = 0; i < res; i++) vis[path[i]] = 1;
  for (int i = 0; i < res; i++) solve(path[i], 0);
  for (int i = 0; i < res; i++)
    for (int p = now[path[i]]; p; p = pre[p])
      if (!vis[son[p]]) heap.push(make_pair(mx_dep[son[p]], son[p]));
  while (!heap.empty()) {
    pair<int, int> pp = heap.top();
    heap.pop();
    res += pp.first;
    printf("%d ", res), ++num;
    int x = pp.second;
    while (x) {
      vis[x] = 1;
      for (int p = now[x]; p; p = pre[p])
        if (son[p] != heavy[x] && !vis[son[p]])
          heap.push(make_pair(mx_dep[son[p]], son[p]));
      x = heavy[x];
    }
  }
  for (int i = num + 1; i <= n; i++) printf("%d ", n);
  puts("");
  return 0;
}
