#include <bits/stdc++.h>
using namespace std;
vector<unsigned int> v[150000];
vector<unsigned int> ans;
unsigned int Root(unsigned int *arr, unsigned int x) {
  while (arr[x] != x) {
    arr[x] = arr[arr[x]];
    x = arr[arr[x]];
  }
  return x;
}
void trv(unsigned int x) {
  ans.push_back(x);
  for (unsigned int i = 0; i < (unsigned int)v[x].size(); i++) trv(v[x][i]);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  unsigned int n;
  cin >> n;
  unsigned int *arr = new unsigned int[n + 1];
  for (unsigned int i = 1; i < n + 1; i++) arr[i] = i;
  unsigned int x, y;
  for (unsigned int i = 0; i < n - 1; i++) {
    cin >> x >> y;
    x = Root(arr, x), y = Root(arr, y);
    arr[y] = x;
    v[x].push_back(y);
  }
  trv(Root(arr, 1));
  for (unsigned int i = 0; i < (unsigned int)ans.size(); i++)
    cout << ans[i] << " ";
  cout << endl;
  return 0;
}
