#include <bits/stdc++.h>
using namespace std;
void _dbg(string) { cerr << endl; }
template <class H, class... T>
void _dbg(string s, H h, T... t) {
  int l = s.find(',');
  cerr << s.substr(0, l) << " = " << h << ", ";
  _dbg(s.substr(l + 1), t...);
}
template <class T, class U>
ostream &operator<<(ostream &o, const pair<T, U> &p) {
  o << "(" << p.first << "," << p.second << ")";
  return o;
}
template <class T>
ostream &operator<<(ostream &o, const vector<T> &v) {
  o << "[";
  for (T t : v) {
    o << t << ",";
  }
  o << "]";
  return o;
}
vector<int> g[100005];
vector<int> diameter(int n, vector<int> *vec) {
  if (n == 1) return {0};
  vector<int> dist(n);
  vector<int> pre(n);
  auto bfs = [&](int ini) {
    queue<pair<int, int>> q;
    q.push({ini, -1});
    dist[ini] = 0;
    int farthest = ini;
    while (q.size()) {
      auto p = q.front();
      q.pop();
      int v = p.first;
      int from = p.second;
      if (dist[farthest] < dist[v]) {
        farthest = v;
      }
      for (auto to : vec[v])
        if (to != from) {
          q.push({to, v});
          dist[to] = dist[v] + 1;
          pre[to] = v;
        }
    }
    return farthest;
  };
  int p = bfs(0);
  int q = bfs(p);
  int cur = q;
  vector<int> res;
  res.push_back(cur);
  while (cur != p) {
    cur = pre[cur];
    res.push_back(cur);
  }
  assert(res[0] == q && res.back() == p);
  return res;
}
bool used[100005];
int sz[100005];
int dsz[100005];
int par[100005];
void dfs(int v, int from) {
  par[v] = from;
  dsz[v] = 1;
  for (auto to : g[v])
    if (to != from) {
      dfs(to, v);
      dsz[v] = max(dsz[v], dsz[to] + 1);
    }
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = (int)(0); i < (int)(n - 1); i++) {
    int a, b;
    scanf("%d %d", &a, &b);
    a--;
    b--;
    g[a].push_back(b);
    g[b].push_back(a);
  }
  if (n == 1) {
    cout << 1 << endl;
    return 0;
  }
  if (n == 2) {
    cout << "1 2" << endl;
    return 0;
  }
  vector<int> ans;
  ans.push_back(1);
  auto dia = diameter(n, g);
  ans.push_back(dia.size());
  for (auto x : dia) used[x] = true;
  dfs(dia[0], -1);
  priority_queue<pair<int, int>> pq;
  for (auto x : dia) {
    for (auto to : g[x])
      if (!used[to]) pq.push({dsz[to], to});
  }
  int cur = dia.size();
  while (!pq.empty()) {
    auto p = pq.top();
    pq.pop();
    cur += p.first;
    ans.push_back(cur);
    int d = p.second;
    used[d] = true;
    while (d != -1) {
      int bto = -1, bd = -1;
      for (auto to : g[d])
        if (!used[to])
          if (dsz[to] > bto) {
            bto = dsz[to];
            bd = to;
          }
      if (bto == -1) break;
      used[bd] = true;
      for (auto to : g[d])
        if (!used[to]) pq.push({dsz[to], to});
      d = bd;
    }
  }
  assert(cur == n);
  while (ans.size() < n) ans.push_back(n);
  for (int i = (int)(0); i < (int)(n); i++)
    printf("%d%c", ans[i], " \n"[i == n - 1]);
  return 0;
}
