#include <bits/stdc++.h>
#pragma GCC optimize("-O3")
using namespace std;
const int N = 1.5e5 + 5;
int n, x, y, root, p[N];
vector<int> v[N];
int getParent(int x) {
  if (p[x] == x) return x;
  return p[x] = getParent(p[x]);
}
void Union(int x, int y) {
  x = getParent(x), y = getParent(y);
  if (v[x].size() < v[y].size()) swap(x, y);
  for (auto &i : v[y]) v[x].push_back(i);
  p[y] = x;
}
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  cin >> n;
  for (int i = 1; i <= n; i++) v[i].push_back(i), p[i] = i;
  for (int i = 1; i < n; i++) cin >> x >> y, Union(x, y);
  root = getParent(1);
  for (auto &i : v[root]) cout << i << " ";
  return 0;
}
