#include <bits/stdc++.h>
using namespace std;
const int MAXN = 150005;
struct UF {
  int par[MAXN], siz[MAXN];
  UF() { init(); }
  void init() {
    for (int i = 0; i < MAXN; i++) {
      par[i] = i;
      siz[i] = 1;
    }
  }
  int find(int x) {
    if (par[x] == x)
      return x;
    else
      return find(par[x]);
  }
  void merge(int u, int v) {
    int a = find(u);
    int b = find(v);
    if (a == b) return;
    if (siz[a] > siz[b]) swap(a, b);
    par[a] = b;
    siz[b] += siz[a];
  }
};
vector<int> edges[MAXN];
bool vis[MAXN];
void dfs(int u) {
  vis[u] = true;
  printf("%d ", u);
  for (int v : edges[u])
    if (!vis[v]) dfs(v);
}
int main() {
  int n;
  scanf("%d", &n);
  UF uf;
  for (int i = 1; i <= n - 1; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    int u = uf.find(x);
    int v = uf.find(y);
    edges[u].push_back(y);
    edges[v].push_back(x);
    uf.merge(x, y);
  }
  dfs(uf.find(1));
  printf("\n");
  return 0;
}
