#include <bits/stdc++.h>
using namespace std;
int n;
struct node {
  int pd, pud, cd, cud;
};
vector<pair<int, int>> v;
vector<node> res;
int cud(int x) {
  if (x != res[x].cud) res[x].cud = cud(res[x].cud);
  return res[x].cud;
}
int pud(int x) {
  if (x != res[x].pud) res[x].pud = pud(res[x].pud);
  return res[x].pud;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  v.resize(n - 1);
  res.resize(n + 1);
  for (int i = 0; i < n - 1; i++) cin >> v[i].first >> v[i].second;
  for (int i = 1; i <= n; i++)
    res[i].cd = res[i].cud = res[i].pd = res[i].pud = i;
  for (int i = 0; i < n - 1; i++) {
    int a = v[i].first, b = v[i].second;
    int c = cud(a), d = pud(b);
    int e = pud(a), f = cud(b);
    res[e].cud = f;
    res[a].cud = f;
    res[c].cd = d, res[c].cud = f;
    res[d].pd = c, res[d].pud = e;
    res[b].pud = e;
    res[f].pud = e;
  }
  int st;
  for (int i = 1; i <= n; i++)
    if (res[i].pd == res[i].pud && res[i].pd == i) st = i;
  vector<int> ans;
  ans.push_back(st);
  for (int i = 0; i < n - 1; i++) ans.push_back(res[st].cd), st = res[st].cd;
  for (int i = 0; i < n; i++) cout << ans[i] << " ";
  return 0;
}
