#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 9;
int f[maxn], cnt[maxn];
vector<int> vec[maxn];
void init() {
  for (int i = 0; i < maxn; i++) f[i] = i;
}
int find(int v) {
  if (f[v] == v) return v;
  return f[v] = find(f[v]), f[v];
}
void solve(int v) {
  for (int i = 0; i < vec[v].size(); i++) {
    cout << vec[v][i] << ' ';
    solve(vec[v][i]);
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int i, j, k, n;
  cin >> n;
  init();
  for (i = 1; i < n; i++) {
    int x, y, t1, t2;
    cin >> x >> y;
    t1 = find(x);
    t2 = find(y);
    if (t1 != t2) {
      vec[t1].push_back(t2);
      cnt[t2]++;
      f[t2] = t1;
    }
  }
  for (i = 1; i <= n; i++) {
    if (cnt[i] == 0) {
      cout << i << ' ';
      solve(i);
      return 0;
    }
  }
}
