#include <bits/stdc++.h>
using namespace std;
int n;
int p[150007];
vector<int> g[150007];
int getRank(int u) {
  if (u == p[u]) return u;
  return (p[u] = getRank(p[u]));
}
void combineSet(int a, int b) {
  a = getRank(a);
  b = getRank(b);
  if ((int)((g[a]).size()) < (int)((g[b]).size())) swap(a, b);
  for (auto &k : g[b]) g[a].push_back(k);
  p[b] = a;
}
signed main() {
  cin >> n;
  for (int i = 1; i <= n; ++i) p[i] = i, g[i].push_back(i);
  for (int i = 1; i <= n - 1; ++i) {
    int a, b;
    cin >> a >> b;
    combineSet(a, b);
  }
  int c = getRank(1);
  for (auto &k : g[c]) cout << k << ' ';
  cout << '\n';
}
