#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 10;
unsigned long long qz[maxn];
struct Tree {
  unsigned long long h[maxn];
  vector<int> g[maxn], rt;
  int sz[maxn] = {0}, mx = -1, N = -1;
  void add(int x, int y) {
    g[x].push_back(y);
    g[y].push_back(x);
  }
  void build(int n, int x) {
    N = (1ll << n) - 1;
    int t = 1ll << (x - 1);
    for (int i = 2; i <= N; ++i) {
      if (i != t && i / 2 != t)
        add(i, i / 2);
      else if (i / 2 == t)
        add(i, i / 2 / 2);
    }
    mx = N = (1ll << n) - 2;
  }
  void dfs(int u, int fa) {
    sz[u] = 1;
    int tmp = 0;
    for (int v : g[u]) {
      if (v == fa) continue;
      dfs(v, u);
      sz[u] += sz[v];
      tmp = max(tmp, sz[v]);
    }
    tmp = max(tmp, N - sz[u]);
    if (tmp < mx) {
      mx = tmp;
      rt.clear();
      rt.push_back(u);
    } else if (mx == tmp) {
      rt.push_back(u);
    }
  }
  void hash_dfs(int u, int fa) {
    h[u] = sz[u] = 1;
    for (int v : g[u]) {
      if (v == fa) continue;
      hash_dfs(v, u);
      h[u] += h[v] ^ qz[sz[v]];
      sz[u] += sz[v];
    }
    h[u] *= qz[N - sz[u]];
  }
  vector<vector<unsigned long long>> all;
  unsigned long long hashV() {
    dfs(1, 0);
    unsigned long long hv = 1;
    for (int r : rt) {
      hash_dfs(r, 0);
      hv *= h[r];
      vector<unsigned long long> tmp(1, h[r]);
      for (int i = 1; i <= N; ++i) tmp.push_back(h[i]);
      all.push_back(tmp);
    }
    return hv;
  }
} tr[22], tt;
unsigned long long H[22];
int main() {
  for (int i = 0; i < maxn; ++i) qz[i] = (unsigned long long)rand() * rand();
  int n;
  scanf("%d", &n);
  for (int i = 2; i <= n; ++i) {
    tr[i].build(n, i);
    H[i] = tr[i].hashV();
  }
  for (int i = 1; i <= (1 << n) - 3; ++i) {
    int u, v;
    scanf("%d %d", &u, &v);
    tt.add(u, v);
  }
  tt.mx = tt.N = (1ll << n) - 2;
  unsigned long long HH = tt.hashV();
  int ok = 0;
  for (int i = 2; i <= n; ++i) {
    if (H[i] == HH) {
      ok = 1;
      set<int> ans;
      for (auto v1 : tr[i].all)
        for (auto v2 : tt.all)
          if (v1[0] == v2[0])
            for (int j = 1; j <= (1 << n) - 2; ++j)
              if (v1[(1ll << (i - 1)) / 2] == v2[j]) ans.insert(j);
      printf("%d\n", ans.size());
      for (int a : ans) printf("%d ", a);
    }
  }
  if (!ok) puts("0");
  return 0;
}
