#include <bits/stdc++.h>
using namespace std;
const int N = 500500;
const int mod = 1e9 + 7;
int n, m;
int p[N];
int nxt[N];
int r[N], l[N];
int used[N];
vector<int> g[N];
inline int get(int x) {
  if (p[x] == x) return x;
  return p[x] = get(p[x]);
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  for (int i = 1; i <= n; ++i) p[i] = i, l[i] = i, r[i] = i;
  for (int i = 1; i <= n - 1; ++i) {
    int a, b;
    cin >> a >> b;
    a = get(a);
    b = get(b);
    p[b] = a;
    nxt[r[a]] = l[b];
    r[a] = r[b];
  }
  for (int i = 1; i <= n; ++i) {
    used[nxt[i]] = 1;
  }
  int st = -1;
  for (int i = 1; i <= n; ++i)
    if (!used[i]) st = i;
  for (int i = 1; i <= n; ++i) {
    cout << st << ' ';
    st = nxt[st];
  }
  return 0;
}
