#include <bits/stdc++.h>
using namespace std;
class UnionFind {
 public:
  vector<int> p, rank, a, b, pp;
  UnionFind() {}
  UnionFind(int N) {
    p = rank = a = b = pp = vector<int>(N, 0);
    for (int i = 0; i < N; ++i) p[i] = pp[i] = a[i] = b[i] = i;
  }
  int findSet(int i) { return (p[i] == i) ? i : (p[i] = findSet(p[i])); }
  bool isSameSet(int i, int j) { return findSet(i) == findSet(j); }
  void unionSet(int i, int j) {
    if (!isSameSet(i, j)) {
      int x = findSet(i), y = findSet(j);
      if (rank[x] > rank[y]) {
        p[y] = x;
        pp[a[y]] = b[x];
        b[x] = b[y];
      } else {
        p[x] = y;
        pp[a[x]] = b[y];
        b[y] = b[x];
        if (rank[x] == rank[y]) ++rank[y];
      }
    }
  }
};
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  UnionFind UF(n);
  for (int i = 1; i < n; ++i) {
    int x, y;
    cin >> x >> y;
    --x, --y;
    UF.unionSet(x, y);
  }
  int u = UF.b[UF.findSet(0)];
  int cnt = 0;
  while (cnt < n) {
    cout << u + 1 << ' ';
    u = UF.pp[u];
    ++cnt;
  }
  cout << '\n';
}
