#include <bits/stdc++.h>
using namespace std;
const int N = 5e5 + 7;
void Max(int &x, int y) {
  if (x < y) x = y;
}
int n, deg[N];
int head[N], edge_id;
struct edge {
  int to, next;
} e[N << 1];
void add_edge(int u, int v) {
  ++edge_id, e[edge_id].next = head[u], e[edge_id].to = v, head[u] = edge_id;
}
int cnt[N], Fa[N], pnt[N], dep[N], g[N], f1[N], f2[N], sum[N];
struct SegmentTree {
  int seg[N << 2];
  void xg(int id, int L, int R, int wz, int val) {
    if (L == R) return seg[id] = val, void();
    int mid = (L + R) >> 1;
    if (wz <= mid)
      xg(id << 1, L, mid, wz, val);
    else
      xg(id << 1 | 1, mid + 1, R, wz, val);
    seg[id] = max(seg[id << 1], seg[id << 1 | 1]);
  }
  int get(int id, int L, int R, int l, int r) {
    if (l <= L && R <= r) return seg[id];
    int mid = (L + R) >> 1, res = 0;
    if (l <= mid) Max(res, get(id << 1, L, mid, l, r));
    if (r > mid) Max(res, get(id << 1 | 1, mid + 1, R, l, r));
    return res;
  }
  void change(int wz, int val) { xg(1, 1, n, wz, val); }
  int qry(int l, int r) { return get(1, 1, n, l, r); }
} seg;
vector<int> tmp[N], G[N];
int mxd[N], sxd[N], glen[N], maxn[N];
void dfs1(int x) {
  for (int i = head[x]; i; i = e[i].next) {
    int v = e[i].to;
    if (v == Fa[x]) continue;
    Fa[v] = x, dfs1(v);
    if (mxd[v] + 1 > mxd[x])
      sxd[x] = mxd[x], mxd[x] = mxd[v] + 1;
    else if (mxd[v] + 1 > sxd[x])
      sxd[x] = mxd[v] + 1;
  }
}
void dfs2(int x) {
  if (x ^ 1) tmp[x].push_back(glen[x]);
  for (int i = head[x]; i; i = e[i].next) {
    int v = e[i].to;
    if (v == Fa[x]) continue;
    tmp[x].push_back(mxd[v] + 1);
    glen[v] = max(glen[x], mxd[v] + 1 == mxd[x] ? sxd[x] : mxd[x]) + 1, dfs2(v);
  }
}
void work(int x) {
  sort(tmp[x].begin(), tmp[x].end());
  for (int now : tmp[x]) cnt[now]++;
  int sz = tmp[x].size(), las = 0, lassz = sz;
  for (int now : tmp[x]) {
    if (now == las) continue;
    Max(f1[now - 1], sz), Max(f1[now], sz - cnt[now] + 1), Max(f2[now], sz);
    sz -= cnt[now], las = now;
  }
  for (int now : tmp[x]) cnt[now]--;
}
int maxson[N], bfn[N], L[N], R[N], idtot;
void bfs() {
  queue<int> q;
  q.push(1);
  while (!q.empty()) {
    int u = q.front();
    q.pop(), bfn[u] = ++idtot;
    for (int i = head[u]; i; i = e[i].next) {
      int v = e[i].to;
      if (v == Fa[u]) {
        if (!L[v]) L[v] = idtot;
        R[v] = idtot;
        continue;
      }
      q.push(v);
    }
  }
}
void calc(int x) {
  for (int t : G[x]) {
    int tmp = (glen[t] >= x) + (mxd[t] + 1 >= x);
    sum[t]++, Max(maxson[Fa[t]], sum[t] - tmp);
    if (L[t])
      Max(f2[x], sum[t] + maxson[t]), Max(f2[x], sum[t] + sum[Fa[t]] - tmp);
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0), cout.tie(0);
  cin >> n;
  for (int i = 1, iE = n; i <= iE; i++) f1[i] = f2[i] = 1, maxson[i] = -1e9;
  for (int i = 1, iE = n - 1; i <= iE; i++) {
    int u, v;
    cin >> u >> v, deg[u]++, deg[v]++;
    add_edge(u, v), add_edge(v, u);
  }
  dfs1(1), dfs2(1);
  for (int i = 1, iE = n; i <= iE; i++) Max(f1[0], deg[i] + 1);
  bfs();
  for (int i = 1, iE = n; i <= iE; i++) work(i);
  for (int i = 1, iE = n; i <= iE; i++)
    for (int t : tmp[i]) G[t].push_back(i);
  for (int i = n, iE = 1; i >= iE; i--) calc(i);
  for (int i = n, iE = 1; i >= iE; i--)
    Max(f1[i - 1], f1[i]), Max(f2[i - 1], f2[i]);
  for (int i = 1, iE = n; i <= iE; i++)
    if (i % 2)
      cout << f1[i / 2] << " ";
    else
      cout << f2[i / 2] << " ";
  cout << endl;
  return 0;
}
