#include <bits/stdc++.h>
using namespace std;
const int mxN = 1.5e5;
int n, p[mxN];
vector<int> v[mxN];
int find(int x) { return x == p[x] ? x : (p[x] = find(p[x])); }
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  cin >> n;
  iota(p, p + n, 0);
  for (int i = 0; i < n; ++i) v[i] = {i};
  for (int i = 1; i < n; ++i) {
    int x, y;
    cin >> x >> y, --x, --y;
    x = find(x), y = find(y);
    if (v[x].size() > v[y].size()) swap(x, y);
    p[x] = y;
    v[y].insert(v[y].end(), v[x].begin(), v[x].end());
  }
  for (int vi : v[find(0)]) cout << vi + 1 << " ";
  return 0;
}
