#include <bits/stdc++.h>
using namespace std;
vector<int> g[150100];
int pai[150100];
int find(int x) {
  if (pai[x] == x) return x;
  return pai[x] = find(pai[x]);
}
void join(int x, int y) {
  x = find(x), y = find(y);
  if (g[y].size() >= g[x].size()) swap(x, y);
  pai[y] = x;
  for (int i = 0; i < g[y].size(); i++) {
    g[x].push_back(g[y][i]);
  }
  g[y].clear();
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    g[i].push_back(i);
    pai[i] = i;
  }
  for (int i = 0, a, b; i < n - 1; i++) {
    scanf("%d%d", &a, &b);
    join(a, b);
  }
  int x = find(1);
  for (int i = 0; i < n; i++) {
    printf("%d ", g[x][i]);
  }
  printf("\n");
  return 0;
}
