#include <bits/stdc++.h>
using namespace std;
template <typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val) {
  std::fill((T *)array, (T *)(array + N), val);
}
class TreeDiameter {
 public:
  vector<vector<int> > G;
  vector<int> diameter;
  int V;
  TreeDiameter(int node_size) {
    V = node_size;
    G.resize(V);
  }
  void add_edge(int u, int v) { G[u].push_back(v), G[v].push_back(u); }
  void dfs(int u, int p, int d, int &far, int &mx) {
    if (mx < d) {
      far = u;
      mx = d;
    }
    for (int v : G[u]) {
      if (v != p) {
        dfs(v, u, d + 1, far, mx);
      }
    }
  }
  bool redfs(int u, int p, const int t) {
    if (u == t) {
      return true;
    }
    for (int v : G[u]) {
      if (v != p) {
        diameter.push_back(v);
        if (redfs(v, u, t)) {
          return true;
        } else {
          diameter.pop_back();
        }
      }
    }
    return false;
  }
  void solve() {
    int s, t, mx;
    mx = -1;
    dfs(0, -1, 0, s, mx);
    mx = -1;
    dfs(s, -1, 0, t, mx);
    diameter.push_back(s);
    redfs(s, -1, t);
  }
};
int dfs(int x, int y, vector<bool> &flag, vector<vector<int> > &g,
        vector<int> &p) {
  if (g[x].size() == 1) {
    return p[x] = 1;
  }
  for (int z : g[x]) {
    if (z != y) {
      p[x] = max(p[x], 1 + dfs(z, x, flag, g, p));
    }
  }
  return p[x];
}
priority_queue<pair<int, int> > pq;
void dfs2(int y, vector<vector<int> > &g, vector<bool> flag, vector<int> &p) {
  bool f = 0;
  for (int i : g[y]) {
    if (!flag[i]) {
      if (p[i] == p[y] - 1 && !f) {
        f = 1;
        dfs2(i, g, flag, p);
      } else {
        if (p[i] < p[y]) {
          pq.push(make_pair(p[i], i));
        }
      }
    }
  }
  return;
}
int main() {
  int n;
  cin >> n;
  vector<int> ans;
  vector<vector<int> > g(n);
  TreeDiameter tr(n);
  for (int i = 0; i < (int)(n - 1); ++i) {
    int a, b;
    cin >> a >> b;
    a--;
    b--;
    g[a].push_back(b);
    g[b].push_back(a);
    tr.add_edge(a, b);
  }
  tr.solve();
  ans.push_back(1);
  ans.push_back(tr.diameter.size());
  vector<int> p(n);
  vector<bool> flag(n);
  for (int i = 0; i < tr.diameter.size(); i++) {
    flag[tr.diameter[i]] = 1;
  }
  for (int i = 0; i < tr.diameter.size(); i++) {
    int x = tr.diameter[i];
    for (int j = 0; j < g[x].size(); j++) {
      if (!flag[g[x][j]]) {
        pq.push(make_pair(dfs(g[x][j], x, flag, g, p), g[x][j]));
      }
    }
  }
  while (!pq.empty()) {
    auto ppp = pq.top();
    pq.pop();
    int x = ppp.first;
    int y = ppp.second;
    ans.push_back(ans[ans.size() - 1] + x);
    dfs2(y, g, flag, p);
  }
  for (int i = 0; i < n; i++) {
    if (i < ans.size())
      cout << ans[i];
    else
      cout << n;
    if (i != n - 1) {
      cout << " ";
    }
  }
  cout << endl;
  return 0;
}
