#include <bits/stdc++.h>
using namespace std;
int power(int x, int y, int z) {
  int ret = 1;
  while (y > 0) {
    if (y & 1) ret = (ret * x) % z;
    x = (x * x) % z;
    y >>= 1;
  }
  return ret;
}
const int N = 150001;
int P[N], sz[N];
vector<int> A[N];
int find(int x) {
  if (x == P[x]) return x;
  return P[x] = find(P[x]);
}
void unio(int x, int y) {
  int rx = find(x), ry = find(y);
  if (rx == ry) assert(0);
  if (sz[rx] > sz[ry]) {
    P[ry] = rx;
    for (auto u : A[ry])
      if (u != ry) A[u].clear(), A[u].shrink_to_fit();
    for (auto u : A[ry]) A[rx].push_back(u);
    A[ry].clear();
    A[ry].shrink_to_fit();
    sz[rx] += sz[ry];
  } else {
    P[rx] = ry;
    for (auto u : A[rx])
      if (u != rx) A[u].clear(), A[u].shrink_to_fit();
    for (auto u : A[rx]) A[ry].push_back(u);
    A[rx].clear();
    A[rx].shrink_to_fit();
    sz[ry] += sz[rx];
  }
  return;
}
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; ++i) P[i] = i, A[i].push_back(i), sz[i] = 1;
  for (int i = 1; i <= n - 1; ++i) {
    int x, y;
    cin >> x >> y;
    unio(x, y);
  }
  int x = find(1);
  for (auto u : A[x]) printf("%d ", u);
  printf("\n");
  return 0;
}
