#include <bits/stdc++.h>
using namespace std;
const int MAX = (const int)(2e3 + 11);
class DisjointSet {
 public:
  DisjointSet(size_t size) : size_(size) {
    id_.resize(size_);
    sz_.resize(size_);
    xs_.resize(size_);
    for (int i = 0; i < size_; ++i) {
      id_[i] = i;
      sz_[i] = 1;
      xs_[i].push_back(i);
    }
  }

 public:
  void Connect(int u, int v) {
    auto a = Find(u);
    auto b = Find(v);
    if (a == b) return;
    if (sz_[a] > sz_[b]) swap(a, b);
    id_[a] = b;
    sz_[b] += sz_[a];
    for (auto i : xs_[a]) xs_[b].push_back(i);
  }
  bool Connected(int u, int w) { return Find(u) == Find(w); }
  int Find(int u) {
    while (id_[u] != u) {
      id_[u] = id_[id_[u]];
      u = id_[u];
    }
    return u;
  }
  const vector<int> &All() const {
    for (int i = 0; i < size_; ++i)
      if (xs_[i].size() == size_) return xs_[i];
    assert(false);
    return {};
  }

 private:
  size_t size_;
  vector<int> sz_;
  vector<int> id_;
  vector<vector<int>> xs_;
};
static void solve(std::int32_t test) {
  int N;
  cin >> N;
  DisjointSet S(N);
  for (int i = 0; i < N - 1; ++i) {
    int a, b;
    cin >> a >> b;
    S.Connect(a - 1, b - 1);
  }
  for (auto u : S.All()) cout << u + 1 << " ";
}
int main() {
  ios_base::sync_with_stdio(0);
  cout << setprecision(12) << fixed;
  solve(0);
  return 0;
}
