#include <bits/stdc++.h>
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const long long N = 150005;
vector<long long> cat[N];
long long par[N];
long long parent(long long x) {
  if (par[x] == x) return x;
  par[x] = parent(par[x]);
  return par[x];
}
void unite(long long x, long long y) {
  long long px = parent(x);
  long long py = parent(y);
  if (cat[px].size() >= cat[py].size()) {
    par[py] = px;
    for (auto u : cat[py]) {
      cat[px].push_back(u);
    }
    cat[py].clear();
  } else {
    par[px] = py;
    for (auto u : cat[px]) {
      cat[py].push_back(u);
    }
    cat[px].clear();
  }
}
int main() {
  long long n;
  cin >> n;
  for (long long i = 1; i <= n; i++) {
    par[i] = i;
    cat[i].push_back(i);
  }
  for (long long i = 0; i < n - 1; i++) {
    long long x, y;
    cin >> x >> y;
    unite(x, y);
  }
  for (long long i = 1; i <= n; i++) {
    if (cat[i].size() == n) {
      for (auto u : cat[i]) {
        cout << u << " ";
      }
      cout << endl;
      return 0;
    }
  }
}
