#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
ll parent[200000], size1[200000], gs[200000], link[200000];
void make_set(ll v) {
  parent[v] = v;
  size1[v] = 1;
  gs[v] = v;
  link[v] = v;
}
ll find_set(ll v) {
  if (v == parent[v]) return v;
  return parent[v] = find_set(parent[v]);
}
ll find_set1(ll v) {
  if (v == gs[v]) return v;
  return gs[v] = find_set1(gs[v]);
}
void union_sets(ll a, ll b) {
  a = find_set(a);
  b = find_set(b);
  if (a != b) {
    if (size1[a] < size1[b]) swap(a, b);
    link[gs[a]] = parent[b];
    parent[b] = a;
    gs[a] = find_set1(b);
    size1[a] += size1[b];
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ll n, i, x, y;
  cin >> n;
  for (i = 1; i <= n; i++) make_set(i);
  for (i = 0; i < n - 1; i++) {
    cin >> x >> y;
    union_sets(x, y);
  }
  x = find_set(1);
  while (link[x] != x) {
    cout << x << " ";
    x = link[x];
  }
  cout << x;
}
