#include <bits/stdc++.h>
using namespace std;
int pl[150000 + 10], pr[150000 + 10], nxt[150000 + 10], pre[150000 + 10];
pair<int, int> arr[150000 + 10];
int findset1(int i) {
  if (pl[i] == i) return i;
  return pl[i] = findset1(pl[i]);
}
int findset2(int i) {
  if (pr[i] == i) return i;
  return pr[i] = findset2(pr[i]);
}
void unionset(int i, int j) {
  int u = findset1(i);
  int v = findset2(i);
  int x = findset1(j);
  int y = findset2(j);
  pr[u] = pr[v] = pr[i] = y;
  pl[x] = pl[y] = pl[j] = u;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  for (int i = 1; i < n; i++) {
    cin >> arr[i].first >> arr[i].second;
  }
  for (int i = 1; i <= n; i++) {
    pl[i] = pr[i] = nxt[i] = pre[i] = i;
  }
  for (int i = 1; i < n; i++) {
    int u = findset2(findset1(arr[i].first));
    int v = findset1(findset2(arr[i].second));
    nxt[u] = v;
    pre[v] = u;
    unionset(arr[i].first, arr[i].second);
  }
  int ans[n + 1];
  ans[1] = findset1(1);
  int now = ans[1];
  for (int i = 2; i <= n; i++) {
    ans[i] = nxt[now];
    now = ans[i];
  }
  for (int i = 1; i <= n; i++) {
    cout << ans[i] << " ";
  }
  cout << "\n";
}
