#include <bits/stdc++.h>
using namespace std;
unsigned long long sa[150005], pa[150005], na[150005], ea[150005];
unsigned long long root(unsigned long long n) {
  if (pa[n] == n) return n;
  return root(pa[n]);
}
void uni(unsigned long long a, unsigned long long b) {
  unsigned long long ra = root(a), rb = root(b);
  if (sa[ra] > sa[rb]) {
    sa[ra] += sa[rb];
    pa[rb] = ra;
    na[ea[ra]] = rb;
    ea[ra] = ea[rb];
  } else {
    pa[ra] = rb;
    sa[rb] += sa[ra];
    na[ea[rb]] = ra;
    ea[rb] = ea[ra];
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  unsigned long long n, a, b, r, i;
  cin >> n;
  for (i = 1; i <= n; i++) {
    sa[i] = 1;
    pa[i] = i;
    ea[i] = i;
  }
  for (i = 0; i < n - 1; i++) {
    cin >> a >> b;
    uni(a, b);
  }
  r = root(1);
  for (i = 0; i < n; i++) {
    cout << r << " ";
    r = na[r];
  }
}
