#include <bits/stdc++.h>
using namespace std;
int par[150008], sz[150008];
int n;
deque<int> dq[150008];
int find(int u) { return (par[u] == u) ? u : find(par[u]); }
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  for (int i = 1; i <= n; i++) {
    sz[i] = 1;
    par[i] = i;
    dq[i].push_back(i);
  }
  for (int i = 1; i < n; i++) {
    int u, v;
    cin >> u >> v;
    int x = find(u);
    int y = find(v);
    int mn = min(x, y);
    if (sz[y] > sz[x]) {
      sz[y] += sz[x];
      par[x] = y;
      for (int i = 0; i < dq[x].size(); i++) {
        dq[y].push_back(dq[x][i]);
        par[dq[x][i]] = y;
      }
    } else {
      if (sz[x] == sz[y]) {
        if (x > y) {
          swap(x, y);
        }
      }
      sz[x] += sz[y];
      par[y] = x;
      for (int i = 0; i < dq[y].size(); i++) {
        dq[x].push_back(dq[y][i]);
        par[dq[y][i]] = x;
      }
    }
  }
  int pos = -1;
  for (int i = 1; i <= n; i++) {
    if (dq[i].size() == n) {
      pos = i;
      break;
    }
  }
  for (int i = 0; i < dq[pos].size(); i++) {
    cout << dq[pos][i] << " ";
  }
  cout << endl;
  return 0;
}
