#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e+7;
const int N = 150015;
int n, head[N], tail[N], cage[N], x, y, a, b;
int get(int w) {
  if (head[w] == w) return w;
  int rev = get(head[w]);
  head[w] = head[rev];
  tail[w] = tail[rev];
  return rev;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) head[i] = tail[i] = i;
  while (--n) {
    scanf("%d%d", &a, &b);
    x = get(a);
    y = get(b);
    cage[tail[x]] = head[y];
    tail[x] = tail[y];
    head[y] = head[x];
  }
  for (x = get(1); x; x = cage[x]) printf("%d ", x);
  printf("\n");
  return 0;
}
