#include <bits/stdc++.h>
using namespace std;
void make_set(int i);
int find_set_l(int x);
int find_set_r(int x);
void union_set(int x, int y);
int parent_l[150010];
int rank[150010];
int parent_r[150010];
int r[150010];
int l[150010];
int main() {
  int n, x, y;
  cin >> n;
  vector<int> v;
  for (int i = 1; i <= n; i++) {
    make_set(i);
  }
  for (int i = 0; i < n - 1; i++) {
    cin >> x >> y;
    union_set(x, y);
  }
  x = find_set_l(1);
  for (int i = 0; i < n; i++) {
    cout << x << " ";
    x = r[x];
  }
  cout << endl;
}
void make_set(int i) {
  parent_r[i] = i;
  parent_l[i] = i;
  l[i] = i;
  r[i] = i;
}
void union_set(int x, int y) {
  x = find_set_r(x);
  y = find_set_l(y);
  if (x != y) {
    parent_r[x] = y;
    parent_l[y] = x;
    r[x] = y;
    l[y] = x;
  }
}
int find_set_l(int x) {
  if (x == parent_l[x]) {
    return (x);
  }
  return (parent_l[x] = find_set_l(parent_l[x]));
}
int find_set_r(int x) {
  if (x == parent_r[x]) {
    return (x);
  }
  return (parent_r[x] = find_set_r(parent_r[x]));
}
