#include <bits/stdc++.h>
template <class T>
bool umin(T& a, T b) {
  return a > b ? (a = b, true) : false;
}
template <class T>
bool umax(T& a, T b) {
  return a < b ? (a = b, true) : false;
}
using namespace std;
int get_part(int p, const vector<int>& pa) {
  while (pa[p] != p) {
    p = pa[p];
  }
  return p;
}
void update_part(int p, int np, vector<int>& pa) {
  while (pa[p] != p) {
    int next = pa[p];
    pa[p] = np;
    p = next;
  }
  pa[p] = np;
}
int main(int argc, char** argv) {
  int n, u, v;
  scanf("%d", &n);
  vector<int> pa(n), ne(n), st(n), en(n);
  for (int i = 0; i < (int)(n); ++i) {
    pa[i] = st[i] = en[i] = ne[i] = i;
  }
  for (int i = 0; i < (int)(n - 1); ++i) {
    scanf("%d %d", &u, &v);
    --u, --v;
    int up = get_part(u, pa);
    int vp = get_part(v, pa);
    assert(up != vp);
    update_part(u, up, pa);
    update_part(v, vp, pa);
    int evp = en[vp];
    int eup = en[up];
    int svp = st[vp];
    ne[eup] = svp;
    en[up] = evp;
    update_part(vp, up, pa);
  }
  int start = get_part(0, pa);
  for (int i = 0; i < (int)(n); ++i) {
    cout << start + 1 << " ";
    start = ne[start];
  }
  cout << endl;
  return 0;
}
