#include <bits/stdc++.h>
using namespace std;
const long double pi = acos(-1);
const long long int mod = 1e9 + 7;
const double epsilon = 1e-9;
const long long int N = 200003;
long long int n, m;
long long int arr[N];
vector<long long int> s[N];
long long int root(long long int a) {
  if (a != arr[a]) return arr[a] = root(arr[a]);
  return a;
}
void _union(long long int a, long long int b) {
  long long int root_a = root(a);
  long long int root_b = root(b);
  if (root_a != root_b) {
    if (s[root_a].size() < s[root_b].size()) swap(root_a, root_b);
    arr[root_b] = root_a;
    for (long long int it : s[root_b]) s[root_a].push_back(it);
  }
}
int32_t main() {
  std::ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long int t;
  t = 1;
  while (t--) {
    cin >> n;
    for (long long int i = 0; i < n + 1; i++) {
      arr[i] = i;
      s[i].push_back(i);
    }
    for (long long int i = 1; i < n; i++) {
      long long int a, b;
      cin >> a >> b;
      _union(a, b);
    }
    long long int x = root(1);
    for (long long int it : s[x]) cout << it << " ";
    cout << "\n";
  }
}
