#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
long long components[150001];
vector<int> sets[150001];
long long find(long long a) {
  while (a != components[a]) {
    components[a] = components[components[a]];
    a = components[a];
  }
  return a;
}
void uni0n(long long a, long long b) {
  long long fa = find(a), fb = find(b);
  if (sets[fa].size() > sets[fb].size()) {
    components[fb] = components[fa];
    sets[fa].insert(sets[fa].end(), sets[fb].begin(), sets[fb].end());
  } else {
    components[fa] = components[fb];
    sets[fb].insert(sets[fb].end(), sets[fa].begin(), sets[fa].end());
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n;
  cin >> n;
  for (long long i = 1; i < n + 1; i++) {
    components[i] = i;
    sets[i].push_back(i);
  }
  for (long long i = 0; i < n - 1; i++) {
    long long a, b;
    cin >> a >> b;
    uni0n(a, b);
  }
  for (long long i = 1; i < n + 1; i++) {
    if (sets[i].size() == n) {
      for (auto& j : sets[i]) {
        cout << j << ' ';
      }
      cout << '\n';
      break;
    }
  }
  return 0;
}
