#include <bits/stdc++.h>
using namespace std;
const long long N = 1e6 + 5;
const long long H = 239017;
const long double EPS = 1e-12;
const long long INF = 2e18 + 5;
const long long MOD = 1e9 + 7;
const long long MD = 998244353;
const long double PI = 3.14159265358979323;
long long l = -1;
vector<long long> p, s;
vector<vector<long long> > g;
void make(long long n) {
  p.resize(n + 5, 0);
  s.resize(n + 5, 0);
  g.resize(n + 1);
  for (long long i = 1; i <= n; i++) {
    p[i] = i;
    s[i] = 1;
    g[i].push_back(i);
  }
}
long long get(long long v) {
  if (v == p[v]) return v;
  return p[v] = get(p[v]);
}
void un(long long a, long long b) {
  a = get(a);
  b = get(b);
  if (a == b) return;
  if (s[a] < s[b]) swap(a, b);
  p[b] = a;
  s[a] += s[b];
  for (auto &i : g[b]) g[a].push_back(i);
}
void solve() {
  long long n;
  cin >> n;
  make(n);
  long long m = n - 1;
  for (; m; m--) {
    long long a, b;
    cin >> a >> b;
    un(a, b);
  }
  long long ans = get(1);
  for (auto &i : g[ans]) cout << i << ' ';
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout << setprecision(6) << fixed;
  long long ttt = 1;
  for (; ttt; --ttt) {
    solve();
    cout << '\n';
  }
  return 0;
}
