#include <bits/stdc++.h>
using namespace std;
long long sigma(long long n) { return (n * (n + 1) / 2); }
long long MOD(long long x) {
  if (x >= 0) return x;
  return (-x);
}
bool great(long long a, long long b) { return a > b; }
bool p_sm(pair<long long, long long> a, pair<long long, long long> b) {
  if (a.first == b.first) {
    return (a.second < b.second);
  }
  return (a.first < b.first);
}
long long max3(long long a, long long b, long long c) {
  return (max(a, max(b, c)));
}
long long max4(long long a, long long b, long long c, long long d) {
  return (max(max(a, b), max(c, d)));
}
long long min3(long long a, long long b, long long c) {
  return (min(a, min(b, c)));
}
long long min4(long long a, long long b, long long c, long long d) {
  return (min(min(a, b), min(c, d)));
}
vector<long long> factors(long long x) {
  vector<long long> v;
  for (int i = 1; i * i <= x; i++) {
    if (x % i == 0) {
      v.push_back(i);
      if (i != x / i) {
        v.push_back(x / i);
      }
    }
  }
  return v;
}
long long min_prime[1000006];
bool ispr[1000006];
void strt() {
  for (int i = 0; i < 1000005; i++) {
    min_prime[i] = -1;
  };
  for (int i = 0; i < 1000005; i++) {
    ispr[i] = true;
  };
  for (long long i = 2; i * i <= 1000005; i++) {
    if (!ispr[i]) {
      continue;
    }
    for (long long j = i * i; j <= 1000005; j += i) {
      if (min_prime[j] == -1) min_prime[j] = i;
      ispr[j] = false;
    }
  }
  for (long long i = 2; i < 1000006; i++) {
    if (ispr[i]) {
      min_prime[i] = i;
    }
  }
}
map<long long, long long> prime_fact(long long x) {
  map<long long, long long> mp;
  while (x != 1) {
    mp[min_prime[x]]++;
    x /= min_prime[x];
  }
  return mp;
}
long long power(long long a, long long b, long long m) {
  long long ans = 1;
  while (b > 0) {
    if (b % 2) {
      ans = (ans * a) % m;
    }
    a = (a * a) % m;
    b = b / 2;
  }
  return ans;
}
long long n;
vector<pair<long long, long long>> a;
vector<long long> baap;
long long root(long long x) {
  while (baap[x] != x) {
    baap[x] = baap[baap[x]];
    x = baap[x];
  }
  return x;
}
int main() {
  long long n;
  cin >> n;
  a.resize(n);
  vector<vector<pair<long long, long long>>> dp;
  dp.resize(n);
  long long cc = -1;
  for (long long i = 0; i < n - 1; i++) {
    long long x, y;
    cin >> x >> y;
    --x;
    --y;
    a[i] = make_pair(x, y);
  }
  baap.resize(n);
  long long tail[n];
  long long next[n];
  for (long long i = 0; i < n; i++) {
    baap[i] = i;
    tail[i] = i;
    next[i] = -1;
  }
  for (long long i = 0; i < n - 1; i++) {
    long long baap_a = root(a[i].first);
    long long baap_b = root(a[i].second);
    next[tail[baap_a]] = baap_b;
    tail[baap_a] = tail[baap_b];
    baap[baap_b] = baap_a;
  }
  long long xx;
  long long prev[n];
  for (long long i = 0; i < n; i++) {
    if (next[i] == -1) {
      xx = i;
    }
  }
  for (long long i = 0; i < n; i++) {
    if (next[i] != -1) {
      prev[next[i]] = i;
    }
  }
  long long i = 0;
  while (i < n) {
    cout << xx + 1 << " ";
    xx = prev[xx];
    i++;
  }
}
