#include <bits/stdc++.h>
using namespace std;
struct Union_find {
  int par[150010];
  int rank[150010];
  int l[150010], next[150010], n;
  void init(int _n) {
    n = _n;
    for (int i = 1; i <= n; i++) {
      par[i] = l[i] = next[i] = i;
      rank[i] = 0;
    }
  }
  int find(int x) {
    if (par[x] == x) return x;
    return par[x] = find(par[x]);
  }
  bool unite(int x, int y) {
    x = find(x);
    y = find(y);
    if (x == y) return 0;
    if (rank[x] < rank[y]) {
      par[x] = y;
      next[x] = l[y];
      l[y] = l[x];
    } else {
      par[y] = x;
      next[y] = l[x];
      l[x] = l[y];
      if (rank[x] == rank[y]) rank[x]++;
    }
    return 1;
  }
  bool same(int x, int y) { return find(x) == find(y); }
  void print() {
    int u = 0;
    for (int i = 1; i <= n; i++) {
      u ^= i;
      if (next[i] != i) u ^= next[i];
    }
    for (int i = 0; i < n; i++) {
      cout << u << " ";
      u = next[u];
    }
    cout << endl;
  }
} uf;
void solve(int n) {
  uf.init(n);
  int u, v;
  for (int i = 1; i < n; i++) {
    cin >> u >> v;
    uf.unite(u, v);
  }
  uf.print();
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int t = 1;
  int n;
  while (t--) {
    cin >> n;
    solve(n);
  }
  return 0;
}
