#include <bits/stdc++.h>
using namespace std;
bool debug = 0;
int n, m, k;
int dx[4] = {0, 1, 0, -1}, dy[4] = {1, 0, -1, 0};
string direc = "RDLU";
long long ln, lk, lm;
void etp(bool f = 0) {
  puts(f ? "YES" : "NO");
  exit(0);
}
void addmod(int &x, int y, int mod = 1000000007) {
  assert(y >= 0);
  x += y;
  if (x >= mod) x -= mod;
  assert(x >= 0 && x < mod);
}
void et() {
  puts("-1");
  exit(0);
}
long long fastPow(long long x, long long y, int mod = 1000000007) {
  long long ans = 1;
  while (y > 0) {
    if (y & 1) ans = (x * ans) % mod;
    x = x * x % mod;
    y >>= 1;
  }
  return ans;
}
long long gcd1(long long x, long long y) {
  long long z = y;
  while (x % y != 0) {
    z = x % y;
    x = y;
    y = z;
  }
  return z;
}
vector<int> mp[100005];
int R, rd, d[100005], S[100005];
void fr(int x, int pa, int dp) {
  if (dp > rd) {
    R = x;
    rd = dp;
  }
  for (int c : mp[x])
    if (c != pa) fr(c, x, dp + 1);
}
struct Hld {
  int fa[100005], bigSon[100005], sz[100005], deep[100005];
  int head[100005];
  void calSize(int x, int pa) {
    sz[x] = 1;
    fa[x] = pa;
    deep[x] = deep[pa] + 1;
    int mx = 0;
    for (int c : mp[x])
      if (c != pa) {
        calSize(c, x);
        sz[x] = max(sz[c] + 1, sz[x]);
        if (mx < sz[c]) {
          mx = sz[c];
          bigSon[x] = c;
        }
      }
  }
  void build(int x, int H) {
    head[x] = H;
    S[H]++;
    if (bigSon[x] != 0) build(bigSon[x], H);
    for (int c : mp[x])
      if (c != fa[x] && c != bigSon[x]) {
        build(c, c);
      }
  }
} ynk;
void fmain(int ID) {
  scanf("%d", &n);
  for (int i = 0, u, v; i < n - 1; i++) {
    scanf("%d%d", &u, &v);
    mp[u].push_back(v);
    mp[v].push_back(u);
  };
  fr(1, 0, 1);
  ynk.calSize(R, 0);
  ynk.build(R, R);
  vector<int> vp;
  for (int(i) = 1; (i) <= (int)(n); (i)++) vp.push_back(S[i]);
  sort(vp.begin(), vp.end());
  int pre = 0;
  for (int(i) = 1; (i) <= (int)(n); (i)++) {
    if (i == 1)
      pre++;
    else {
      pre += vp.back();
      vp.pop_back();
      if (i == 2) pre--;
    }
    printf("%d ", pre);
  }
}
int main() {
  int t = 1;
  for (int(i) = 1; (i) <= (int)(t); (i)++) {
    fmain(i);
  }
  return 0;
}
