#include <bits/stdc++.h>
using namespace std;
int n, p[160010], last[160010], nxt[160010];
int par(int x) {
  if (x == p[x]) {
    return x;
  }
  return p[x] = par(p[x]);
}
void join(int a, int b) {
  a = par(a), b = par(b);
  nxt[last[a]] = b;
  last[a] = last[b];
  p[b] = a;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    p[i] = i;
    last[i] = i;
  }
  for (int i = 1; i < n; ++i) {
    int x, y;
    cin >> x >> y;
    join(x, y);
  }
  for (int i = par(1), c = 0; c < n; ++c, i = nxt[i]) {
    cout << i << ' ';
  }
}
