#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 1e5 + 10;
vector<int> g[MAX_N];
int n;
int p[MAX_N], d[MAX_N];
int root;
int bfs(int s) {
  queue<int> q;
  q.push(s);
  d[s] = 1;
  while (!q.empty()) {
    int curr = q.front();
    q.pop();
    for (auto nxt : g[curr]) {
      if (d[nxt] == 0) {
        d[nxt] = d[curr] + 1;
        q.push(nxt);
      }
    }
  }
  int mx = 0, ret = 0;
  for (int i = 1; i <= n; i++) {
    if (d[i] > mx) {
      mx = d[i];
      ret = i;
    }
    d[i] = 0;
  }
  return ret;
}
vector<pair<int, int> > vec;
bool has[MAX_N];
void dfs(int x, int par) {
  if (g[x].size() == 1 && x != root) {
    d[x] = 1;
    vec.push_back({1, x});
    p[x] = -1;
    return;
  }
  p[x] = par;
  for (auto nxt : g[x]) {
    if (par != nxt) {
      dfs(nxt, x);
      if (d[nxt] + 1 > d[x]) {
        d[x] = d[nxt] + 1;
        p[x] = nxt;
      }
    }
  }
  vec.push_back({d[x], x});
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  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);
  }
  root = bfs(1);
  dfs(root, -1);
  has[root] = true;
  int curr = 0, ans = 1, answered = 1;
  sort(vec.begin(), vec.end());
  cout << 1 << " ";
  for (curr = n - 1; curr >= 0; curr--) {
    if (!has[vec[curr].second]) {
      int x = vec[curr].second;
      while (x != -1) {
        if (!has[x]) {
          ans++;
        }
        has[x] = true;
        x = p[x];
      }
      answered++;
      cout << ans << " ";
    }
  }
  for (; answered < n; answered++) {
    cout << n << " ";
  }
  return 0;
}
