#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int n;
vector<int> adj[N];
int par[N], far[N];
int sta[N], fin[N], ver[N];
int tot, del[N];
int res;
void dfs(int u, int p, bool ok) {
  if (ok) sta[u] = ++tot, ver[tot] = u;
  for (int v : adj[u])
    if (v != p) {
      par[v] = u;
      far[v] = far[u] + 1;
      dfs(v, u, ok);
    }
  if (ok) fin[u] = tot;
}
pair<int, int> t[N << 2];
int lz[N << 2];
void build(int v, int l, int r) {
  if (l == r) {
    t[v] = make_pair(far[ver[l]], l);
    return;
  }
  int mid = l + r >> 1;
  build(v << 1, l, mid);
  build(v << 1 | 1, mid + 1, r);
  t[v] = max(t[v << 1], t[v << 1 | 1]);
}
void push(int v, int l, int r) {
  if (!lz[v]) return;
  t[v].first += lz[v];
  if (l < r) {
    lz[v << 1] += lz[v];
    lz[v << 1 | 1] += lz[v];
  }
  lz[v] = 0;
}
void upd(int v, int l, int r, int L, int R, int val) {
  push(v, l, r);
  if (L > r || R < l) return;
  if (L <= l && R >= r) {
    lz[v] = val;
    push(v, l, r);
    return;
  }
  int mid = l + r >> 1;
  upd(v << 1, l, mid, L, R, val);
  upd(v << 1 | 1, mid + 1, r, L, R, val);
  t[v] = max(t[v << 1], t[v << 1 | 1]);
}
void solve(int u) {
  while (!del[u]) {
    del[u] = 1;
    upd(1, 1, n, sta[u], fin[u], -1);
    res++;
    u = par[u];
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n;
  for (int i = 2; i <= n; ++i) {
    int u, v;
    cin >> u >> v;
    adj[u].push_back(v), adj[v].push_back(u);
  }
  dfs(1, 1, 0);
  int root = 1;
  for (int i = 1; i <= n; ++i)
    if (far[i] > far[root]) {
      root = i;
    }
  del[root] = 1;
  par[root] = root;
  far[root] = 0;
  dfs(root, root, 1);
  build(1, 1, n);
  del[root] = 1;
  res = 1;
  cout << 1 << ' ';
  for (int i = 2; i <= n; ++i) {
    pair<int, int> cur = t[1];
    if (cur.first) {
      int u = ver[cur.second];
      solve(u);
    }
    cout << res << ' ';
  }
}
