#include <bits/stdc++.h>
using namespace std;
inline bool EQ(double a, double b) { return fabs(a - b) < 1e-9; }
inline int two(int n) { return 1 << n; }
inline int test(int n, int b) { return (n >> b) & 1; }
inline void set_bit(int &n, int b) { n |= two(b); }
inline void unset_bit(int &n, int b) { n &= ~two(b); }
inline int last_bit(int n) { return n & (-n); }
inline int ones(int n) {
  int res = 0;
  while (n && ++res) n -= n & (-n);
  return res;
}
const int N = 150001;
vector<int> seq[N];
int p[N], rnk[N];
void init() {
  for (int i = 0; i < (N); ++i) {
    seq[i].push_back(i);
    p[i] = i;
  }
}
int findSet(int i) { return (p[i] == i) ? i : (p[i] = findSet(p[i])); }
void unionSet(int i, int j) {
  i = findSet(i);
  j = findSet(j);
  if (i != j) {
    if (rnk[i] > rnk[j]) swap(i, j);
    p[i] = j;
    seq[j].insert(seq[j].end(), seq[i].begin(), seq[i].end());
    seq[i].clear();
    if (rnk[i] == rnk[j]) ++rnk[j];
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  init();
  int n;
  cin >> n;
  int l, r;
  for (int i = 0; i < (n - 1); ++i) {
    cin >> l >> r;
    --l, --r;
    unionSet(l, r);
  }
  for (int i = 0; i < (n); ++i) {
    if (p[i] == i) {
      for (auto j : seq[i]) {
        cout << j + 1 << " ";
      }
    }
  }
  return 0;
}
