#include <bits/stdc++.h>
using namespace std;
const long double EPS = 1e-9, PI = acos(-1.);
const int INF = 0x3f3f3f3f, MOD = 1e9 + 7;
const int N = 2e5 + 5;
int n;
int pa[N], sz[N];
pair<int, int> inter[N];
int nex[N], pre[N];
int find(int a) { return pa[a] == a ? a : pa[a] = find(pa[a]); }
void unite(int a, int b) {
  if ((a = find(a)) == (b = find(b))) return;
  if (sz[a] < sz[b]) swap(a, b);
  pa[b] = a;
  sz[a] += b;
  pre[inter[b].first] = inter[a].second;
  nex[inter[a].second] = inter[b].first;
  inter[a].second = inter[b].second;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) sz[i] = 1, pa[i] = i, inter[i] = {i, i};
  for (int i = 1; i < n; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    unite(x, y);
  }
  int a = find(1);
  while (pre[a] != 0) a = pre[a];
  while (a != 0) printf("%d ", a), a = nex[a];
  printf("\n");
  return 0;
}
