#include <bits/stdc++.h>
using namespace std;
vector<int> x;
vector<int> y;
vector<int> par, sz;
vector<vector<int> > sets;
int get(int u) {
  if (par[u] == u) return u;
  return par[u] = get(par[u]);
}
void unite(int u, int v) {
  u = get(u), v = get(v);
  if (sz[u] < sz[v]) swap(u, v);
  par[v] = u;
  sz[u] += sz[v];
  for (int i = 0; i < sets[v].size(); i++) sets[u].push_back(sets[v][i]);
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  x.resize(n), y.resize(n);
  for (int i = 0; i < n - 1; i++) cin >> x[i] >> y[i], x[i]--, y[i]--;
  sz.resize(n), par.resize(n), sets.resize(n);
  for (int i = 0; i < n; i++) par[i] = i, sz[i] = 1, sets[i].push_back(i);
  for (int i = 0; i < n - 1; i++) unite(x[i], y[i]);
  int v = get(0);
  for (auto x : sets[v]) cout << x + 1 << ' ';
  return 0;
}
