#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const int N = 2 * 150005;
;
int par[N], cur, color[N], siz[N];
vector<int> adj[N];
vector<int> ans;
int n;
int find(int a) { return a == par[a] ? a : par[a] = find(par[a]); }
void dsu_union(int a, int b) {
  a = find(a);
  b = find(b);
  if (a == b) return;
  cur++;
  adj[cur].push_back(color[a]);
  adj[cur].push_back(color[b]);
  if (siz[b] > siz[a]) swap(a, b);
  siz[a] += siz[b];
  par[b] = a;
  color[a] = cur;
}
void dfs(int x) {
  if (x <= n)
    ans.push_back(x);
  else
    for (int i = 0; i < adj[x].size(); i++) dfs(adj[x][i]);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  for (int i = 1; i <= n; i++) {
    par[i] = i;
    siz[i] = 1;
    color[i] = i;
  }
  cur = n;
  for (int i = 1; i < n; i++) {
    int a, b;
    cin >> a >> b;
    dsu_union(a, b);
  }
  dfs(cur);
  for (auto elem : ans) {
    cout << elem << " ";
  }
  cout << '\n';
  return 0;
}
