#include <bits/stdc++.h>
using namespace std;
int pre[150010], last[150010], g[150010];
int find(int x) { return (x == pre[x]) ? x : pre[x] = find(pre[x]); }
int main() {
  ios::sync_with_stdio(0);
  int n;
  while (cin >> n) {
    for (int i = 1; i <= n; ++i) pre[i] = i;
    for (int i = 1; i <= n; ++i) last[i] = i;
    for (int i = 1; i < n; ++i) {
      int x, y;
      cin >> x >> y;
      int fx = find(x);
      int fy = find(y);
      if (fx == fy) continue;
      pre[fy] = fx;
      g[last[fx]] = fy;
      last[fx] = last[fy];
    }
    for (int i = find(1); i; i = g[i]) cout << i << " ";
    cout << endl;
  }
}
