#include <bits/stdc++.h>
using namespace std;
int n;
vector<int> g[100005];
int rt = 0, rd = 0;
priority_queue<pair<int, int>> pq;
int fl[100005];
bool vis[100005];
int res = 1;
int pcnt = 1;
void dfs1(int s, int p, int cd) {
  if (cd > rd) {
    rd = cd;
    rt = s;
  }
  for (int a : g[s]) {
    if (a == p) continue;
    dfs1(a, s, cd + 1);
  }
}
int dfs2(int s, int p) {
  int cd = 0;
  int fc = -1;
  for (int a : g[s]) {
    if (a == p) continue;
    int nd = dfs2(a, s) + 1;
    if (nd > cd) {
      cd = nd;
      fc = a;
    }
  }
  pq.push({cd, s});
  fl[s] = fc;
  return cd;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  for (int i = 0; i < n - 1; ++i) {
    int a, b;
    cin >> a >> b;
    g[a].push_back(b);
    g[b].push_back(a);
  }
  dfs1(1, -1, 0);
  dfs2(rt, -1);
  cout << "1 ";
  vis[rt] = true;
  while (pq.size() > 0) {
    auto cur = pq.top();
    pq.pop();
    int cn = cur.second;
    if (vis[cn]) continue;
    do {
      res++;
      vis[cn] = true;
      cn = fl[cn];
    } while (cn != -1);
    cout << res << " ";
    pcnt++;
  }
  for (int i = pcnt; i < n; ++i) {
    cout << n << " ";
  }
  cout << "\n";
  return 0;
}
