#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
vector<pair<int, int>> ptr[N][2];
vector<int> adj[N];
vector<int> swp[N][2];
int dp[N][2];
int pos[N];
int n;
bool vis[N];
void dfs(int u, int p) {
  for (int v : adj[u])
    if (v != p) dfs(v, u);
  vector<pair<int, int>> best;
  for (int v : adj[u])
    if (v != p) {
      dp[u][1] += min(dp[v][0], dp[v][1] + 2);
      if (dp[v][1] + 2 < dp[v][0]) {
        ptr[u][1].push_back(make_pair(v, 1));
        swp[u][1].push_back(v);
      } else
        ptr[u][1].push_back(make_pair(v, 0));
      dp[u][0] += dp[v][0];
      best.push_back(make_pair(dp[v][1] + 2 - dp[v][0], v));
    }
  if (best.size()) {
    sort(best.begin(), best.end());
    vis[best[0].second] = true;
    dp[u][0] += best[0].first;
    for (int i = 1; i < best.size(); i++)
      if (best[i].first < 0) {
        dp[u][0] += best[i].first;
        vis[best[i].second] = true;
      }
    for (int v : adj[u])
      if (v != p) {
        ptr[u][0].push_back(make_pair(v, vis[v]));
        if (vis[v]) {
          vis[v] = 0;
          swp[u][0].push_back(v);
        }
      }
  } else {
    dp[u][0] += 2;
    swp[u][0].push_back(p);
  }
}
void trace(int u, int i) {
  for (pair<int, int> node : ptr[u][i]) trace(node.first, node.second);
  for (int v : swp[u][i]) swap(pos[u], pos[v]);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  for (int i = 1; i < n; i++) {
    int u, v;
    cin >> u >> v;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  dfs(1, -1);
  cout << dp[1][0] << "\n";
  iota(pos + 1, pos + 1 + n, 1);
  trace(1, 0);
  for (int i = 1; i <= n; i++) cout << pos[i] << " ";
  return 0;
}
