#include <bits/stdc++.h>
using namespace std;
long long nxt[222222];
long long mn[222222];
long long mx[222222];
long long dg[222222];
long long pj(long long y) {
  while (mn[y] != y) y = mn[y];
  return y;
}
long long pjj(long long x) {
  while (mx[x] != x) x = mx[x];
  return x;
}
void j(long long x, long long y) {
  long long z = pjj(y);
  long long zz = pj(x);
  dg[z]++;
  long long tz = z;
  long long tzz = zz;
  mn[tzz] = z;
  mn[x] = z;
  mx[y] = zz;
  mx[tz] = zz;
  nxt[zz] = z;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    mn[i] = i;
    mx[i] = i;
  }
  long long x, y;
  for (int i = 1; i < n; i++) {
    cin >> x >> y;
    j(x, y);
  }
  long long z = -1;
  for (int i = 1; i <= n; i++) {
    if (dg[i] == 0) {
      z = i;
      break;
    }
  }
  while (nxt[z]) {
    cout << z << " ";
    z = nxt[z];
  }
  cout << z << endl;
  return 0;
}
