#include <bits/stdc++.h>
using namespace std;
const int maxn = 15e5 + 10;
int pre[maxn], l[maxn], r[maxn], nxt[maxn];
int find(int x) { return x == pre[x] ? x : pre[x] = find(pre[x]); }
int main() {
  int n, u, v;
  cin >> n;
  for (int i = 1; i <= n; i++) pre[i] = l[i] = r[i] = i;
  while (n > 1) {
    n--;
    cin >> u >> v;
    u = find(u), v = find(v);
    pre[v] = u;
    nxt[r[u]] = l[v];
    r[u] = r[v];
  }
  u = l[find(1)];
  while (u) {
    cout << u << " ";
    u = nxt[u];
  }
  return 0;
}
