#include <bits/stdc++.h>   using namespace std;   const int MAX_N = 17;   int n;   vector<int> adj[(1 << MAX_N) + 9];   bool used[(1 << MAX_N) + 9];   int cnt[(1 << MAX_N) + 9];   vector<int> vRoot;   vector<int> ans;   void buildCnt(int x) {     used[x] = true;     cnt[x] = 1;     for (int y : adj[x]) {       if (!used[y]) {         buildCnt(y);         cnt[x] += cnt[y];       }     }     used[x] = false;   }   void findRoot(int x, vector<int>& vRoot) {     used[x] = true;     for (int y : adj[x]) {       if (!used[y]) {         findRoot(y, vRoot);       }     }     if ((1 << n) - 2 - cnt[x] == (1 << n - 1) - 1) {       vRoot.push_back(x);     } else {       for (int y : adj[x]) {         if (!used[y]) {           if (cnt[y] == (1 << n - 1) - 1) {             vRoot.push_back(x);             break;           }         }       }     }     used[x] = false;   }   bool checkTree1(int x, int depth) {     used[x] = true;     bool result = false;     if (cnt[x] != (1 << depth) - 1) {       result = false;     } else if (depth == 1) {       result = true;     } else {       result = true;       for (int y : adj[x]) {         if (!used[y]) {           if (!checkTree1(y, depth - 1)) {             result = false;             break;           }         }       }     }     used[x] = false;     return result;   }   int checkTree2(int x, int depth) {     used[x] = true;     int result = -1;     if (cnt[x] != (1 << depth) - 2) {       result = -1;     } else if (depth == 2) {       result = x;     } else {       vector<pair<int, int>> children;       for (int y : adj[x]) {         if (!used[y]) {           children.push_back(make_pair(cnt[y], y));         }       }       sort(children.begin(), children.end());       if (children.size() == 2) {         int tmp = checkTree2(children[0].second, depth - 1);         if (tmp != -1 && checkTree1(children[1].second, depth - 1)) {           result = tmp;         } else {           result = -1;         }       } else if (children.size() == 3) {         if (checkTree1(children[0].second, depth - 2) &&             checkTree1(children[1].second, depth - 2) &&             checkTree1(children[2].second, depth - 1)) {           result = x;         } else {           result = -1;         }       } else {         result = -1;       }     }     used[x] = false;     return result;   }   int main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     cin >> n;     for (int i = 1; i <= (1 << n) - 3; i++) {       int x;       int y;       cin >> x >> y;       adj[x].push_back(y);       adj[y].push_back(x);     }     buildCnt(1);     findRoot(1, vRoot);     for (int root : vRoot) {       buildCnt(root);       int x = checkTree2(root, n);       if (x != -1) {         ans.push_back(x);       }     }     sort(ans.begin(), ans.end());     cout << ans.size() <<   n ;     for (int x : ans) {       cout << x <<    ;     }     cout <<   n ;     return 0;   }   