#include <bits/stdc++.h>
using namespace std;
const int MAXN = 150005;
vector<int> ve[MAXN];
int par[MAXN];
int n;
int root(int v) {
  if (par[v] < 0) {
    return v;
  }
  return root(par[v]);
}
void merg(int v, int u) {
  v = root(v);
  u = root(u);
  if (u == v) {
    return;
  }
  if (par[u] < par[v]) {
    swap(u, v);
  }
  for (int i = 0; i < ve[u].size(); i++) {
    ve[v].push_back(ve[u][i]);
  }
  par[v] += par[u];
  par[u] = v;
}
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    par[i] = -1;
    ve[i].push_back(i);
  }
  int u, v;
  for (int i = 0; i < n - 1; i++) {
    cin >> u >> v;
    merg(u, v);
  }
  int k = root(1);
  for (int i = 0; i < ve[k].size(); i++) {
    cout << ve[k][i] << ' ';
  }
}
