#include <bits/stdc++.h>
const int maxn(150005);
int fa[maxn], lat[maxn], beginw[maxn], endw[maxn];
int find(int a) {
  if (fa[a] == a) {
    return a;
  }
  int f(find(fa[a]));
  fa[a] = f;
  return f;
}
void comb(int a, int b) {
  a = find(a);
  b = find(b);
  lat[endw[a]] = beginw[b];
  endw[a] = endw[b];
  fa[b] = a;
}
int main() {
  int N;
  scanf("%d", &N);
  for (int i(1); i <= N; ++i) {
    fa[i] = lat[i] = beginw[i] = endw[i] = i;
  }
  int cbx, cby;
  for (int i(1); i < N; ++i) {
    scanf("%d%d", &cbx, &cby);
    comb(cbx, cby);
  }
  int x(beginw[find(1)]);
  printf("%d ", x);
  while (lat[x] != x) {
    x = lat[x];
    printf("%d ", x);
  }
  return 0;
}
