#include <bits/stdc++.h>
using namespace std;
vector<long long> x;
vector<vector<long long> > tree;
vector<long long> ans;
long long an;
long long dfs(long long a, long long b) {
  vector<long long> z;
  for (auto i : tree[a]) {
    if (i != b) {
      long long k = dfs(i, a);
      if (k != 0) {
        z.push_back(k);
      }
    }
  }
  an += 2 * (long long)z.size();
  long long n = (long long)z.size();
  if ((n & 1)) {
    z.push_back(a);
    for (long long j = 0; j < (long long)z.size(); j += 2) {
      ans[z[j]] = z[j + 1];
      ans[z[j + 1]] = z[j];
    }
    return 0;
  } else {
    for (long long j = 0; j < (long long)z.size(); j += 2) {
      ans[z[j]] = z[j + 1];
      ans[z[j + 1]] = z[j];
    }
    if ((long long)z.size() != 0) {
      long long p = z.back();
      long long q = z[(long long)z.size() - 2];
      long long r = a;
      ans[p] = q;
      ans[q] = r;
      ans[r] = p;
      return 0;
    } else if (a == 1) {
      long long p = tree[1][0];
      long long q = ans[p];
      long long r = 1;
      ans[p] = r;
      ans[r] = q;
      an += 2;
    }
    return a;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long a;
  cin >> a;
  tree = vector<vector<long long> >(a + 1);
  ans = vector<long long>(a + 1);
  for (long long j = 0; j < a - 1; j++) {
    long long u, v;
    cin >> u >> v;
    tree[u].push_back(v);
    tree[v].push_back(u);
  }
  dfs(1, 1);
  cout << an << "\n";
  for (long long j = 1; j < a + 1; j++) {
    cout << ans[j] << " ";
  }
  return 0;
}
