#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const long long INF = 1e9 + 9;
const long long N = 200500;
vector<long long> b[N];
long long p[N], sze[N];
long long get(long long v) {
  if (v == p[v]) return v;
  p[v] = get(p[v]);
  return p[v];
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  long long n;
  cin >> n;
  for (long long i = 1; i <= n; i++) {
    sze[i] = 1;
    p[i] = i;
    b[i].push_back(i);
  }
  for (long long i = 1; i < n; i++) {
    long long x, y;
    cin >> x >> y;
    x = get(x);
    y = get(y);
    if (sze[x] > sze[y]) swap(x, y);
    for (auto z : b[x]) {
      b[y].push_back(z);
    }
    b[x].clear();
    sze[y] += sze[x];
    p[x] = y;
  }
  long long leader = get(1);
  for (auto z : b[leader]) {
    cout << z << " ";
  }
  return 0;
}
