#include <bits/stdc++.h>
using namespace std;
int n, f[150005];
vector<int> s[150005];
int find(int x) { return x == f[x] ? x : f[x] = find(f[x]); }
inline void merge(int x, int y) {
  x = find(x);
  y = find(y);
  if (s[x].size() < s[y].size()) swap(x, y);
  for (int i = 0, lim = s[y].size() - 1; i <= lim; ++i) s[x].push_back(s[y][i]);
  f[y] = x;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    f[i] = i;
    s[i].push_back(i);
  }
  for (int i = 1, x, y; i < n; ++i) {
    scanf("%d %d", &x, &y);
    merge(x, y);
  }
  int rt = find(1);
  for (int i = 0, lim = s[rt].size() - 1; i <= lim; ++i)
    printf("%d ", s[rt][i]);
  return 0;
}
