#include <bits/stdc++.h>
using namespace std;
const double PI = 3.14159265358979323846;
const double eps = (1e-8);
const int N = 150006;
vector<int> comp[N], parent;
int findParent(int x) {
  if (x == parent[x]) return x;
  return parent[x] = findParent(parent[x]);
}
void link(int x, int y) {
  x = findParent(x), y = findParent(y);
  if ((int)(comp[x]).size() < (int)(comp[y]).size()) swap(x, y);
  parent[y] = x;
  for (auto item : comp[y]) comp[x].push_back(item);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  parent.resize(n);
  for (int i = 0; i < n; ++i) {
    parent[i] = i;
    comp[i].push_back(i);
  }
  for (int i = 0; i < n - 1; ++i) {
    int x, y;
    cin >> x >> y;
    --x;
    --y;
    link(x, y);
  }
  int id = findParent(0);
  for (auto item : comp[id]) cout << item + 1 << ' ';
  return 0;
}
