#include <bits/stdc++.h>
using namespace std;
const int N = 150000 + 10;
int fa[N], r[N], ed[N];
int fi(int x) { return x == fa[x] ? x : fa[x] = fi(fa[x]); }
int main() {
  for (int i = 1; i <= N; i++) fa[i] = ed[i] = i;
  int n;
  scanf("%d", &n);
  for (int i = 1; i < n; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    int fx = fi(u), fy = fi(v);
    fa[fy] = fx;
    r[ed[fx]] = fy;
    ed[fx] = ed[fy];
  }
  for (int i = 1; i <= n; i++) {
    if (fa[i] == i) {
      for (int j = i; j; j = r[j]) printf("%d ", j);
      return 0;
    }
  }
  return 0;
}
