#include <bits/stdc++.h>
using namespace std;
long long mod = 1000000007LL;
long long large = 2000000000000000000LL;
int n;
vector<vector<int> > adj;
vector<vector<int> > pa;
vector<int> lv;
vector<int> lb;
vector<int> rb;
vector<int> pos;
int rp = 0;
void dfs(int u, int parent, int lvl) {
  lv[u] = lvl;
  pa[u][0] = parent;
  lb[u] = rp++;
  pos[rp - 1] = u;
  for (int j = 0; j < (int)adj[u].size(); j++) {
    int v = adj[u][j];
    if (v != parent) dfs(v, u, lvl + 1);
  }
  rb[u] = rp - 1;
}
int l = 20;
vector<int> mark;
vector<pair<int, int> > maxi;
vector<int> addv;
int ul, ur, uv;
void update(int o, int l, int r) {
  if (ul <= l && ur >= r) {
    addv[o] += uv;
    if (l == r)
      maxi[o] = pair<int, int>(addv[o], pos[l]);
    else {
      maxi[o].first += uv;
    }
  } else {
    int m = (l + r) / 2;
    if (ul <= m) update(o * 2, l, m);
    if (ur > m) update(o * 2 + 1, m + 1, r);
    maxi[o] = max(maxi[o * 2], maxi[o * 2 + 1]);
    maxi[o].first += addv[o];
  }
}
int main() {
  cin >> n;
  adj.assign(n, vector<int>());
  for (int i = 0; i < n - 1; i++) {
    int x, y;
    cin >> x >> y;
    x--;
    y--;
    adj[x].push_back(y);
    adj[y].push_back(x);
  }
  queue<int> q;
  vector<int> dis(n, n);
  dis[0] = 0;
  q.push(0);
  while (!q.empty()) {
    int u = q.front();
    q.pop();
    for (int j = 0; j < (int)adj[u].size(); j++) {
      int v = adj[u][j];
      if (dis[v] > dis[u] + 1) {
        dis[v] = dis[u] + 1;
        q.push(v);
      }
    }
  }
  int rt = -1;
  int d = -1;
  for (int i = 0; i < n; i++) {
    if (d < dis[i]) {
      d = dis[i];
      rt = i;
    }
  }
  pa.assign(n, vector<int>(l, -1));
  lv.assign(n, -1);
  pos = lb = rb = lv;
  dfs(rt, -1, 0);
  for (int j = 1; j < l; j++) {
    for (int i = 0; i < n; i++) {
      if (pa[i][j - 1] != -1) {
        pa[i][j] = pa[pa[i][j - 1]][j - 1];
      }
    }
  }
  mark.assign(n, 0);
  mark[rt] = 1;
  maxi.assign(4 * n + 10, pair<int, int>(0, n));
  addv.assign(4 * n + 10, 0);
  for (int i = 0; i < n; i++) {
    ul = ur = lb[i];
    uv = lv[i];
    update(1, 0, n - 1);
  }
  cout << 1 << " ";
  int cnt = 1;
  for (int it = 1; it < n; it++) {
    int u = maxi[1].second;
    if (maxi[1].first == 0) {
      cout << cnt << " ";
      continue;
    }
    while (!mark[u]) {
      mark[u] = 1;
      cnt++;
      ul = lb[u];
      ur = rb[u];
      uv = -1;
      update(1, 0, n - 1);
      u = pa[u][0];
    }
    cout << cnt << " ";
  }
  return 0;
}
