#include <bits/stdc++.h>
using namespace std;
const int N = 150005;
int n;
vector<int> adj[N];
vector<int> ans;
int p[N], w[N];
int st[N], ed[N];
int f(int u) {
  if (u == p[u]) return u;
  return p[u] = f(p[u]);
}
bool is_connected(int a, int b) { return f(a) == f(b); }
void connect(int a, int b) {
  a = f(a);
  b = f(b);
  if (a == b) return;
  if (w[a] < w[b]) swap(a, b);
  w[a] += w[b];
  p[b] = a;
  adj[ed[a]].push_back(st[b]);
  adj[st[b]].push_back(ed[a]);
  ed[a] = ed[b];
}
void init() {
  for (int i = 0; i < N; i++) p[i] = i, w[i] = 1, st[i] = i, ed[i] = i;
}
void dfs(int u, int par = -1) {
  ans.push_back(u);
  for (int nxt : adj[u]) {
    if (nxt == par) continue;
    dfs(nxt, u);
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  init();
  cin >> n;
  int x, y;
  for (int i = 0; i < int(n - 1); i++) {
    cin >> x >> y;
    connect(x, y);
  }
  bool found = false;
  for (int i = int(1); i <= int(n); i++) {
    if (int(adj[i].size()) == 1) {
      found = true;
      dfs(i);
      break;
    }
  }
  assert(found);
  for (int u : ans) cout << u << " ";
  return 0;
}
