#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
long long powmod(long long a, long long b) {
  long long res = 1;
  a %= mod;
  assert(b >= 0);
  for (; b; b >>= 1) {
    if (b & 1) res = res * a % mod;
    a = a * a % mod;
  }
  return res;
}
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
const int N = 201000;
struct ele {
  int u, pre;
};
priority_queue<ele> q;
int dep[N], p[N], f[N], u[N], v[N], ret[N], d[N], spe[N], od[N], tot, n, m, Q,
    k;
vector<int> e[N];
bool operator<(const ele &x, const ele &y) {
  return dep[x.u] - dep[x.pre] > dep[y.u] - dep[y.pre];
}
int find(int x) { return f[x] == x ? x : f[x] = find(f[x]); }
void dfs1(int u, int f) {
  dep[u] = dep[f] + 1;
  p[u] = f;
  for (int j = 0; j < ((int)(e[u]).size()); j++) {
    int v = e[u][j];
    if (v != f) dfs1(v, u);
  }
}
int main() {
  scanf("%d", &n);
  m = n - 1;
  for (int i = 1; i < n + 1; i++) f[i] = i;
  for (int i = 0; i < n - 1; i++) {
    scanf("%d%d", u + i, v + i);
    if (find(u[i]) != find(v[i])) {
      e[u[i]].push_back(v[i]);
      e[v[i]].push_back(u[i]);
      f[find(u[i])] = find(v[i]);
    } else
      spe[i] = 1;
  }
  dfs1(1, 0);
  for (int i = 1; i < n + 1; i++) f[i] = i;
  for (int i = 0; i < m; i++)
    if (spe[i]) {
      int x = find(u[i]), y = find(v[i]);
      while (x != y) {
        if (dep[x] < dep[y]) swap(x, y);
        f[x] = find(p[x]);
        x = f[x];
      }
    }
  for (int i = 1; i < n + 1; i++) e[i].clear();
  for (int i = 1; i < n + 1; i++)
    if (find(i) == i) od[i] = ++tot;
  for (int i = 2; i < n + 1; i++)
    if (find(i) == i) {
      int x = od[i], y = od[find(p[i])];
      e[x].push_back(y);
      e[y].push_back(x);
    }
  n = tot;
  dfs1(1, 0);
  int cen = max_element(dep + 1, dep + n + 1) - dep;
  dfs1(cen, 0);
  cen = max_element(dep + 1, dep + n + 1) - dep;
  int len = dep[cen];
  for (int i = 0; i < len / 2; i++) cen = p[cen];
  dfs1(cen, 0);
  e[cen].push_back(0);
  e[0].push_back(cen);
  for (int i = 1; i < n + 1; i++) {
    d[i] = ((int)(e[i]).size()) - 1;
    f[i] = i;
  }
  for (int i = 1; i < n + 1; i++)
    if (d[i] < 2) f[i] = p[i];
  for (int i = 1; i < n + 1; i++)
    if (d[i] == 0) q.push((ele){i, find(i)});
  m = ((int)(q).size());
  ret[((int)(q).size())] = n - 1;
  while (!q.empty()) {
    ele l = q.top();
    q.pop();
    int u = l.u, pre = l.pre;
    if (find(u) != pre)
      q.push((ele){u, find(u)});
    else {
      ret[((int)(q).size())] = ret[((int)(q).size()) + 1] - (dep[u] - dep[pre]);
      if ((--d[pre]) < 2 && pre != cen) f[pre] = p[pre];
    }
  }
  printf("1");
  for (int i = 2; i < n + 1; i++) printf(" %d", ret[min(i, m)] + 1);
  puts("");
}
