#include<bits/stdc++.h>
using namespace std;

const int MX = (1 << 17) + 5;

int n, cnt[7], num[MX], vis[MX], siz[MX], deg[MX];
vector<int> G[MX];

int NoSolution() {
	puts("0\n");
	return 0;
}
void Solved(int val) {
	printf("1\n%d", val);
	exit(0);
}

void erase(vector<int> &vec, int val) {
	for(auto i = vec.begin(); i != vec.end(); i++)
		if(*i == val) {
			vec.erase(i);
			return;
		}
	throw;
}

void dfs(int u, int dep, int f, const int cnt) {
	if(vis[dep] != cnt) vis[dep] = cnt, num[dep] = 0;
	++num[dep];
	for(int v : G[u])
		if(v != f) dfs(v, dep + 1, u, cnt);
}

void check_leaf(int u, int v, int root) {
	static int cnt = 0;
	++cnt;
	G[u].push_back(v);
	G[v].push_back(u);
	dfs(root, 0, -1, cnt);
	for(int i = 0; i < n; i++)
		if(vis[i] != cnt || (num[i] != 1 << i)) {
			erase(G[u], v), erase(G[v], u);
			return;
		}
	return Solved(u);
}

bool precheck_mid() {
	int val = cnt[1];
	return cnt[2] == 1 && cnt[4] == 1 && val == (val & -val);
}
bool dfs2(int u, int f) {
	vector<int> sonsize;
	siz[u] = 1;
	for(int v : G[u]) if(v != f) {
		if(!dfs2(v, u))
			return false;
		siz[u] += siz[v];
		sonsize.push_back(siz[v]);
	}
	if(G[u].size() == 4) {
		++siz[u];
		sort(sonsize.begin(), sonsize.end());
		return sonsize[0] == sonsize[1] && sonsize[2] == sonsize[0] * 2 + 1;
	} else {
		assert(sonsize.size() == 2 || sonsize.empty());
		return sonsize.empty() || sonsize[0] == sonsize[1];
	}
}

int fa[MX], dis[MX];
void dfs3(int u, int f) {
	for(int v : G[u]) if(v != f)
		fa[v] = u, dis[v] = dis[u] + 1, dfs3(v, u);
}

int solve_nd(int N) {
	dfs3(1, -1);
	int u = max_element(dis + 1, dis + N + 1) - dis;
	fa[u] = dis[u] = 0;
	dfs3(u, -1);
	int v = max_element(dis + 1, dis + N + 1) - dis;
	if(dis[v] % 2 == 0) return NoSolution();
	int k = dis[v] / 2;
	for(int i = 1; i <= k; i++) v = fa[v];
	bool ans = true;
	for(int node : G[v]) if(node != fa[v])
		ans = ans && dfs2(node, v);
	for(int node : G[fa[v]]) if(node != v)
		ans = ans && dfs2(node, fa[v]);
	if(ans) {
		int x = v, y = fa[v];
		if(x > y) swap(x, y);
		printf("2\n%d %d", x, y);
		return 0;
	} else {
		puts("0");
	}
}

int main() {
	ios::sync_with_stdio(false);
	cin >> n;
	if(n == 2)
		return puts("2\n1 2"), 0;
	int N = (1 << n) - 2;
	for(int i = 1; i < N; i++) {
		int u, v;
		cin >> u >> v;
		G[u].push_back(v);
		G[v].push_back(u);
	}
	for(int i = 1; i <= N; i++) {
		if(G[i].size() >= 5)
			return NoSolution();
		cnt[G[i].size()]++;
	}
	if(cnt[2] > 2) return NoSolution();
	else if(cnt[2] == 2) {
		int u = -1, v = -1;
		for(int i = 1; i <= N; i++)
			if(G[i].size() == 2) (u == -1 ? u : v) = i;
		check_leaf(u, N + 1, v);
		check_leaf(v, N + 1, u);
	} else if(cnt[2] == 1) {
		if(!precheck_mid()) return NoSolution();
		int root = -1, fa = -1;
		for(int i = 1; i <= N; i++) {
			if(G[i].size() == 2) root = i;
			if(G[i].size() == 4) fa = i;
		}
		if(dfs2(root, -1)) Solved(fa);
	} else return solve_nd(N);
	return NoSolution();
}
/*
3
1 2
1 3
2 4
2 5
3 6

*/


/*input
3
1 2
2 3
3 4
4 5
5 6

*/
#include <bits/stdc++.h>
#pragma GCC optimize("unroll-loops,no-stack-protector")
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<ld,ld> pdd;
#define IOS ios_base::sync_with_stdio(0); cin.tie(0)
#define ALL(a) a.begin(),a.end()
#define SZ(a) ((int)a.size())
#define F first
#define S second
#define REP(i,n) for(int i=0;i<((int)n);i++)
#define eb emplace_back
#define pb push_back
#define MP(a,b) make_pair(a,b)
#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define GET_POS(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
#define EL cout<<'\n'
template<typename T1,typename T2>
ostream& operator<<(ostream& out,pair<T1,T2> P){
	out<<'('<<P.F<<','<<P.S<<')';
	return out;
}
template<typename T>
ostream& operator<<(ostream& out,vector<T> V){
	REP(i,SZ(V)) out<<V[i]<<((i!=SZ(V)-1)?" ":"");
	return out;
}
#define version 20190814
//}}}
const ll maxn=1005;
const ll maxlg=20;
const ll INF64=1e18;
const int INF=0x3f3f3f3f;
const ll MOD=ll(1e9+7);
const ld PI=acos(-1);
const ld eps=1e-9;
//const ll p=880301;
//const ll P=31;

ll mypow(ll a,ll b){
	ll res=1LL;
	while(b){
		if(b&1) res=res*a%MOD;
		a=a*a%MOD;
		b>>=1;
	}
	return res;
}

int N;
vector<int> edge[maxn];

bool vis[maxn];
int sz[maxn],dep[maxn];

void dfs(int u){
	vis[u]=1;
	sz[u]=1;
	for(int v:edge[u]) if(!vis[v]){
		dep[v]=dep[u]+1;
		dfs(v);
		sz[u]+=sz[v];
	}
}

int far(int u){
	REP(i,N) vis[i]=0;
	dfs(u);
	return max_element(dep,dep+N)-dep;
}

vector<int> path;

bool getPath(int u,int v){
	vis[u]=1;
	path.pb(u);
	if(u==v){
		return 1;
	}
	for(int nxt:edge[u]) if(!vis[nxt]){
		if(getPath(nxt,v)) return 1;
	}
	path.pop_back();
	return 0;
}
vector<int> ans;

bool isFull(int u){
	vis[u]=1;
	vector<int> s;
	for(int v:edge[u]) if(!vis[v]){
		if(!isFull(v)) return 0;
		s.pb(sz[v]);
	}
	if(SZ(s)==0) return 1;
	if(SZ(s)!=2) return 0;
	if(s[0]!=s[1]) return 0;
	return 1;
}

int DFS(int u){
	vis[u]=1;
	vector<int> s;
	int ret=-1;
	for(int v:edge[u]) if(!vis[v]){
		s.pb(sz[v]);
	}
	sort(ALL(s));
	if(SZ(s)==0) return -1;
	if(SZ(s)==1){
		if(sz[u]==2) return u;
		else return -1;
	}
	if(SZ(s)==3){
		if(s[0]==s[1]&&s[1]+s[1]+1==s[2]){
			for(int v:edge[u]) if(!vis[v]){
				if(!isFull(v)) return -1;
			}
			return u;
		}
		else return -1;
	}
	if(SZ(s)==2){
		if(s[0]!=s[1]-1) return -1;
		for(int v:edge[u]) if(!vis[v]){
			if(sz[v]==s[0]){
				if((ret=DFS(v))==-1) return -1;
			}
			else{
				if(!isFull(v)) return -1;
			}
		}
		return ret;
	}
	return -1;
}

void check(int root){
	REP(i,N) vis[i]=0;
	dfs(root);
	REP(i,N) vis[i]=0;
	int tmp=DFS(root);
	if(tmp!=-1){
		ans.pb(tmp+1);
	}
}

int main(){
	IOS;
	int n;
	cin>>n;
	N=(1<<n)-2;
	REP(i,N-1){
		int u,v;
		cin>>u>>v;
		u--;v--;
		edge[u].pb(v);
		edge[v].pb(u);
	}

	{
		int a=0;
		a=far(a);
		int b=far(a);
		REP(i,N) vis[i]=0;
		getPath(a,b);
	}
	check(path[SZ(path)/2]);
	check(path[SZ(path)/2-1]);
	SORT_UNIQUE(ans);
	cout<<SZ(ans)<<'\n';
	cout<<ans<<'\n';
	return 0;
}


/*input
3
1 2
2 3
3 4
4 5
5 6

*/
#include <bits/stdc++.h>
#pragma GCC optimize("unroll-loops,no-stack-protector")
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<ld,ld> pdd;
#define IOS ios_base::sync_with_stdio(0); cin.tie(0)
#define ALL(a) a.begin(),a.end()
#define SZ(a) ((int)a.size())
#define F first
#define S second
#define REP(i,n) for(int i=0;i<((int)n);i++)
#define eb emplace_back
#define pb push_back
#define MP(a,b) make_pair(a,b)
#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define GET_POS(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
#define EL cout<<'\n'
template<typename T1,typename T2>
ostream& operator<<(ostream& out,pair<T1,T2> P){
	out<<'('<<P.F<<','<<P.S<<')';
	return out;
}
template<typename T>
ostream& operator<<(ostream& out,vector<T> V){
	REP(i,SZ(V)) out<<V[i]<<((i!=SZ(V)-1)?" ":"");
	return out;
}
#define version 20190814
//}}}
const ll maxn=300005;
const ll maxlg=20;
const ll INF64=1e18;
const int INF=0x3f3f3f3f;
const ll MOD=ll(1e9+7);
const ld PI=acos(-1);
const ld eps=1e-9;
//const ll p=880301;
//const ll P=31;

ll mypow(ll a,ll b){
	ll res=1LL;
	while(b){
		if(b&1) res=res*a%MOD;
		a=a*a%MOD;
		b>>=1;
	}
	return res;
}

int N;
vector<int> edge[maxn];

bool vis[maxn];
int sz[maxn],dep[maxn];

void dfs(int u){
	vis[u]=1;
	sz[u]=1;
	for(int v:edge[u]) if(!vis[v]){
		dep[v]=dep[u]+1;
		dfs(v);
		sz[u]+=sz[v];
	}
}

int far(int u){
	REP(i,N) vis[i]=0;
	dfs(u);
	return max_element(dep,dep+N)-dep;
}

vector<int> path;

bool getPath(int u,int v){
	vis[u]=1;
	path.pb(u);
	if(u==v){
		return 1;
	}
	for(int nxt:edge[u]) if(!vis[nxt]){
		if(getPath(nxt,v)) return 1;
	}
	path.pop_back();
	return 0;
}
vector<int> ans;

bool isFull(int u){
	vis[u]=1;
	vector<int> s;
	for(int v:edge[u]) if(!vis[v]){
		if(!isFull(v)) return 0;
		s.pb(sz[v]);
	}
	if(SZ(s)==0) return 1;
	if(SZ(s)!=2) return 0;
	if(s[0]!=s[1]) return 0;
	return 1;
}

int DFS(int u){
	vis[u]=1;
	vector<int> s;
	int ret=-1;
	for(int v:edge[u]) if(!vis[v]){
		s.pb(sz[v]);
	}
	sort(ALL(s));
	if(SZ(s)==0) return -1;
	if(SZ(s)==1){
		if(sz[u]==2) return u;
		else return -1;
	}
	if(SZ(s)==3){
		if(s[0]==s[1]&&s[1]+s[1]+1==s[2]){
			for(int v:edge[u]) if(!vis[v]){
				if(!isFull(v)) return -1;
			}
			return u;
		}
		else return -1;
	}
	if(SZ(s)==2){
		if(s[0]!=s[1]-1) return -1;
		for(int v:edge[u]) if(!vis[v]){
			if(sz[v]==s[0]){
				if((ret=DFS(v))==-1) return -1;
			}
			else{
				if(!isFull(v)) return -1;
			}
		}
		return ret;
	}
	return -1;
}

void check(int root){
	REP(i,N) vis[i]=0;
	dfs(root);
	REP(i,N) vis[i]=0;
	int tmp=DFS(root);
	if(tmp!=-1){
		ans.pb(tmp+1);
	}
}

int main(){
	IOS;
	int n;
	cin>>n;
	N=(1<<n)-2;
	REP(i,N-1){
		int u,v;
		cin>>u>>v;
		u--;v--;
		edge[u].pb(v);
		edge[v].pb(u);
	}

	{
		int a=0;
		a=far(a);
		int b=far(a);
		REP(i,N) vis[i]=0;
		getPath(a,b);
	}
	check(path[SZ(path)/2]);
	check(path[SZ(path)/2-1]);
	SORT_UNIQUE(ans);
	cout<<SZ(ans)<<'\n';
	cout<<ans<<'\n';
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int inf=0x3f3f3f3f;
typedef long long ll;
int n,nn,sz[133333],p;
vector<int>g[133333],V;
void dfs_sz(int x,int par){
	sz[x]=1;
	for(int i=0;i<g[x].size();i++){
		int to=g[x][i];
		if(to!=par){
			dfs_sz(to,x);
			sz[x]+=sz[to];
		}
	}
	if(sz[x]==n/2||sz[x]==n/2+1){
		V.push_back(x);
		if(~par)V.push_back(par);
	}
}
bool bad;
int dp[133333];
int dfs(int x,int par){
	if(g[x].size()-(par!=-1)==0){
		dp[x]=1;return dp[x];
	}
	vector<int>good;
	for(int i=0;i<g[x].size();i++){
		int to=g[x][i];
		if(to!=par){
			int v=dfs(to,x);
			good.push_back(dp[to]);
		}
	}
	sort(good.begin(),good.end());
	if(good.size()==1){
		if(good[0]==1){
			dp[x]=-2;p=x;
		}else{
			dp[x]=inf;
		}
	}else if(good.size()==2){
		if(good[1]<0){
			dp[x]=inf;
		}else if(good[0]<0){
			if(good[0]+good[1]==0)dp[x]=good[0]-1;
			else dp[x]=inf;
		}else{
			if(good[0]==good[1]){
				dp[x]=good[0]+1;
			}
		}
	}else if(good.size()==3){
		if(good[0]==good[1]&&good[2]==good[1]+1){
			dp[x]=-good[2]-1;p=x;
		}else{
			dp[x]=inf;
		}
	}
	return dp[x];
}
int main(){
	cin>>nn;n=(1<<nn)-2;
	for(int i=1;i<n;i++){
		int x,y;cin>>x>>y;
		g[x].push_back(y);
		g[y].push_back(x);
	}
	dfs_sz(1,-1);
	set<int>ans;
	for(int i=0;i<V.size();i++){
		p=0;dfs(V[i],-1);if(dp[V[i]]==-nn&&p)ans.insert(p);
	}
	cout<<ans.size()<<endl;
	for(set<int>::iterator itr=ans.begin();itr!=ans.end();itr++){
		cout<<*itr<<" ";
	}
	return 0;
}


/**********************************************
 *Author*        :jxf378440404
 *Created Time*  : 2019/10/13 0:32:41

*********************************************/

#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <map>
#include <queue>
#include <set>
using namespace std;
typedef long long LL;
const int MaxN = 2e5;
const int Inf = 1 << 30;

vector<int> ans, tot[MaxN + 5], G[MaxN + 5];
int ind[MaxN + 5], cnt[MaxN + 5];
int X, DEP;
void Dfs(int x, int f, int dep) {
	if(X == x) DEP = dep;
	++cnt[dep];
	for(int i = 0; i < ind[x]; ++i)
		if(G[x][i] != f) Dfs(G[x][i], x, dep + 1);
	return ;
}
queue<int> q;

int main()
{
	int m, n, u, v, Size;
	scanf("%d", &m);
	n = (1 << m) - 2;
	for(int i = 1; i <= n; ++i) ind[i] = cnt[i] = 0;
	for(int i = 1; i < n; ++i) {
		scanf("%d %d", &u, &v);
		G[u].push_back(v);
		G[v].push_back(u);
		++ind[u]; ++ind[v];
	}
	for(int i = 1; i <= n; ++i) tot[ind[i]].push_back(i);
	ans.clear();
	if(tot[1].size() + tot[2].size() + tot[3].size() + tot[4].size() == n) {
		if(tot[4].size() == 1) {
			if(tot[2].size() == 1 && tot[1].size() == (1 << (m - 1))) {
				X = tot[4][0];
				Dfs(tot[2][0], 0, 1);//删中间
				bool flag = true; int bit = 1;
				for(int i = 1; i < m && flag; ++i) {
					if(cnt[i] != bit) flag = false;
					bit <<= 1;
					if(i == DEP) ++bit;
				}
				if(flag) ans.push_back(X);
			}
		}
		else if(tot[4].size() == 0){
			if(tot[2].size() == 2 && tot[1].size() == (1 << (m - 1)) - 1) {//删叶子
				if(tot[2][1] < tot[2][0]) swap(tot[2][1], tot[2][0]);
				X = tot[2][1];
				Dfs(tot[2][0], 0, 1);
				bool flag = true; int bit = 1;
				for(int i = 1; i < m && flag; ++i) {
					if(cnt[i] != bit) flag = false;
					bit <<= 1;
					if(i == DEP) ++bit;
				}
				if(flag) ans.push_back(X);
				for(int i = 1; i <= n; ++i) cnt[i] = 0;
				X = tot[2][0];
				Dfs(tot[2][1], 0, 1);
				flag = true; bit = 1;
				for(int i = 1; i < m && flag; ++i) {
					if(cnt[i] != bit) flag = false;
					bit <<= 1;
					if(i == DEP) ++bit;
				}
				if(flag) ans.push_back(X);
			}
			else if(tot[2].size() == 0 && tot[1].size() == (1 << (m - 1))) {//删dep1
				while(!q.empty()) q.pop();
				for(int i = 1; i <= n; ++i)
					if(ind[i] == 1) {
						q.push(i);
						ind[i] = 0;
					}
				int p; u = 0;
				while(!q.empty()) {
					p = u;
					u = q.front(); q.pop();
					Size = G[u].size();
					for(int i = 0; i < Size; ++i) {
						v = G[u][i];
						if(--ind[v] == 1) q.push(v);
					}
				}
				if(p < u) swap(u, p);
				X = u;
				Dfs(p, 0, 1);
				bool flag = true; int bit = 1;
				for(int i = 1; i < m && flag; ++i) {
					if(cnt[i] != bit) flag = false;
					bit <<= 1;
					if(i == DEP) ++bit;
				}
				if(flag) ans.push_back(X);
				for(int i = 1; i <= n; ++i) cnt[i] = 0;
				X = p;
				Dfs(u, 0, 1);
				flag = true; bit = 1;
				for(int i = 1; i < m && flag; ++i) {
					if(cnt[i] != bit) flag = false;
					bit <<= 1;
					if(i == DEP) ++bit;
				}
				if(flag) ans.push_back(X);
			}
		}
	}
	Size = ans.size();
    printf("%d\n", Size);
    for(int i = 0; i < Size; ++i) printf("%d%c", ans[i], i == Size - 1 ? '\n' : ' ');
    for(int i = 1; i <= n; ++i) tot[i].clear(), G[i].clear();
    return 0;
}


/**********************************************
 *Author*        :jxf378440404
 *Created Time*  : 2019/10/13 0:32:41

*********************************************/

#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <map>
#include <queue>
#include <set>
using namespace std;
typedef long long LL;
const int MaxN = 2e5;
const int Inf = 1 << 30;

vector<int> ans, tot[MaxN + 5], G[MaxN + 5];
int ind[MaxN + 5], cnt[MaxN + 5];
int X, DEP;
void Dfs(int x, int f, int dep) {
	if(X == x) DEP = dep;
	++cnt[dep];
	for(int i = 0; i < ind[x]; ++i)
		if(G[x][i] != f) Dfs(G[x][i], x, dep + 1);
	return ;
}
queue<int> q;

int main()
{
	int m, n, u, v, Size;
	scanf("%d", &m);
	n = (1 << m) - 2;
	for(int i = 1; i <= n; ++i) ind[i] = cnt[i] = 0;
	for(int i = 1; i < n; ++i) {
		scanf("%d %d", &u, &v);
		G[u].push_back(v);
		G[v].push_back(u);
		++ind[u]; ++ind[v];
	}
	for(int i = 1; i <= n; ++i) tot[ind[i]].push_back(i);
	ans.clear();
	if(m == 2) {
		ans.push_back(1);
		ans.push_back(2);
	}
	else if(tot[1].size() + tot[2].size() + tot[3].size() + tot[4].size() == n) {
		if(tot[4].size() == 1) {
			if(tot[2].size() == 1 && tot[1].size() == (1 << (m - 1))) {
				X = tot[4][0];
				Dfs(tot[2][0], 0, 1);//删中间
				bool flag = true; int bit = 1;
				for(int i = 1; i <= m && flag; ++i) {
					if(cnt[i] != bit) flag = false;
					bit <<= 1;
					if(i == DEP) ++bit;
				}
				if(flag) ans.push_back(X);
			}
		}
		else if(tot[4].size() == 0){
			if(tot[2].size() == 2 && tot[1].size() == (1 << (m - 1)) - 1) {//删叶子
				if(tot[2][1] < tot[2][0]) swap(tot[2][1], tot[2][0]);
				X = tot[2][1];
				Dfs(tot[2][0], 0, 1);
				bool flag = true; int bit = 1;
				for(int i = 1; i <= m && flag; ++i) {
					if(cnt[i] != bit) flag = false;
					bit <<= 1;
					if(i == DEP) ++bit;
				}
				if(flag) ans.push_back(X);
				for(int i = 1; i <= n; ++i) cnt[i] = 0;
				X = tot[2][0];
				Dfs(tot[2][1], 0, 1);
				flag = true; bit = 1;
				for(int i = 1; i <= m && flag; ++i) {
					if(cnt[i] != bit) flag = false;
					bit <<= 1;
					if(i == DEP) ++bit;
				}
				if(flag) ans.push_back(X);
			}
			else if(tot[2].size() == 0 && tot[1].size() == (1 << (m - 1))) {//删dep1
				while(!q.empty()) q.pop();
				for(int i = 1; i <= n; ++i)
					if(ind[i] == 1) {
						q.push(i);
						ind[i] = 0;
					}
				int p; u = 0;
				while(!q.empty()) {
					p = u;
					u = q.front(); q.pop();
					Size = G[u].size();
					for(int i = 0; i < Size; ++i) {
						v = G[u][i];
						if(--ind[v] == 1) q.push(v);
					}
				}
				if(p < u) swap(u, p);
				X = u;
				Dfs(p, 0, 1);
				bool flag = true; int bit = 1;
				for(int i = 1; i <= m && flag; ++i) {
					if(cnt[i] != bit) flag = false;
					bit <<= 1;
					if(i == DEP) ++bit;
				}
				if(flag) ans.push_back(X);
				for(int i = 1; i <= n; ++i) cnt[i] = 0;
				X = p;
				Dfs(u, 0, 1);
				flag = true; bit = 1;
				for(int i = 1; i <= m && flag; ++i) {
					if(cnt[i] != bit) flag = false;
					bit <<= 1;
					if(i == DEP) ++bit;
				}
				if(flag) ans.push_back(X);
			}
		}
	}
	Size = ans.size();
    printf("%d\n", Size);
    for(int i = 0; i < Size; ++i) printf("%d%c", ans[i], i == Size - 1 ? '\n' : ' ');
    for(int i = 1; i <= n; ++i) tot[i].clear(), G[i].clear();
    return 0;
}


/**********************************************
 *Author*        :jxf378440404
 *Created Time*  : 2019/10/13 12:57:57

*********************************************/

#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <map>
#include <queue>
#include <set>
using namespace std;
typedef long long LL;
const int MaxN = 2e5;
const int Inf = 1 << 30;

int id, dep[MaxN + 5], fa[MaxN + 5], S[MaxN + 5], flag;
vector<int> G[MaxN + 5], ans;

void Dfs(int x, int f, int d) {
	dep[x] = d; fa[x] = f;
	if(d > dep[id]) id = x;
	int Size = G[x].size();
	for(int i = 0; i < Size; ++i) if(G[x][i] != f) Dfs(G[x][i], x, d + 1);
	return ;
}

int dfs(int x, int f) {
	S[x] = 1;
	int Size = G[x].size(), a = 0, b = 0, c = 0;
	for(int i = 0; i < Size && flag; ++i)
		if(G[x][i] != f) {
			if(a == 0) a = dfs(G[x][i], x);
			else {
				b = dfs(G[x][i], x);
				if(a != b) {
					if(a < b) swap(a, b);
					if(a - b == 1) ++c;
					else flag = false;
				}
			}
			S[x] += S[G[x][i]];
		}
	if(S[x] == 1) return 2;
	else if(c == 0 && (1 << a) - 1 == S[x]) return a + 1;
	else if(S[x] == (1 << a) - 2 && c <= 2) {
		ans.push_back(x);
		++S[x];
		return a + 1;
	}
	flag = false;
	return 1;
}

int main()
{
	int n, m, x, y, u, v, fx;
	while(~scanf("%d", &m)) {
		n = (1 << m) - 2;
		for(int i = 1; i < n; ++i) {
			scanf("%d %d", &u, &v);
			G[u].push_back(v);
			G[v].push_back(u);
		}
		id = 1;
		Dfs(1, -1, 1);
		x = id; fx = id; flag = true;
		for(int i = 2; i < m && fx != -1; ++i) fx = fa[fx];
		if(fx == -1) flag = false;
		Dfs(x, -1, 1);
		y = id;
		ans.clear();
		if((dep[y] - dep[x]) & 1) {//删除dep1
			for(int i = 2; i < m && y != -1; ++i) y = fa[y];
			if(y == -1) flag = false;
			x = fx;
			if(x > y) swap(x, y);
			dfs(x, y);
			dfs(y, x);
			if(ans.size() == 0 && flag) {
				ans.push_back(x);
				ans.push_back(y);
			}
			else ans.clear();
		}
		else {//叶子or中间点
			for(int i = 1; i < m; ++i) y = fa[y];
			dfs(y, -1);
			if(!flag || ans.size() > 1) ans.clear();
		}
		printf("%d\n", ans.size());
		for(int i = 0; i < ans.size(); ++i) printf("%d%c", ans[i], i == ans.size() - 1 ? '\n' : ' ');
		for(int i = 1; i <= n; ++i) G[i].clear();
	}
    return 0;
}


/**********************************************
 *Author*        :jxf378440404
 *Created Time*  : 2019/10/13 12:57:57

*********************************************/

#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <map>
#include <queue>
#include <set>
using namespace std;
typedef long long LL;
const int MaxN = 2e5;
const int Inf = 1 << 30;

int id, dep[MaxN + 5], fa[MaxN + 5], S[MaxN + 5], flag;
vector<int> G[MaxN + 5], ans;

void Dfs(int x, int f, int d) {
	dep[x] = d; fa[x] = f;
	if(d > dep[id]) id = x;
	int Size = G[x].size();
	for(int i = 0; i < Size; ++i) if(G[x][i] != f) Dfs(G[x][i], x, d + 1);
	return ;
}

int dfs(int x, int f) {
	S[x] = 1;
	int Size = G[x].size(), a = 0, b = 0, c = 0;
	for(int i = 0; i < Size && flag; ++i)
		if(G[x][i] != f) {
			if(a == 0) a = dfs(G[x][i], x);
			else {
				b = dfs(G[x][i], x);
				if(a != b) {
					if(a < b) swap(a, b);
					if(a - b == 1) ++c;
					else flag = false;
				}
			}
			S[x] += S[G[x][i]];
		}
	if(S[x] == 1) return 2;
	else if(c == 0 && (1 << a) - 1 == S[x]) return a + 1;
	else if(S[x] == (1 << a) - 2 && c < 2) {
		ans.push_back(x);
		++S[x];
		return a + 1;
	}
	flag = false;
	return 1;
}

int main()
{
	int n, m, x, y, u, v, fx;
	while(~scanf("%d", &m)) {
		n = (1 << m) - 2;
		for(int i = 1; i < n; ++i) {
			scanf("%d %d", &u, &v);
			G[u].push_back(v);
			G[v].push_back(u);
		}
		id = 1;
		Dfs(1, -1, 1);
		x = id; fx = id;
		for(int i = 2; i < m; ++i) fx = fa[fx];
		Dfs(x, -1, 1);
		y = id;
		ans.clear(); flag = true;
		if((dep[y] - dep[x]) & 1) {//删除dep1
			for(int i = 2; i < m; ++i) y = fa[y];
			x = fx;
			if(x > y) swap(x, y);
			dfs(x, y);
			dfs(y, x);
			if(ans.size() == 0 && flag) {
				ans.push_back(x);
				ans.push_back(y);
			}
			else ans.clear();
		}
		else {//叶子or中间点
			for(int i = 1; i < m; ++i) y = fa[y];
			dfs(y, -1);
			if(!flag || ans.size() > 1) ans.clear();
		}
		printf("%d\n", ans.size());
		for(int i = 0; i < ans.size(); ++i) printf("%d%c", ans[i], i == ans.size() - 1 ? '\n' : ' ');
		for(int i = 1; i <= n; ++i) G[i].clear();
	}
    return 0;
}


/**********************************************
 *Author*        :jxf378440404
 *Created Time*  : 2019/10/13 0:32:41

*********************************************/

#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <map>
#include <queue>
#include <set>
using namespace std;
typedef long long LL;
const int MaxN = 2e5;
const int Inf = 1 << 30;

vector<int> ans, tot[MaxN + 5], G[MaxN + 5];
int ind[MaxN + 5], cnt[MaxN + 5];
int X, DEP;
void Dfs(int x, int f, int dep) {
	if(X == x) DEP = dep;
	++cnt[dep];
	for(int i = 0; i < ind[x]; ++i)
		if(G[x][i] != f) Dfs(G[x][i], x, dep + 1);
	return ;
}
queue<int> q;

int main()
{
	int m, n, u, v, Size;
	scanf("%d", &m);
	n = (1 << m) - 2;
	for(int i = 1; i <= n; ++i) ind[i] = cnt[i] = 0;
	for(int i = 1; i < n; ++i) {
		scanf("%d %d", &u, &v);
		G[u].push_back(v);
		G[v].push_back(u);
		++ind[u]; ++ind[v];
	}
	for(int i = 1; i <= n; ++i) tot[ind[i]].push_back(i);
	ans.clear();
	if(tot[1].size() + tot[2].size() + tot[3].size() + tot[4].size() == n) {
		if(tot[4].size() == 1) {
			if(tot[2].size() == 1) {
				X = tot[4][0];
				Dfs(tot[2][0], 0, 1);//删中间
				bool flag = true; int bit = 1;
				for(int i = 1; i < m && flag; ++i) {
					if(cnt[i] != bit) flag = false;
					bit <<= 1;
					if(i == DEP) ++bit;
				}
				if(flag) ans.push_back(X);
			}
		}
		else if(tot[4].size() == 0){
			if(tot[2].size() == 2) {//删叶子
				X = tot[2][1];
				Dfs(tot[2][0], 0, 1);
				bool flag = true; int bit = 1;
				for(int i = 1; i < m && flag; ++i) {
					if(cnt[i] != bit) flag = false;
					bit <<= 1;
					if(i == DEP) ++bit;
				}
				if(flag) ans.push_back(X);
				for(int i = 1; i <= n; ++i) cnt[i] = 0;
				X = tot[2][0];
				Dfs(tot[2][1], 0, 1);
				flag = true; bit = 1;
				for(int i = 1; i < m && flag; ++i) {
					if(cnt[i] != bit) flag = false;
					bit <<= 1;
					if(i == DEP) ++bit;
				}
				if(flag) ans.push_back(X);
			}
			else if(tot[2].size() == 0) {//删dep1
				while(!q.empty()) q.pop();
				for(int i = 1; i <= n; ++i)
					if(ind[i] == 1) {
						q.push(i);
						ind[i] = 0;
					}
				int p; u = 0;
				while(!q.empty()) {
					p = u;
					u = q.front(); q.pop();
					Size = G[u].size();
					for(int i = 0; i < Size; ++i) {
						v = G[u][i];
						if(--ind[v] == 0) q.push(v);
					}
				}
				ans.push_back(u);
				ans.push_back(p);
			}
		}
	}
	Size = ans.size();
    printf("%d\n", Size);
    for(int i = 0; i < Size; ++i) printf("%d%c", ans[i], i == Size - 1 ? '\n' : ' ');
    for(int i = 1; i <= n; ++i) tot[i].clear(), G[i].clear();
    return 0;
}


/**********************************************
 *Author*        :jxf378440404
 *Created Time*  : 2019/10/13 12:57:57

*********************************************/

#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <map>
#include <queue>
#include <set>
using namespace std;
typedef long long LL;
const int MaxN = 2e5;
const int Inf = 1 << 30;

int id, dep[MaxN + 5], fa[MaxN + 5], S[MaxN + 5], flag;
vector<int> G[MaxN + 5], ans;

void Dfs(int x, int f, int d) {
	dep[x] = d; fa[x] = f;
	if(d > dep[id]) id = x;
	int Size = G[x].size();
	for(int i = 0; i < Size; ++i) if(G[x][i] != f) Dfs(G[x][i], x, d + 1);
	return ;
}

int dfs(int x, int f) {
	S[x] = 1;
	int Size = G[x].size(), a = 0, b = 0, c = 0;
	for(int i = 0; i < Size && flag; ++i)
		if(G[x][i] != f) {
			if(a == 0) a = dfs(G[x][i], x);
			else {
				b = dfs(G[x][i], x);
				if(a != b) {
					if(abs(a - b) == 1) ++c;
					else flag = false;
				}
			}
			S[x] += S[G[x][i]];
		}
	if(S[x] == 1) return 2;
	else if(c == 0 && (1 << a) - 1 == S[x]) return a + 1;
	else if(S[x] == (1 << max(a, b)) - 2) {
		ans.push_back(x);
		++S[x];
		return max(a, b) + 1;
	}
	flag = false;
	return 1;
}

int main()
{
	int n, m, x, y, u, v;
	while(~scanf("%d", &m)) {
		n = (1 << m) - 2;
		for(int i = 1; i < n; ++i) {
			scanf("%d %d", &u, &v);
			G[u].push_back(v);
			G[v].push_back(u);
		}
		id = 1;
		Dfs(1, -1, 1);
		x = id;
		Dfs(x, -1, 1);
		y = id;
		ans.clear(); flag = true;
		if((dep[y] - dep[x]) & 1) {//删除dep1
			for(int i = 2; i < m; ++i) x = fa[x], y = fa[y];
			if(x > y) swap(x, y);
			dfs(x, y);
			dfs(y, x);
			if(ans.size() == 0 && flag) {
				ans.push_back(x);
				ans.push_back(y);
			}
			else ans.clear();
		}
		else {//叶子or中间点
			for(int i = 1; i < m; ++i) y = fa[y];
			dfs(y, -1);
			if(ans.size() > 1) ans.clear();
		}
		printf("%d\n", ans.size());
		for(int i = 0; i < ans.size(); ++i) printf("%d%c", ans[i], i == ans.size() - 1 ? '\n' : ' ');
		for(int i = 1; i <= n; ++i) G[i].clear();
	}
    return 0;
}


/**********************************************
 *Author*        :jxf378440404
 *Created Time*  : 2019/10/13 0:32:41

*********************************************/

#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <map>
#include <queue>
#include <set>
using namespace std;
typedef long long LL;
const int MaxN = 2e5;
const int Inf = 1 << 30;

vector<int> ans, tot[MaxN + 5], G[MaxN + 5];
int ind[MaxN + 5], cnt[MaxN + 5];
int X, DEP;
void Dfs(int x, int f, int dep) {
	if(X == x) DEP = dep;
	++cnt[dep];
	for(int i = 0; i < ind[x]; ++i)
		if(G[x][i] != f) Dfs(G[x][i], x, dep + 1);
	return ;
}
queue<int> q;

int main()
{
	int m, n, u, v, Size;
	scanf("%d", &m);
	n = (1 << m) - 2;
	for(int i = 1; i <= n; ++i) ind[i] = cnt[i] = 0;
	for(int i = 1; i < n; ++i) {
		scanf("%d %d", &u, &v);
		G[u].push_back(v);
		G[v].push_back(u);
		++ind[u]; ++ind[v];
	}
	for(int i = 1; i <= n; ++i) tot[ind[i]].push_back(i);
	ans.clear();
	if(tot[1].size() + tot[2].size() + tot[3].size() + tot[4].size() == n) {
		if(tot[4].size() == 1) {
			if(tot[2].size() == 1 && tot[1].size() == (1 << (m - 1))) {
				X = tot[4][0];
				Dfs(tot[2][0], 0, 1);//删中间
				bool flag = true; int bit = 1;
				for(int i = 1; i < m && flag; ++i) {
					if(cnt[i] != bit) flag = false;
					bit <<= 1;
					if(i == DEP) ++bit;
				}
				if(flag && cnt[m] == (1 << (m - 1)) - (1 << (m - 1 - DEP))) ans.push_back(X);
			}
		}
		else if(tot[4].size() == 0){
			if(tot[2].size() == 2 && tot[1].size() == (1 << (m - 1)) - 1) {//删叶子
				if(tot[2][1] < tot[2][0]) swap(tot[2][1], tot[2][0]);
				X = tot[2][1];
				Dfs(tot[2][0], 0, 1);
				bool flag = true; int bit = 1;
				for(int i = 1; i < m && flag; ++i) {
					if(cnt[i] != bit) flag = false;
					bit <<= 1;
					if(i == DEP) ++bit;
				}
				if(flag && cnt[m] == (1 << (m - 1)) - 1) ans.push_back(X);
				for(int i = 1; i <= n; ++i) cnt[i] = 0;
				X = tot[2][0];
				Dfs(tot[2][1], 0, 1);
				flag = true; bit = 1;
				for(int i = 1; i < m && flag; ++i) {
					if(cnt[i] != bit) flag = false;
					bit <<= 1;
					if(i == DEP) ++bit;
				}
				if(flag && cnt[m] == (1 << (m - 1)) - 1) ans.push_back(X);
			}
			else if(tot[2].size() == 0 && tot[1].size() == (1 << (m - 1))) {//删dep1
				while(!q.empty()) q.pop();
				for(int i = 1; i <= n; ++i)
					if(ind[i] == 1) {
						q.push(i);
						ind[i] = 0;
					}
				int p; u = 0;
				while(!q.empty()) {
					p = u;
					u = q.front(); q.pop();
					Size = G[u].size();
					for(int i = 0; i < Size; ++i) {
						v = G[u][i];
						if(--ind[v] == 1) q.push(v);
					}
				}
				if(p < u) swap(u, p);
				X = u;
				Dfs(p, 0, 1);
				bool flag = true; int bit = 1;
				for(int i = 1; i < m && flag; ++i) {
					if(cnt[i] != bit) flag = false;
					bit <<= 1;
					if(i == DEP) ++bit;
				}
				if(flag && cnt[m] == (1 << (m - 1)) - (1 << (m - 1 - DEP))) ans.push_back(X);
				for(int i = 1; i <= n; ++i) cnt[i] = 0;
				X = p;
				Dfs(u, 0, 1);
				flag = true; bit = 1;
				for(int i = 1; i < m && flag; ++i) {
					if(cnt[i] != bit) flag = false;
					bit <<= 1;
					if(i == DEP) ++bit;
				}
				if(flag && cnt[m] == (1 << (m - 1)) - (1 << (m - 1 - DEP))) ans.push_back(X);
			}
		}
	}
	Size = ans.size();
    printf("%d\n", Size);
    for(int i = 0; i < Size; ++i) printf("%d%c", ans[i], i == Size - 1 ? '\n' : ' ');
    for(int i = 1; i <= n; ++i) tot[i].clear(), G[i].clear();
    return 0;
}


/**********************************************
 *Author*        :jxf378440404
 *Created Time*  : 2019/10/13 0:32:41

*********************************************/

#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <map>
#include <queue>
#include <set>
using namespace std;
typedef long long LL;
const int MaxN = 2e5;
const int Inf = 1 << 30;

vector<int> ans, tot[MaxN + 5], G[MaxN + 5];
int ind[MaxN + 5], cnt[MaxN + 5];
int X, DEP;
void Dfs(int x, int f, int dep) {
	if(X == x) DEP = dep;
	++cnt[dep];
	for(int i = 0; i < ind[x]; ++i)
		if(G[x][i] != f) Dfs(G[x][i], x, dep + 1);
	return ;
}
queue<int> q;

int main()
{
	int m, n, u, v, Size;
	scanf("%d", &m);
	n = (1 << m) - 2;
	for(int i = 1; i <= n; ++i) ind[i] = cnt[i] = 0;
	for(int i = 1; i < n; ++i) {
		scanf("%d %d", &u, &v);
		G[u].push_back(v);
		G[v].push_back(u);
		++ind[u]; ++ind[v];
	}
	for(int i = 1; i <= n; ++i) tot[ind[i]].push_back(i);
	ans.clear();
	if(tot[1].size() + tot[2].size() + tot[3].size() + tot[4].size() == n) {
		if(tot[4].size() == 1) {
			if(tot[2].size() == 1) {
				X = tot[4][0];
				Dfs(tot[2][0], 0, 1);//删中间
				bool flag = true; int bit = 1;
				for(int i = 1; i < m && flag; ++i) {
					if(cnt[i] != bit) flag = false;
					bit <<= 1;
					if(i == DEP) ++bit;
				}
				if(flag) ans.push_back(X);
			}
		}
		else if(tot[4].size() == 0){
			if(tot[2].size() == 2) {//删叶子
				if(tot[2][1] < tot[2][0]) swap(tot[2][1], tot[2][0]);
				X = tot[2][1];
				Dfs(tot[2][0], 0, 1);
				bool flag = true; int bit = 1;
				for(int i = 1; i < m && flag; ++i) {
					if(cnt[i] != bit) flag = false;
					bit <<= 1;
					if(i == DEP) ++bit;
				}
				if(flag) ans.push_back(X);
				for(int i = 1; i <= n; ++i) cnt[i] = 0;
				X = tot[2][0];
				Dfs(tot[2][1], 0, 1);
				flag = true; bit = 1;
				for(int i = 1; i < m && flag; ++i) {
					if(cnt[i] != bit) flag = false;
					bit <<= 1;
					if(i == DEP) ++bit;
				}
				if(flag) ans.push_back(X);
			}
			else if(tot[2].size() == 0) {//删dep1
				while(!q.empty()) q.pop();
				for(int i = 1; i <= n; ++i)
					if(ind[i] == 1) {
						q.push(i);
						ind[i] = 0;
					}
				int p; u = 0;
				while(!q.empty()) {
					p = u;
					u = q.front(); q.pop();
					Size = G[u].size();
					for(int i = 0; i < Size; ++i) {
						v = G[u][i];
						if(--ind[v] == 0) q.push(v);
					}
				}
				if(p < u) swap(u, p);
				ans.push_back(u);
				ans.push_back(p);
			}
		}
	}
	Size = ans.size();
    printf("%d\n", Size);
    for(int i = 0; i < Size; ++i) printf("%d%c", ans[i], i == Size - 1 ? '\n' : ' ');
    for(int i = 1; i <= n; ++i) tot[i].clear(), G[i].clear();
    return 0;
}


/**********************************************
 *Author*        :jxf378440404
 *Created Time*  : 2019/10/13 12:57:57

 *********************************************/

#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <map>
#include <queue>
#include <set>
using namespace std;
typedef long long LL;
const int MaxN = 2e5;
const int Inf = 1 << 30;

int id, dep[MaxN + 5], fa[MaxN + 5], S[MaxN + 5], flag;
vector<int> G[MaxN + 5], ans;

void Dfs(int x, int f, int d) {
	dep[x] = d; fa[x] = f;
	if(d > dep[id]) id = x;
	int Size = G[x].size();
	for(int i = 0; i < Size; ++i) if(G[x][i] != f) Dfs(G[x][i], x, d + 1);
	return ;
}

int dfs(int x, int f) {
	S[x] = 1;
	int Size = G[x].size(), a = 0, b = 0, c = 0;
	for(int i = 0; i < Size && flag; ++i)
		if(G[x][i] != f) {
			if(a == 0) a = dfs(G[x][i], x);
			else {
				b = dfs(G[x][i], x);
				if(a != b) {
					if(a < b) swap(a, b);
					if(a - b == 1) ++c;
					else flag = false;
				}
			}
			S[x] += S[G[x][i]];
		}
	if(S[x] == 1) return 2;
	else if(c == 0 && (1 << a) - 1 == S[x]) return a + 1;
	else if(S[x] == (1 << a) - 2 && c <= 2) {
		ans.push_back(x);
		++S[x];
		return a + 1;
	}
	flag = false;
	return 1;
}

int main()
{
	int n, m, x, y, u, v, fx;
	while(~scanf("%d", &m)) {
		n = (1 << m) - 2;
		for(int i = 1; i < n; ++i) {
			scanf("%d %d", &u, &v);
			G[u].push_back(v);
			G[v].push_back(u);
		}
		id = 1;
		Dfs(1, -1, 1);
		x = id; fx = id; flag = true;
		for(int i = 2; i < m && fx != -1; ++i) fx = fa[fx];
		if(fx == -1) flag = false;
		else {
			Dfs(x, -1, 1);
			y = id;
			ans.clear();
			if((dep[y] - dep[x]) & 1) {//删除dep1
				for(int i = 2; i < m && y != -1; ++i) y = fa[y];
				if(y == -1) flag = false;
				else {
					x = fx;
					if(x > y) swap(x, y);
					dfs(x, y);
					dfs(y, x);
					if(ans.size() == 0 && flag) {
						ans.push_back(x);
						ans.push_back(y);
					}
					else ans.clear();
				}
			}
			else {//叶子or中间点
				for(int i = 1; i < m && y != -1; ++i) y = fa[y];
				if(y == -1) flag = false;
				else dfs(y, -1);
				if(!flag || ans.size() > 1) ans.clear();
			}
		}
		printf("%d\n", ans.size());
		for(int i = 0; i < ans.size(); ++i) printf("%d%c", ans[i], i == ans.size() - 1 ? '\n' : ' ');
		for(int i = 1; i <= n; ++i) G[i].clear();
	}
	return 0;
}


/**********************************************
 *Author*        :jxf378440404
 *Created Time*  : 2019/10/13 0:32:41

*********************************************/

#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <map>
#include <queue>
#include <set>
using namespace std;
typedef long long LL;
const int MaxN = 2e5;
const int Inf = 1 << 30;

vector<int> ans, tot[MaxN + 5], G[MaxN + 5];
int ind[MaxN + 5], cnt[MaxN + 5];
int X, DEP;
void Dfs(int x, int f, int dep) {
	if(X == x) DEP = dep;
	++cnt[dep];
	for(int i = 0; i < ind[x]; ++i)
		if(G[x][i] != f) Dfs(G[x][i], x, dep + 1);
	return ;
}
queue<int> q;

int main()
{
	int m, n, u, v, Size;
	scanf("%d", &m);
	n = (1 << m) - 2;
	for(int i = 1; i <= n; ++i) ind[i] = cnt[i] = 0;
	for(int i = 1; i < n; ++i) {
		scanf("%d %d", &u, &v);
		G[u].push_back(v);
		G[v].push_back(u);
		++ind[u]; ++ind[v];
	}
	for(int i = 1; i <= n; ++i) tot[ind[i]].push_back(i);
	ans.clear();
	if(tot[1].size() + tot[2].size() + tot[3].size() + tot[4].size() == n) {
		if(tot[4].size() == 1) {
			if(tot[2].size() == 1) {
				X = tot[4][0];
				Dfs(tot[2][0], 0, 1);//删中间
				bool flag = true; int bit = 1;
				for(int i = 1; i < m && flag; ++i) {
					if(cnt[i] != bit) flag = false;
					bit <<= 1;
					if(i == DEP) ++bit;
				}
				if(flag) ans.push_back(X);
			}
		}
		else if(tot[4].size() == 0){
			if(tot[2].size() == 2) {//删叶子
				if(tot[2][1] < tot[2][0]) swap(tot[2][1], tot[2][0]);
				X = tot[2][1];
				Dfs(tot[2][0], 0, 1);
				bool flag = true; int bit = 1;
				for(int i = 1; i < m && flag; ++i) {
					if(cnt[i] != bit) flag = false;
					bit <<= 1;
					if(i == DEP) ++bit;
				}
				if(flag) ans.push_back(X);
				for(int i = 1; i <= n; ++i) cnt[i] = 0;
				X = tot[2][0];
				Dfs(tot[2][1], 0, 1);
				flag = true; bit = 1;
				for(int i = 1; i < m && flag; ++i) {
					if(cnt[i] != bit) flag = false;
					bit <<= 1;
					if(i == DEP) ++bit;
				}
				if(flag) ans.push_back(X);
			}
			else if(tot[2].size() == 0) {//删dep1
				while(!q.empty()) q.pop();
				for(int i = 1; i <= n; ++i)
					if(ind[i] == 1) {
						q.push(i);
						ind[i] = 0;
					}
				int p; u = 0;
				while(!q.empty()) {
					p = u;
					u = q.front(); q.pop();
					Size = G[u].size();
					for(int i = 0; i < Size; ++i) {
						v = G[u][i];
						if(--ind[v] == 1) q.push(v);
					}
				}
				if(p < u) swap(u, p);
				X = u;
				Dfs(p, 0, 1);
				bool flag = true; int bit = 1;
				for(int i = 1; i < m && flag; ++i) {
					if(cnt[i] != bit) flag = false;
					bit <<= 1;
					if(i == DEP) ++bit;
				}
				if(flag) ans.push_back(X);
				for(int i = 1; i <= n; ++i) cnt[i] = 0;
				X = p;
				Dfs(u, 0, 1);
				flag = true; bit = 1;
				for(int i = 1; i < m && flag; ++i) {
					if(cnt[i] != bit) flag = false;
					bit <<= 1;
					if(i == DEP) ++bit;
				}
				if(flag) ans.push_back(X);
			}
		}
	}
	Size = ans.size();
    printf("%d\n", Size);
    for(int i = 0; i < Size; ++i) printf("%d%c", ans[i], i == Size - 1 ? '\n' : ' ');
    for(int i = 1; i <= n; ++i) tot[i].clear(), G[i].clear();
    return 0;
}


/**********************************************
 *Author*        :jxf378440404
 *Created Time*  : 2019/10/13 12:57:57

*********************************************/

#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <map>
#include <queue>
#include <set>
using namespace std;
typedef long long LL;
const int MaxN = 2e5;
const int Inf = 1 << 30;

int id, dep[MaxN + 5], fa[MaxN + 5], S[MaxN + 5], flag;
vector<int> G[MaxN + 5], ans;

void Dfs(int x, int f, int d) {
	dep[x] = d; fa[x] = f;
	if(d > dep[id]) id = x;
	int Size = G[x].size();
	for(int i = 0; i < Size; ++i) if(G[x][i] != f) Dfs(G[x][i], x, d + 1);
	return ;
}

int dfs(int x, int f) {
	S[x] = 1;
	int Size = G[x].size(), a = 0, b = 0, c = 0;
	for(int i = 0; i < Size && flag; ++i)
		if(G[x][i] != f) {
			if(a == 0) a = dfs(G[x][i], x);
			else {
				b = dfs(G[x][i], x);
				if(a != b) {
					if(a < b) swap(a, b);
					if(a - b == 1) ++c;
					else flag = false;
				}
			}
			S[x] += S[G[x][i]];
		}
	if(S[x] == 1) return 2;
	else if(c == 0 && (1 << a) - 1 == S[x]) return a + 1;
	else if(S[x] == (1 << a) - 2 && c <= 2) {
		ans.push_back(x);
		++S[x];
		return a + 1;
	}
	flag = false;
	return 1;
}

int main()
{
	int n, m, x, y, u, v, fx;
	while(~scanf("%d", &m)) {
		n = (1 << m) - 2;
		for(int i = 1; i < n; ++i) {
			scanf("%d %d", &u, &v);
			G[u].push_back(v);
			G[v].push_back(u);
		}
		id = 1;
		Dfs(1, -1, 1);
		x = id; fx = id;
		for(int i = 2; i < m; ++i) fx = fa[fx];
		Dfs(x, -1, 1);
		y = id;
		ans.clear(); flag = true;
		if((dep[y] - dep[x]) & 1) {//删除dep1
			for(int i = 2; i < m; ++i) y = fa[y];
			x = fx;
			if(x > y) swap(x, y);
			dfs(x, y);
			dfs(y, x);
			if(ans.size() == 0 && flag) {
				ans.push_back(x);
				ans.push_back(y);
			}
			else ans.clear();
		}
		else {//叶子or中间点
			for(int i = 1; i < m; ++i) y = fa[y];
			dfs(y, -1);
			if(!flag || ans.size() > 1) ans.clear();
		}
		printf("%d\n", ans.size());
		for(int i = 0; i < ans.size(); ++i) printf("%d%c", ans[i], i == ans.size() - 1 ? '\n' : ' ');
		for(int i = 1; i <= n; ++i) G[i].clear();
	}
    return 0;
}


/**********************************************
 *Author*        :jxf378440404
 *Created Time*  : 2019/10/13 12:57:57

*********************************************/

#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <map>
#include <queue>
#include <set>
using namespace std;
typedef long long LL;
const int MaxN = 2e5;
const int Inf = 1 << 30;

int id, dep[MaxN + 5], fa[MaxN + 5], S[MaxN + 5], flag;
vector<int> G[MaxN + 5], ans;

void Dfs(int x, int f, int d) {
	dep[x] = d; fa[x] = f;
	if(d > dep[id]) id = x;
	int Size = G[x].size();
	for(int i = 0; i < Size; ++i) if(G[x][i] != f) Dfs(G[x][i], x, d + 1);
	return ;
}

int dfs(int x, int f) {
	S[x] = 1;
	int Size = G[x].size(), a = 0, b = 0, c = 0;
	for(int i = 0; i < Size && flag; ++i)
		if(G[x][i] != f) {
			if(a == 0) a = dfs(G[x][i], x);
			else {
				b = dfs(G[x][i], x);
				if(a != b) {
					if(abs(a - b) == 1) ++c;
					else flag = false;
				}
			}
			S[x] += S[G[x][i]];
		}
	if(S[x] == 1) return 2;
	else if(c == 0 && (1 << a) - 1 == S[x]) return a + 1;
	else if(S[x] == (1 << max(a, b)) - 2) {
		ans.push_back(x);
		++S[x];
		return max(a, b) + 1;
	}
	flag = false;
	return 1;
}

int main()
{
	int n, m, x, y, u, v, fx;
	while(~scanf("%d", &m)) {
		n = (1 << m) - 2;
		for(int i = 1; i < n; ++i) {
			scanf("%d %d", &u, &v);
			G[u].push_back(v);
			G[v].push_back(u);
		}
		id = 1;
		Dfs(1, -1, 1);
		x = id; fx = id;
		for(int i = 2; i < m; ++i) fx = fa[fx];
		Dfs(x, -1, 1);
		y = id;
		ans.clear(); flag = true;
		if((dep[y] - dep[x]) & 1) {//删除dep1
			for(int i = 2; i < m; ++i) y = fa[y];
			x = fx;
			if(x > y) swap(x, y);
			dfs(x, y);
			dfs(y, x);
			if(ans.size() == 0 && flag) {
				ans.push_back(x);
				ans.push_back(y);
			}
			else ans.clear();
		}
		else {//叶子or中间点
			for(int i = 1; i < m; ++i) y = fa[y];
			dfs(y, -1);
			if(ans.size() > 1) ans.clear();
		}
		printf("%d\n", ans.size());
		for(int i = 0; i < ans.size(); ++i) printf("%d%c", ans[i], i == ans.size() - 1 ? '\n' : ' ');
		for(int i = 1; i <= n; ++i) G[i].clear();
	}
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
using LL = long long;
using LD = long double;
#define FOR(i, x, y) for (decay<decltype(y)>::type i = (x), _##i = (y); i < _##i; ++i)
#define FORD(i, x, y) for (decay<decltype(x)>::type i = (x), _##i = (y); i > _##i; --i)
#ifdef zerol
#define dbg(x...)                             \
    do                                        \
    {                                         \
        cerr << "\033[32;1m" << #x << " -> "; \
        err(x);                               \
    } while (0)
#else
#define dbg(...)
#endif // zerol
void err()
{
    cerr << "\033[39;0m" << endl;
}
template <typename T, typename... A>
void err(T a, A... x)
{
    cerr << a << ' ';
    err(x...);
}
// ----------------------------------------------------------------------------------------

const int N = 1e6+10;

vector<int> E[N];
bool fuck[N];
set<int> alive;

int d[N], sz[N];

int Fa(int x) {
    for(auto y: E[x]) if(!fuck[y]) return y;
    assert(false);
}

int main() {
    int n; scanf("%d", &n);
    int m = (1<<n)-2;
    FOR(i, 1, m) {
        int u, v; scanf("%d%d", &u, &v); E[u].emplace_back(v); E[v].emplace_back(u);
        ++d[u]; ++d[v];
        if(d[u]>4 || d[v]>4) {
            puts("0");
            return 0;
        }
        alive.insert(i);
    }
    int ans = -1;
    alive.insert(m);
    FORD(i, n-1, 1) {
        int k = (1<<i);
        vector<int> now;
        for(auto x: alive) {
            if(d[x] == 1) {
                now.emplace_back(x);
            }
        }
        dbg(i, now.size(), k);
        if(now.size() == k) {
            for(auto x: now) {
                fuck[x] = true; alive.erase(x);
                int fa = Fa(x);
                --d[x]; --d[fa]; ++sz[fa];
            }
            for(auto x: alive) if(sz[x]!=0 && sz[x] !=2) {
                puts("0");
                return 0;
            }
        } else if(now.size() == k-1) {
            if(ans != -1) {
                puts("0");
                return 0;
            }
            for(auto x: now) {
                int fa = Fa(x);
                dbg(x, fa, d[fa]);
                if(d[fa] == 2) {
                    if(ans != -1) {
                        puts("0");
                        return 0;
                    }
                    ans = fa;
                    ++sz[fa];
                }
            }
            if(ans == -1) {
                puts("0");
                return 0;
            }
            for(auto x: now) {
                int fa = Fa(x);
                fuck[x] = true; alive.erase(x);
                ++sz[fa]; --d[x]; --d[fa];
            }
            for(auto x: alive) if(sz[x]!=0 && sz[x] !=2) {
                puts("0");
                return 0;
            }
        } else {
            puts("0");
            return 0;
        }
    }
    if(ans == -1) {
        puts("2");
        printf("%d %d\n", *alive.begin(), *++alive.begin());
        return 0;
    }
    else printf("1\n%d\n", ans);
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
using LL = long long;
using LD = long double;
#define FOR(i, x, y) for (decay<decltype(y)>::type i = (x), _##i = (y); i < _##i; ++i)
#define FORD(i, x, y) for (decay<decltype(x)>::type i = (x), _##i = (y); i > _##i; --i)
#ifdef zerol
#define dbg(x...)                             \
    do                                        \
    {                                         \
        cerr << "\033[32;1m" << #x << " -> "; \
        err(x);                               \
    } while (0)
#else
#define dbg(...)
#endif // zerol
void err()
{
    cerr << "\033[39;0m" << endl;
}
template <typename T, typename... A>
void err(T a, A... x)
{
    cerr << a << ' ';
    err(x...);
}
// ----------------------------------------------------------------------------------------

const int N = 1e6+10;

vector<int> E[N];
bool fuck[N];
set<int> alive;

int d[N], sz[N];

int Fa(int x) {
    for(auto y: E[x]) if(!fuck[y]) return y;
    assert(false);
}

int main() {
    int n; scanf("%d", &n);
    int m = (1<<n)-2;
    FOR(i, 1, m) {
        int u, v; scanf("%d%d", &u, &v); E[u].emplace_back(v); E[v].emplace_back(u);
        ++d[u]; ++d[v];
        if(d[u]>4 || d[v]>4) {
            puts("0");
            return 0;
        }
        alive.insert(i);
    }
    int ans = -1;
    alive.insert(m);
    FORD(i, n-1, 1) {
        int k = (1<<i);
        vector<int> now;
        for(auto x: alive) {
            if(d[x] == 1) {
                now.emplace_back(x);
            }
        }
        dbg(i, now.size(), k);
        if(now.size() == k) {
            for(auto x: now) {
                fuck[x] = true; alive.erase(x);
                int fa = Fa(x);
                dbg(x, fa);
                --d[x]; --d[fa]; ++sz[fa];
            }
            for(auto x: alive) if(sz[x]!=0 && sz[x] !=2) {
                puts("0");
                return 0;
            }
        } else if(now.size() == k-1) {
            if(ans != -1) {
                puts("0");
                return 0;
            }
            for(auto x: now) {
                int fa = Fa(x);
                // dbg(x, fa, d[fa]);
                if(d[fa] == 2) {
                    if(ans != -1) {
                        puts("0");
                        return 0;
                    }
                    dbg(x, fa);
                    ans = fa;
                    --sz[fa];
                }
            }
            if(ans == -1) {
                puts("0");
                return 0;
            }
            for(auto x: now) {
                int fa = Fa(x);
                fuck[x] = true; alive.erase(x);
                ++sz[fa]; --d[x]; --d[fa];
                dbg(x, fa);
            }
            for(auto x: alive) if(sz[x]!=0 && sz[x] !=2) {
                dbg(x, sz[x]);
                puts("0");
                return 0;
            }
        } else {
            puts("0");
            return 0;
        }
    }
    if(ans == -1) {
        puts("2");
        printf("%d %d\n", *alive.begin(), *++alive.begin());
        return 0;
    }
    else printf("1\n%d\n", ans);
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
using LL = long long;
using LD = long double;
#define FOR(i, x, y) for (decay<decltype(y)>::type i = (x), _##i = (y); i < _##i; ++i)
#define FORD(i, x, y) for (decay<decltype(x)>::type i = (x), _##i = (y); i > _##i; --i)
#ifdef zerol
#define dbg(x...)                             \
    do                                        \
    {                                         \
        cerr << "\033[32;1m" << #x << " -> "; \
        err(x);                               \
    } while (0)
#else
#define dbg(...)
#endif // zerol
void err()
{
    cerr << "\033[39;0m" << endl;
}
template <typename T, typename... A>
void err(T a, A... x)
{
    cerr << a << ' ';
    err(x...);
}
// ----------------------------------------------------------------------------------------

const int N = 1e6+10;

vector<int> E[N];
bool fuck[N];
set<int> alive;

int d[N];

int Fa(int x) {
    for(auto y: E[x]) if(!fuck[y]) return y;
}

int main() {
    int n; scanf("%d", &n);
    int m = (1<<n)-2;
    FOR(i, 1, m) {
        int u, v; scanf("%d%d", &u, &v); E[u].emplace_back(v); E[v].emplace_back(u);
        ++d[u]; ++d[v];
        alive.insert(i);
    }
    alive.insert(m);
    FORD(i, n-1, 0) {
        int k = (1<<i);
        vector<int> now;
        for(auto x: alive) {
            if(d[x] == 1) {
                now.emplace_back(x);
            }
        }
        dbg(i, now.size(), k);
        if(i == 1) {
            puts("2");
            printf("%d %d\n", *alive.begin(), *++alive.begin());
            return 0;
        } else
        if(now.size() == k) {
            for(auto x: now) {
                fuck[x] = true;
                int fa = Fa(x);
                --d[x]; --d[fa];
            }
        } else if(now.size() == k-1) {
            for(auto x: alive) if(d[x] == 1) {
                int fa = Fa(x);
                if(d[fa] == 2) {
                    puts("1");
                    printf("%d\n", fa);
                    return 0;
                }
            }
            puts("0");
            return 0;
        } else {
            puts("0");
            return 0;
        }
    }
    puts("0");
    return 0;
}


#include <iostream>
#include <vector>
#include <stdlib.h>
#include <map>
#include <algorithm>
#include <stack>
#include <queue>
#include <set>
#include <unordered_set>
#include <string>
#include <string.h>
#include <cmath>
#include <time.h>

using namespace std;

typedef long long ll;
#define MOD 1000000007
using namespace std;

vector<int> e[150000];
int d[150000];
int ans;

int dfs_s(int v,int p)
{
	int i;
	int max_v = 0;
	int	max_i;
	for (i = 0; i < e[v].size(); i++)
	{
		if (e[v][i] == p)
			continue;
		int tmp = dfs_s(e[v][i], v);
		if (tmp > max_v)
		{
			max_v = tmp;
			max_i = e[v][i];
		}
	}
	if (max_v)
		d[v] = max_i;
	else
		d[v] = 0;
	return max_v + 1;
}

int check(int v, int p)
{
	int i;
	int cv[3] = {};
	int cvt = 0;
	for (i = 0; i < e[v].size(); i++)
	{
		if (e[v][i] == p)
			continue;
		if (cvt >= 3)
			return 0;
		cv[cvt++] = check(e[v][i], v);
	}

	for (i = 0; i < cvt; i++)
	{
		if (cv[i] == 0)
			return 0;
	}

	if (cvt == 0)
		return 1;
	else if (cvt == 1)
	{
		if (cv[0] == 1)
		{
			if (ans == 0)
			{
				ans = v;
				return 2;
			}
			else
			{
				ans = -1;
				return 0;
			}
		}
		else
		{
			return 0;
		}
	}
	else if (cvt == 2)
	{
		if (cv[0] == cv[1])
			return cv[0] + 1;
		else
			return 0;
	}
	else if (cvt == 3)
	{
		sort(cv, cv + 3);
		if (cv[0] == cv[1] && cv[0] + 1 == cv[2])
		{
			if (ans == 0)
			{
				ans = v;
				return cv[2] + 1;
			}
			else
			{
				ans = -1;
				return 0;
			}
		}
		else
		{
			return 0;
		}
	}
}

int main()
{
	std::ios::sync_with_stdio(false);
	cin.tie(nullptr);
	cout.tie(nullptr);

	int n;
	cin >> n;
	int i;
	for (i = 0; i < ((1 << n) - 3); i++)
	{
		int a, b;
		cin >> a >> b;
		e[a].push_back(b);
		e[b].push_back(a);
	}

	dfs_s(1, 0);

	int p = 1;
	while (d[p] != 0)
	{
		p = d[p];
	}

	dfs_s(p, 0);

	int cnt = 0;
	int s = p;
	while (d[s] != 0)
	{
		cnt++;
		s = d[s];
	}

	if (cnt % 2 == 1)
	{
		int l = p;
		for (i = 0; i < cnt / 2; i++)
		{
			l = d[l];
		}

		int r = d[l];
		if (check(l, r) == n - 1 && check(r, l) == n - 1)
		{
			cout << 2 << endl;
			cout << min(l, r) << " " << max(l, r) << endl;
		}
		else
		{
			cout << 0 << endl;
		}
	}
	else
	{
		int l = p;
		for (i = 0; i < cnt / 2; i++)
		{
			l = d[l];
		}
		if (check(l,0) == n)
		{
			if (ans == -1)
				cout << 0 << endl;
			else
			{
				cout << 1 << endl;
				cout << ans << endl;
			}
		}
		else
		{
			cout << 0 << endl;
		}
	}
	return 0;
}


#include <iostream>
#include <vector>
#include <stdlib.h>
#include <map>
#include <algorithm>
#include <stack>
#include <queue>
#include <set>
#include <unordered_set>
#include <string>
#include <string.h>
#include <cmath>
#include <time.h>

using namespace std;

typedef long long ll;
#define MOD 1000000007
using namespace std;

vector<int> e[150000];
int d[150000];
int ans;

int dfs_s(int v,int p)
{
	int i;
	int max_v = 0;
	int	max_i;
	for (i = 0; i < e[v].size(); i++)
	{
		if (e[v][i] == p)
			continue;
		int tmp = dfs_s(e[v][i], v);
		if (tmp > max_v)
		{
			max_v = tmp;
			max_i = e[v][i];
		}
	}
	if (max_v)
		d[v] = max_i;
	else
		d[v] = 0;
	return max_v + 1;
}

int check(int v, int p)
{
	int i;
	int cv[3] = {};
	int cvt = 0;
	for (i = 0; i < e[v].size(); i++)
	{
		if (e[v][i] == p)
			continue;
		cv[cvt++] = check(e[v][i], v);
	}

	for (i = 0; i < cvt; i++)
	{
		if (cv[i] == 0)
			return 0;
	}

	if (cvt == 0)
		return 1;
	else if (cvt == 1)
	{
		if (cv[0] == 1)
		{
			if (ans == 0)
			{
				ans = v;
				return 2;
			}
			else
			{
				ans = -1;
				return 0;
			}
		}
		else
		{
			return 0;
		}
	}
	else if (cvt == 2)
	{
		if (cv[0] == cv[1])
			return cv[0] + 1;
		else
			return 0;
	}
	else if (cvt == 3)
	{
		sort(cv, cv + 3);
		if (cv[0] == cv[1] && cv[0] + 1 == cv[2])
		{
			if (ans == 0)
			{
				ans = v;
				return cv[2] + 1;
			}
			else
			{
				ans = -1;
				return 0;
			}
		}
		else
		{
			return 0;
		}
	}
}

int main()
{
	std::ios::sync_with_stdio(false);
	cin.tie(nullptr);
	cout.tie(nullptr);

	int n;
	cin >> n;
	int i;
	for (i = 0; i < ((1 << n) - 3); i++)
	{
		int a, b;
		cin >> a >> b;
		e[a].push_back(b);
		e[b].push_back(a);
	}

	dfs_s(1, 0);

	int p = 1;
	while (d[p] != 0)
	{
		p = d[p];
	}

	dfs_s(p, 0);

	int cnt = 0;
	int s = p;
	while (d[s] != 0)
	{
		cnt++;
		s = d[s];
	}

	if (cnt % 2 == 1)
	{
		int l = p;
		for (i = 0; i < cnt / 2; i++)
		{
			l = d[l];
		}

		int r = d[l];
		if (check(l, r) == n - 1 && check(r, l) == n - 1)
		{
			cout << 2 << endl;
			cout << min(l, r) << " " << max(l, r) << endl;
		}
		else
		{
			cout << 0 << endl;
		}
	}
	else
	{
		int l = p;
		for (i = 0; i < cnt / 2; i++)
		{
			l = d[l];
		}
		if (check(l,0) == n)
		{
			if (ans == -1)
				cout << 0 << endl;
			else
				cout << ans << endl;
		}
		else
		{
			cout << 0 << endl;
		}
	}
	return 0;
}


#include <iostream>
#include <vector>
#include <stdlib.h>
#include <map>
#include <algorithm>
#include <stack>
#include <queue>
#include <set>
#include <unordered_set>
#include <string>
#include <string.h>
#include <cmath>
#include <time.h>

using namespace std;

typedef long long ll;
#define MOD 1000000007
using namespace std;

vector<int> e[150000];
int d[150000];
int ans;

int dfs_s(int v,int p)
{
	int i;
	int max_v = 0;
	int	max_i;
	for (i = 0; i < e[v].size(); i++)
	{
		if (e[v][i] == p)
			continue;
		int tmp = dfs_s(e[v][i], v);
		if (tmp > max_v)
		{
			max_v = tmp;
			max_i = e[v][i];
		}
	}
	if (max_v)
		d[v] = max_i;
	else
		d[v] = 0;
	return max_v + 1;
}

int check(int v, int p)
{
	int i;
	int cv[3] = {};
	int cvt = 0;
	for (i = 0; i < e[v].size(); i++)
	{
		if (e[v][i] == p)
			continue;
		cv[cvt++] = check(e[v][i], v);
	}

	for (i = 0; i < cvt; i++)
	{
		if (cv[i] == 0)
			return 0;
	}

	if (cvt == 0)
		return 1;
	else if (cvt == 1)
	{
		if (cv[0] == 1)
		{
			if (ans == 0)
			{
				ans = v;
				return 2;
			}
			else
			{
				ans = -1;
				return 0;
			}
		}
		else
		{
			return 0;
		}
	}
	else if (cvt == 2)
	{
		if (cv[0] == cv[1])
			return cv[0] + 1;
		else
			return 0;
	}
	else if (cvt == 3)
	{
		sort(cv, cv + 3);
		if (cv[0] == cv[1] && cv[0] + 1 == cv[2])
		{
			if (ans == 0)
			{
				ans = v;
				return cv[2] + 1;
			}
			else
			{
				ans = -1;
				return 0;
			}
		}
		else
		{
			return 0;
		}
	}
}

int main()
{
	std::ios::sync_with_stdio(false);
	cin.tie(nullptr);
	cout.tie(nullptr);

	int n;
	cin >> n;
	int i;
	for (i = 0; i < ((1 << n) - 3); i++)
	{
		int a, b;
		cin >> a >> b;
		e[a].push_back(b);
		e[b].push_back(a);
	}

	dfs_s(1, 0);

	int p = 1;
	while (d[p] != 0)
	{
		p = d[p];
	}

	dfs_s(p, 0);

	int cnt = 0;
	int s = p;
	while (d[s] != 0)
	{
		cnt++;
		s = d[s];
	}

	if (cnt % 2 == 1)
	{
		int l = p;
		for (i = 0; i < cnt / 2; i++)
		{
			l = d[l];
		}

		int r = d[l];
		if (check(l, r) == n - 1 && check(r, l) == n - 1)
		{
			cout << 2 << endl;
			cout << min(l, r) << " " << max(l, r) << endl;
		}
		else
		{
			cout << 0 << endl;
		}
	}
	else
	{
		int l = p;
		for (i = 0; i < cnt / 2; i++)
		{
			l = d[l];
		}
		if (check(l,0) == n)
		{
			if (ans == -1)
				cout << 0 << endl;
			else
			{
				cout << 1 << endl;
				cout << ans << endl;
			}
		}
		else
		{
			cout << 0 << endl;
		}
	}
	return 0;
}


////////////////////////////////////////////    _LeMur_
//#pragma GCC optimize("Ofast,no-stack-protector")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
#define _CRT_SECURE_NO_WARNINGS
#include <unordered_map>
#include <unordered_set>
#include <functional>
#include <algorithm>
#include <iostream>
#include <cstring>
#include <cassert>
#include <chrono>
#include <random>
#include <bitset>
#include <cstdio>
#include <vector>
#include <string>
#include <ctime>
#include <stack>
#include <queue>
#include <cmath>
#include <list>
#include <map>
#include <set>

using namespace std;

const int N = 200005;
const int inf = 1000 * 1000 * 1000;
const int mod = 1000 * 1000 * 1000 + 7;

int n;
vector <int> g[N];

queue <int> q;
int depth[N];

void dfs(int v,int p){
    for(int i=0;i<(int)g[v].size();i++){
        int to = g[v][i];
        if(to == p)continue;
        dfs(to , v);
        depth[v] = max(depth[v] , depth[to] + 1);
    }
}

int H[N];
int mx , h;

void solve(int v,int p,int r){
    mx = max(mx , r);
    ++H[r];
    for(int i=0;i<(int)g[v].size();i++){
        int to = g[v][i];
        if(to == p)continue;
        solve(to , v , r + 1);
    }
}

bool check(int v){
    solve(v , -1 , 1);
    if(mx != h)return false;
    for(int i=1;i<=mx;i++){
        if(H[i] != (1 << (i - 1)))
            return false;
    }
    return true;
}

int main(){
	mt19937 myrand(chrono::steady_clock::now().time_since_epoch().count());
    cin >> n;
    h = n;
    n = (1 << n) - 2;
    for(int i=1;i<n;i++){
        int a , b;
        scanf("%d%d",&a,&b);
        g[a].push_back(b);
        g[b].push_back(a);
    }
    if(n == 2){
        cout << 2 << endl;
        cout << 1 << " " << 2 << endl;
        return 0;
    }
    int cnt = 0;
    int one = 0;
    int two = 0;
    for(int i=1;i<=n;i++){
        if((int)g[i].size() > 4){
            cout << 0 << endl;
            return 0;
        }
        if((int)g[i].size() == 4){
            ++cnt;
        }
        if((int)g[i].size() == 2){
            ++two;
        }
        if((int)g[i].size() == 1){
            ++one;
        }
    }
    if(cnt > 1 || two > 2){
        cout << 0 << endl;
        return 0;
    }
    if(one != (1 << (h - 1)) && one != (1 << (h - 1)) - 1){
        cout << 0 << endl;
        return 0;
    }
    if(cnt == 0){
        if(one == (1 << (h - 1))){
            if(two != 0){
                cout << 0 << endl;
                return 0;
            }
            for(int i=1;i<=n;i++){
                if((int)g[i].size() == 1){
                    depth[i] = 1;
                    q.push(i);
                }
            }
            while(!q.empty()){
                int v = q.front();
                q.pop();
                if(depth[v] == h - 1)continue;
                int z = 0;
                for(int i=0;i<(int)g[v].size();i++){
                    int to = g[v][i];
                    if(depth[to] == 0){
                        depth[to] = depth[v] + 1;
                        q.push(to);
                    }
                    if(depth[to] == depth[v] - 1) ++z;
                }
                if(depth[v] == 1 && z == 0 || depth[v] > 1 && z == 2){

                }
                else{
                    cout << 0 << endl;
                    return 0;
                }
            }
            vector <int> answ;
            for(int i=1;i<=n;i++){
                if(depth[i] == h - 1){
                    answ.push_back(i);
                }
            }
            if((int)answ.size() != 2){
                cout << 0 << endl;
                return 0;
            }
            int v = answ[0];
            for(int i=0;i<(int)g[v].size();i++){
                if(g[v][i] == answ[1]){
                    cout << 2 << endl;
                    cout << answ[0] << " " << answ[1] << endl;
                    return 0;
                }
            }
            cout << 0 << endl;
            return 0;
        }
        if(two != 2){
            cout << 0 << endl;
            return 0;
        }
        int root , res = 0;
        for(int i=1;i<=n;i++){
            if((int)g[i].size() == 2){
                for(int j=0;j<(int)g[i].size();j++){
                    int v = g[i][j];
                    if((int)g[v].size() == 1){
                        res = i;
                        break;
                    }
                }
                if(res != 0)break;
            }
        }
        if(res == 0){
            cout << 0 << endl;
            return 0;
        }
        for(int i=1;i<=n;i++){
            if((int)g[i].size() == 2){
                if(i != res){
                    root = i;
                    break;
                }
            }
        }
        g[res].push_back(n + 1);
        g[n + 1].push_back(res);
        if(check(root)){
            cout << 1 << endl;
            cout << res << endl;
        }
        else
            cout << 0 << endl;
        return 0;
    }
    if(one != (1 << (h - 1))){
        cout << 0 << endl;
        return 0;
    }
    int root , res;
    for(int i=1;i<=n;i++){
        if((int)g[i].size() == 4) res = i;
        if((int)g[i].size() == 2) root = i;
    }
    dfs(root , -1);
    int l1 = 0;
    vector <int> mas;
    for(int i=0;i<(int)g[res].size();i++){
        int v = g[res][i];
        if(depth[v] == depth[res] + 1)continue;
        if(depth[v] == depth[res] - 1) ++l1;
        if(depth[v] == depth[res] - 2) mas.push_back(v);
    }
    if((int)mas.size() != 2 || l1 != 1){
        cout << 0 << endl;
        return 0;
    }
    g[n + 1].push_back(mas[0]);
    g[n + 1].push_back(mas[1]);
    g[n + 1].push_back(res);
    g[res].push_back(n + 1);
    g[ mas[0] ].push_back(n + 1);
    g[ mas[1] ].push_back(n + 1);
    for(int i=0;i<(int)g[res].size();i++){
        if(g[res][i] == mas[0]){
            g[res].erase(g[res].begin() + i);
            break;
        }
    }
    for(int i=0;i<(int)g[res].size();i++){
        if(g[res][i] == mas[1]){
            g[res].erase(g[res].begin() + i);
            break;
        }
    }
    for(int i=0;i<(int)g[ mas[0] ].size();i++){
        if(g[ mas[0] ][i] == res){
            g[ mas[0] ].erase(g[ mas[0] ].begin() + i);
            break;
        }
    }
    for(int i=0;i<(int)g[ mas[1] ].size();i++){
        if(g[ mas[1] ][i] == res){
            g[ mas[1] ].erase(g[ mas[1] ].begin() + i);
            break;
        }
    }
    if(check(root)){
        cout << 1 << endl;
        cout << res << endl;
    }
    else
        cout << 0 << endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef int Long;

const Long MX = (1<<20);

vector<Long> adj[MX];
Long parent[MX];
Long grado[MX];
Long cnt[MX];
Long dist[MX];

Long dfs(Long u, Long p){
	parent[u] = p;
	cnt[u] = 1;
	for(Long v : adj[u]){
		if(v != p){
			cnt[u] += dfs(v,u);
		}
	}
	return cnt[u];
}

bool puede(Long root, Long n){
	Long aux = 0;
	dfs(root,-1);
	for(Long i = 1; i <= n; i++){
		vector<Long> sgt;
		for(Long v : adj[i]){
			if(v != parent[i]) sgt.push_back(cnt[v]);
		}
		sort(sgt.begin(),sgt.end());
		if(sgt.size() == 0) continue;
		if(sgt.size() == 1){
			aux++;
		}else if(sgt.size() == 3){
			aux++;
			if(sgt[2] - (sgt[0] + sgt[1]) != 1) aux = 2;
		}else if(sgt.size() == 2){
			if(sgt[1] - sgt[0] > 1) aux = 2;
		}else{
			aux = 2;
			break;
		}
	}
	return aux < 2;
}

void casi_raiz(Long n, Long lvl){
	for(Long i = 1; i <= n; i++){
		dist[i] = -1;
	}
	deque<Long> q;
	for(Long i = 1; i <= n; i++){
		if(adj[i].size() == 1){
			q.push_back(i);
			dist[i] = lvl;
		}
	}
	while(!q.empty()){
		Long u = q.front();
		q.pop_front();
		for(Long v : adj[u]){
			if(dist[v] == -1){
				dist[v] = dist[u] - 1;
				q.push_back(v);
			}
		}
	}

	vector<Long> posible;
	for(Long i = 1; i <= n; i++){
		if(dist[i] == 2){
			posible.push_back(i);
		}
	}
	if(posible.size() == 2){
		cout << 2 << "\n";
		if(puede(posible[0],n) && puede(posible[1],n)){
			cout << posible[0] << " " << posible[1] << "\n";
		}else{
			cout << 0 << "\n";
		}
	}else{
		cout << 0 << "\n";
	}
	return;
}

void medio(Long n){
	Long root = -1;
	for(Long i = 1; i <= n; i++){
		if(adj[i].size() == 2){
			root = i;
			break;
		}
	}

	if(puede(root,n)){
		cout << 1 << "\n";
		for(Long i = 1; i <= n; i++){
			if(4 == adj[i].size()){
				cout << i << "\n";
				break;
			}
		}
	}else{
		cout << 0 << "\n";
	}
	return;
}

void hoja(Long n){
	Long root = -1;
	Long posible = -1;
	for(Long i = 1; i <= n; i++){
		if(adj[i].size() == 1){
			if(adj[adj[i][0]].size() == 2){
				posible = adj[i][0];
				break;
			}
		}
	}
	for(Long i = 1; i <= n; i++){
		if(adj[i].size() == 2 && i != posible){
			root = i;
			break;
		}
	}

	if(puede(root,n)){
		cout << 1 << "\n";
		cout << posible << "\n";
	}else{
		cout << 0 << "\n";
	}
	return;
}

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	cout.precision(10);
	cout << fixed;

	Long n, x, y;
	cin >> n;

	Long total = ((1<<n) - 2);
	Long hojas = (1<<(n-1));

	if(n == 2){
		Long a, b;
		cin >> a >> b;
		if(a > b) swap(a,b);
		cout << 2 << "\n" << a << " " << b << "\n";
		return 0;
	}

	for(Long i = 1; i < total; i++){
		cin >> x >> y;
		adj[x].push_back(y);
		adj[y].push_back(x);
	}

	for(Long i = 1; i <= total; i++){
		grado[adj[i].size()]++;
	}

	if(grado[1] == hojas && grado[3] == total - hojas){
		casi_raiz(total,n);
	}else if(grado[4] == 1 && grado[2] == 1 && grado[1] == hojas && grado[3] == total - hojas - 2){
		medio(total);
	}else if(grado[2] == 2 && grado[1] == hojas - 1 && grado[3] == total - hojas - 1){
		hoja(total);
	}else{
		cout << 0 << "\n";
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef int Long;

const Long MX = (1<<20);

vector<Long> adj[MX];
Long grado[MX];
Long dist[MX];

void casi_raiz(Long n, Long lvl){
	for(Long i = 1; i <= n; i++){
		dist[i] = -1;
	}
	deque<Long> q;
	for(Long i = 1; i <= n; i++){
		if(adj[i].size() == 1){
			q.push_back(i);
			dist[i] = lvl;
		}
	}
	while(!q.empty()){
		Long u = q.front();
		q.pop_front();
		for(Long v : adj[u]){
			if(dist[v] == -1){
				dist[v] = dist[u] - 1;
				q.push_back(v);
			}
		}
	}
	cout << 2 << "\n";
	for(Long i = 1; i <= n; i++){
		if(dist[i] == 2){
			cout << i << " ";
		}
	}
	cout << "\n";
	return;
}

void medio(Long n){
	cout << 1 << "\n";
	for(Long i = 1; i <= n; i++){
		if(4 == adj[i].size()){
			cout << i << "\n";
			break;
		}
	}
	return;
}

void hoja(Long n){
	cout << 1 << "\n";
	for(Long i = 1; i <= n; i++){
		if(adj[i].size() == 1){
			if(adj[adj[i][0]].size() == 2){
				cout << adj[i][0] << "\n";
				break;
			}
		}
	}
	return;
}

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	cout.precision(10);
	cout << fixed;

	Long n, x, y;
	cin >> n;

	Long total = ((1<<n) - 2);
	Long hojas = (1<<(n-1));

	if(n == 2){
		Long a, b;
		cin >> a >> b;
		if(a > b) swap(a,b);
		cout << 2 << "\n" << a << " " << b << "\n";
		return 0;
	}

	for(Long i = 1; i < total; i++){
		cin >> x >> y;
		adj[x].push_back(y);
		adj[y].push_back(x);
	}

	for(Long i = 1; i <= total; i++){
		grado[adj[i].size()]++;
	}

	if(grado[1] == hojas && grado[3] == total - hojas){
		casi_raiz(total,n);
	}else if(grado[4] == 1 && grado[2] == 1 && grado[1] == hojas && grado[3] == total - hojas - 2){
		medio(total);
	}else if(grado[2] == 2 && grado[1] == hojas - 1 && grado[3] == total - hojas - 1){
		hoja(total);
	}else{
		cout << 0 << "\n";
	}
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define N 1000005

vector < int > a[N];
int vis[N], vis1[N], vis2[N];
int level[N], level1[N], level2[N];
int sz[N];

void init()
{
    for(int i=0;i<N;i++)
    {
        vis[i] = 0;
        sz[i] = 0;
    }
}

void dfs(int n)
{
    vis[n] = 1;
    for(int i=0;i<a[n].size();i++)
    {
        if(vis[a[n][i]]==0)
        {
            level[a[n][i]] = level[n] + 1;
            dfs(a[n][i]);
        }
    }
}

void dfs1(int n)
{
    vis1[n] = 1;
    for(int i=0;i<a[n].size();i++)
    {
        if(vis1[a[n][i]]==0)
        {
            level1[a[n][i]] = level1[n] + 1;
            dfs1(a[n][i]);
        }
    }
}

void dfs2(int n)
{
    vis2[n] = 1;
    for(int i=0;i<a[n].size();i++)
    {
        if(vis2[a[n][i]]==0)
        {
            level2[a[n][i]] = level2[n] + 1;
            dfs2(a[n][i]);
        }
    }
}

vector < int > ans;
int isc[N];

int foo(int n)
{
    vis[n] = 1;
    sz[n] = 1;

    int valid = 0;
    set < int > s;
    for(int i=0;i<a[n].size();i++)
    {
        if(vis[a[n][i]]==0)
        {
            foo(a[n][i]);
            sz[n]+=sz[a[n][i]];
            s.insert(sz[a[n][i]]);
        }
    }
    if(s.size()>1)
        return isc[n] =0;

    if(a[n].size()!=3 && a[n].size()!=1)
        return isc[n] = 0;

    return isc[n] = 1;
}

int aa = 0;

int check1(int n)
{
    vis[n] = 1;
    vector < int > temp;
    for(int i=0;i<a[n].size();i++)
    {
        if(vis[a[n][i]]==0)
        {
            temp.push_back(a[n][i]);
        }
    }

    if(temp.size()==2)
    {
        if( sz[temp[0]] > sz[temp[1]])
        {
            swap(temp[0], temp[1]);
        }
            if(check1(temp[0]) && isc[temp[1]])
            {
                if(sz[temp[0]] != sz[temp[1]] && aa==0)
                    aa = n;
                return 1;
            }
            else
                return 0;
    }
    else if(temp.size()==3)
    {
        if(isc[temp[0]] && isc[temp[1]] && isc[temp[2]])
        {
            if(aa==0)
                aa = n;
            return 1;
        }
        return 0;
    }
    if(aa==0)
        aa = n;
    return 1;
}

void check(int n)
{
    aa = 0;
    init();
    vis[n] = 1;
    int vaild = 1;

    if(a[n].size() > 3)
        return ;
    for(int i=0;i<a[n].size();i++)
    {
        foo(a[n][i]);
    }

    for(int i=0;i<N;i++)
        vis[i]=0;
    vis[n] = 1;
    int x = check1(n);
    if( x == 1)
        ans.push_back(aa);
}

int32_t main()
{
    int n;
    cin>>n;

    int m = pow(2, n) - 3;
    int root = 0;

    for(int i=0;i<m;i++)
    {
        int u, v;
        cin>>u>>v;
        root = u;
        a[u].push_back(v);
        a[v].push_back(u);
    }

    init();
    dfs(root);

    int max1 = 0;
    int maxn = pow(2, n);
    for(int i=1; i<= maxn; i++)
    {
        if(level[i] > level[max1])
        {
            max1 = i;
        }
    }

    dfs1(max1);
    int max2 = 0;
    for(int i=1; i<= maxn; i++)
    {
        if(level1[i] > level1[max2])
        {
            max2 = i;
        }
    }

    dfs2(max2);

    int req = level1[max2];
    req++;
    req/=2;

    for(int i=1;i<= maxn; i++)
    {
        if( (level1[i] + level2[i]) == level1[max2] && abs(level1[i]-level2[i])<=1)
        {
         //   cout<<i<<endl;
            check(i);
        }
    }

    cout<<ans.size()<<endl;
    sort(ans.begin(), ans.end());
    for(int i=0;i<ans.size();i++)
    {
        cout<<ans[i]<<" ";
    }
    cout<<endl;

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define N 100005

vector < int > a[N];
int vis[N], vis1[N], vis2[N];
int level[N], level1[N], level2[N];
int sz[N];

void init()
{
    for(int i=0;i<N;i++)
    {
        vis[i] = 0;
        sz[i] = 0;
    }
}

void dfs(int n)
{
    vis[n] = 1;
    for(int i=0;i<a[n].size();i++)
    {
        if(vis[a[n][i]]==0)
        {
            level[a[n][i]] = level[n] + 1;
            dfs(a[n][i]);
        }
    }
}

void dfs1(int n)
{
    vis1[n] = 1;
    for(int i=0;i<a[n].size();i++)
    {
        if(vis1[a[n][i]]==0)
        {
            level1[a[n][i]] = level1[n] + 1;
            dfs1(a[n][i]);
        }
    }
}

void dfs2(int n)
{
    vis2[n] = 1;
    for(int i=0;i<a[n].size();i++)
    {
        if(vis2[a[n][i]]==0)
        {
            level2[a[n][i]] = level2[n] + 1;
            dfs2(a[n][i]);
        }
    }
}

vector < int > ans;
int isc[N];

int foo(int n)
{
    vis[n] = 1;
    sz[n] = 1;

    int valid = 0;
    set < int > s;
    for(int i=0;i<a[n].size();i++)
    {
        if(vis[a[n][i]]==0)
        {
            foo(a[n][i]);
            sz[n]+=sz[a[n][i]];
            s.insert(sz[a[n][i]]);
        }
    }
    if(s.size()>1)
        return isc[n] =0;

    if(a[n].size()!=3 && a[n].size()!=1)
        return isc[n] = 0;

    return isc[n] = 1;
}

int aa = 0;

int check1(int n)
{
    vis[n] = 1;
    vector < int > temp;
    for(int i=0;i<a[n].size();i++)
    {
        if(vis[a[n][i]]==0)
        {
            temp.push_back(a[n][i]);
        }
    }

    if(temp.size()==2)
    {
        if( sz[temp[0]] > sz[temp[1]])
        {
            swap(temp[0], temp[1]);
        }
            if(check1(temp[0]) && isc[temp[1]])
            {
                if(sz[temp[0]] != sz[temp[1]] && aa==0)
                    aa = n;
                return 1;
            }
            else
                return 0;
    }
    else if(temp.size()==3)
    {
        if(isc[temp[0]] && isc[temp[1]] && isc[temp[2]])
        {
            if(aa==0)
                aa = n;
            return 1;
        }
        return 0;
    }
    if(aa==0)
        aa = n;
    return 1;
}

void check(int n)
{
    aa = 0;
    init();
    vis[n] = 1;
    int vaild = 1;

    for(int i=0;i<a[n].size();i++)
    {
        foo(a[n][i]);
    }

    for(int i=0;i<N;i++)
        vis[i]=0;
    vis[n] = 1;
    int x = check1(n);
    if( x == 1)
        ans.push_back(aa);
}

int32_t main()
{
    int n;
    cin>>n;

    int m = pow(2, n) - 3;
    int root = 0;

    for(int i=0;i<m;i++)
    {
        int u, v;
        cin>>u>>v;
        root = u;
        a[u].push_back(v);
        a[v].push_back(u);
    }

    init();
    dfs(root);

    int max1 = 0;
    int maxn = pow(2, n);
    for(int i=1; i<= maxn; i++)
    {
        if(level[i] > level[max1])
        {
            max1 = i;
        }
    }

    dfs1(max1);
    int max2 = 0;
    for(int i=1; i<= maxn; i++)
    {
        if(level1[i] > level1[max2])
        {
            max2 = i;
        }
    }

    dfs2(max2);

    int req = level1[max2];
    req++;
    req/=2;

    for(int i=1;i<= maxn; i++)
    {
        if( (level1[i] + level2[i]) == level1[max2] && abs(level1[i]-level2[i])<=1)
        {
            check(i);
        }
    }

    cout<<ans.size()<<endl;
    sort(ans.begin(), ans.end());
    for(int i=0;i<ans.size();i++)
    {
        cout<<ans[i]<<" ";
    }
    cout<<endl;

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define N 100005

vector < int > a[N];
int vis[N], vis1[N], vis2[N];
int level[N], level1[N], level2[N];
int sz[N];

void init()
{
    for(int i=0;i<N;i++)
    {
        vis[i] = 0;
        sz[i] = 0;
    }
}

void dfs(int n)
{
    vis[n] = 1;
    for(int i=0;i<a[n].size();i++)
    {
        if(vis[a[n][i]]==0)
        {
            level[a[n][i]] = level[n] + 1;
            dfs(a[n][i]);
        }
    }
}

void dfs1(int n)
{
    vis1[n] = 1;
    for(int i=0;i<a[n].size();i++)
    {
        if(vis1[a[n][i]]==0)
        {
            level1[a[n][i]] = level1[n] + 1;
            dfs1(a[n][i]);
        }
    }
}

void dfs2(int n)
{
    vis2[n] = 1;
    for(int i=0;i<a[n].size();i++)
    {
        if(vis2[a[n][i]]==0)
        {
            level2[a[n][i]] = level2[n] + 1;
            dfs2(a[n][i]);
        }
    }
}

vector < int > ans;
int isc[N];

int foo(int n)
{
    vis[n] = 1;
    sz[n] = 1;

    int valid = 0;
    set < int > s;
    for(int i=0;i<a[n].size();i++)
    {
        if(vis[a[n][i]]==0)
        {
            foo(a[n][i]);
            sz[n]+=sz[a[n][i]];
            s.insert(sz[a[n][i]]);
        }
    }
    if(s.size()>1)
        return isc[n] =0;

    if(a[n].size()!=3 && a[n].size()!=1)
        return isc[n] = 0;

    return isc[n] = 1;
}

int aa = 0;

int check1(int n)
{
    vis[n] = 1;
    vector < int > temp;
    for(int i=0;i<a[n].size();i++)
    {
        if(vis[a[n][i]]==0)
        {
            temp.push_back(a[n][i]);
        }
    }

    if(temp.size()==2)
    {
        if( sz[temp[0]] > sz[temp[1]])
        {
            swap(temp[0], temp[1]);
        }
            if(check1(temp[0]) && isc[temp[1]])
            {
                if(sz[temp[0]] != sz[temp[1]] && aa==0)
                    aa = n;
                return 1;
            }
            else
                return 0;
    }
    else if(temp.size()==3)
    {
        if(isc[temp[0]] && isc[temp[1]] && isc[temp[2]])
        {
            if(aa==0)
                aa = n;
            return 1;
        }
        return 0;
    }
    if(aa==0)
        aa = n;
    return 1;
}

void check(int n)
{
    aa = 0;
    init();
    vis[n] = 1;
    int vaild = 1;

    if(a[n].size() > 3)
        return ;
    for(int i=0;i<a[n].size();i++)
    {
        foo(a[n][i]);
    }

    for(int i=0;i<N;i++)
        vis[i]=0;
    vis[n] = 1;
    int x = check1(n);
    if( x == 1)
        ans.push_back(aa);
}

int32_t main()
{
    int n;
    cin>>n;

    int m = pow(2, n) - 3;
    int root = 0;

    for(int i=0;i<m;i++)
    {
        int u, v;
        cin>>u>>v;
        root = u;
        a[u].push_back(v);
        a[v].push_back(u);
    }

    init();
    dfs(root);

    int max1 = 0;
    int maxn = pow(2, n);
    for(int i=1; i<= maxn; i++)
    {
        if(level[i] > level[max1])
        {
            max1 = i;
        }
    }

    dfs1(max1);
    int max2 = 0;
    for(int i=1; i<= maxn; i++)
    {
        if(level1[i] > level1[max2])
        {
            max2 = i;
        }
    }

    dfs2(max2);

    int req = level1[max2];
    req++;
    req/=2;

    for(int i=1;i<= maxn; i++)
    {
        if( (level1[i] + level2[i]) == level1[max2] && abs(level1[i]-level2[i])<=1)
        {
         //   cout<<i<<endl;
            check(i);
        }
    }

    cout<<ans.size()<<endl;
    sort(ans.begin(), ans.end());
    for(int i=0;i<ans.size();i++)
    {
        cout<<ans[i]<<" ";
    }
    cout<<endl;

    return 0;
}


#include <bits/stdc++.h>

#define pb push_back
#define F first
#define S second
#define all(x) x.begin(), x.end()

using namespace std;

typedef long long ll;
typedef long double ld;
typedef string str;
typedef pair<ll, ll> pll;

const ll Mod = 1e9 + 7;
const int Maxn = 2e5 + 10;
const ll Inf = 1000000000000000LL;
ll n;
vector<ll> G[Maxn];

ll sub[Maxn];
void DFS(ll u, ll p){
	sub[u] = 1;
	for(auto adj : G[u]){
		if(adj == p) continue;
		DFS(adj, u);
		sub[u] += sub[adj];
	}
}
ll cent(ll u, ll p){
	for(auto adj : G[u]){
		if(adj == p) continue;
		if(sub[adj] + sub[adj] <= n) continue;
		return cent(adj, u);
	}
	return u;
}
ll dp[Maxn], f[Maxn];
vector<int> C[Maxn];

ll CMP(ll i, ll j){
	return dp[i] < dp[j];
}
ll gd = 0;

void dfs(ll u, ll p){

	ll cnt = 0;
	for(auto adj : G[u]){
		if(adj != p){
			dfs(adj, u);
			C[u].pb(adj);
			cnt ++;
		}
	}
	if(cnt == 0){
		dp[u] = 1;
		f[u] = false;
		return ;
	}
	if(cnt == 1){
		if(dp[C[u].back()] == 1){
			dp[u] = 2;
			f[u] = true;
			gd = u;
		} else {
			dp[u] = -Inf;
		}
		return ;
	}
	if(cnt == 2){
		if(dp[C[u][0]] == dp[C[u][1]]){
			dp[u] = dp[C[u][0]] + 1;
			f[u] = f[C[u][0]] | f[C[u][1]];
			if(f[C[u][0]] && f[C[u][1]]) dp[u] = -Inf;
		}else{
			dp[u] = -Inf;
		}
		return ;
	}
	sort(all(C[u]), CMP);

	ll c0 = C[u][0];
	ll c1 = C[u][1];
	ll c2 = C[u][2];
	if(dp[c0] == dp[c1] && dp[c1] + 1== dp[c2] ){
		dp[u] = dp[c2] + 1;
		f[u] = true;
		gd = u;
		if(f[c0] || f[c1] || f[c2]){
			dp[u] = -Inf;
		}
	}
}

ll N;
set<ll> st;
bool check(ll u){
	//cerr << u << '\n';
	memset(dp, 0, sizeof dp);
	fill(f, f + Maxn, false);
	for(int i = 0; i < Maxn; i++)C[i].clear();
	dfs(u, -1);
	if(dp[u] == N && f[u]){
		st.insert(gd);
	}
	return true;
}

int main(){
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	//ll N;
	cin >> N;
	ll m = (1ll << N) - 3;
	n = m + 1;
	ll u, v;
	for(int i = 1; i < n; i++){
		cin >> u >> v;
		G[u].pb(v);
		G[v].pb(u);
	}
	DFS(1, -1);
	ll cr = cent(1, -1);
	if(G[cr].size() > 3) return cout << -1, 0;
	bool res = check(cr);
	for(auto adj : G[cr]){
		check(adj);
	}
	cout << st.size() << '\n';
	for(auto x : st) cout << x << ' ';
	return 0;
}

/*
in sision we trust !
*/


#include <bits/stdc++.h>

#define pb push_back
#define F first
#define S second
#define all(x) x.begin(), x.end()

using namespace std;

typedef long long ll;
typedef long double ld;
typedef string str;
typedef pair<ll, ll> pll;

const ll Mod = 1e9 + 7;
const int Maxn = 2e5 + 10;
const ll Inf = 1000000000000000LL;
ll n;
vector<ll> G[Maxn];

ll sub[Maxn];
void DFS(ll u, ll p){
	sub[u] = 1;
	for(auto adj : G[u]){
		if(adj == p) continue;
		DFS(adj, u);
		sub[u] += sub[adj];
	}
}
ll cent(ll u, ll p){
	for(auto adj : G[u]){
		if(adj == p) continue;
		if(sub[adj] + sub[adj] <= n) continue;
		return cent(adj, u);
	}
	return u;
}
ll dp[Maxn], f[Maxn];
vector<int> C[Maxn];

ll CMP(ll i, ll j){
	return dp[i] < dp[j];
}
ll gd = 0;

void dfs(ll u, ll p){

	ll cnt = 0;
	for(auto adj : G[u]){
		if(adj != p){
			dfs(adj, u);
			C[u].pb(adj);
			cnt ++;
		}
	}
	if(cnt == 0){
		dp[u] = 1;
		f[u] = false;
		return ;
	}
	if(cnt == 1){
		if(dp[C[u].back()] == 1){
			dp[u] = 2;
			f[u] = true;
			gd = u;
		} else {
			dp[u] = -Inf;
		}
		return ;
	}
	if(cnt == 2){
		if(dp[C[u][0]] == dp[C[u][1]]){
			dp[u] = dp[C[u][0]] + 1;
			f[u] = f[C[u][0]] | f[C[u][1]];
			if(f[C[u][0]] && f[C[u][1]]) dp[u] = -Inf;
		}else{
			dp[u] = -Inf;
		}
		return ;
	}
	sort(all(C[u]), CMP);

	ll c0 = C[u][0];
	ll c1 = C[u][1];
	ll c2 = C[u][2];
	if(dp[c0] == dp[c1] && dp[c1] + 1== dp[c2] ){
		dp[u] = dp[c2] + 1;
		f[u] = true;
		gd = u;
		if(f[c0] || f[c1] || f[c2]){
			dp[u] = -Inf;
		}
	}
}

ll N;
set<ll> st;
bool check(ll u){
	//cerr << u << '\n';
	memset(dp, 0, sizeof dp);
	fill(f, f + Maxn, false);
	for(int i = 0; i < Maxn; i++)C[i].clear();
	dfs(u, -1);
	if(dp[u] == N && f[u]){
		st.insert(gd);
	}
	return true;
}

int main(){
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	//ll N;
	cin >> N;
	ll m = (1ll << N) - 3;
	n = m + 1;
	ll u, v;
	for(int i = 1; i < n; i++){
		cin >> u >> v;
		G[u].pb(v);
		G[v].pb(u);
	}
	DFS(1, -1);
	ll cr = cent(1, -1);
	if(G[cr].size() > 3) return cout << 0, 0;
	bool res = check(cr);
	for(auto adj : G[cr]){
		check(adj);
	}
	cout << st.size() << '\n';
	for(auto x : st) cout << x << ' ';
	return 0;
}

/*
in sision we trust !
*/


#include <bits/stdc++.h>

#define pb push_back
#define F first
#define S second
#define all(x) x.begin(), x.end()

using namespace std;

typedef long long ll;
typedef long double ld;
typedef string str;
typedef pair<ll, ll> pll;

const ll Mod = 1e9 + 7;
const int Maxn = 250 + 10;
const ll Inf = 1000000000000000LL;
ll n;
vector<ll> G[Maxn];

ll sub[Maxn];
void DFS(ll u, ll p){
	sub[u] = 1;
	for(auto adj : G[u]){
		if(adj == p) continue;
		DFS(adj, u);
		sub[u] += sub[adj];
	}
}
ll cent(ll u, ll p){
	for(auto adj : G[u]){
		if(adj == p) continue;
		if(sub[adj] + sub[adj] <= n) continue;
		return cent(adj, u);
	}
	return u;
}
ll dp[Maxn], f[Maxn];
vector<int> C[Maxn];

ll CMP(ll i, ll j){
	return dp[i] < dp[j];
}
ll gd = 0;

void dfs(ll u, ll p){

	ll cnt = 0;
	for(auto adj : G[u]){
		if(adj != p){
			dfs(adj, u);
			C[u].pb(adj);
			cnt ++;
		}
	}
	if(cnt == 0){
		dp[u] = 1;
		f[u] = false;
		return ;
	}
	if(cnt == 1){
		if(dp[C[u].back()] == 1){
			dp[u] = 2;
			f[u] = true;
			gd = u;
		} else {
			dp[u] = -Inf;
		}
		return ;
	}
	if(cnt == 2){
		if(dp[C[u][0]] == dp[C[u][1]]){
			dp[u] = dp[C[u][0]] + 1;
			f[u] = f[C[u][0]] | f[C[u][1]];
			if(f[C[u][0]] && f[C[u][1]]) dp[u] = -Inf;
		}else{
			dp[u] = -Inf;
		}
		return ;
	}
	sort(all(C[u]), CMP);

	ll c0 = C[u][0];
	ll c1 = C[u][1];
	ll c2 = C[u][2];
	if(dp[c0] == dp[c1] && dp[c1] == dp[c2] + 1){
		dp[u] = dp[c2] + 1;
		f[u] = true;
		gd = u;
		if(f[c0] || f[c1] || f[c2]){
			dp[u] = -Inf;
		}
	}
}

ll N;
set<ll> st;
bool check(ll u){
	//cerr << u << '\n';
	memset(dp, 0, sizeof dp);
	fill(f, f + Maxn, false);
	for(int i = 0; i < Maxn; i++)C[i].clear();
	dfs(u, -1);
	if(dp[u] == N && f[u]){
		st.insert(gd);
	}
	return true;
}

int main(){
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	//ll N;
	cin >> N;
	ll m = (1ll << N) - 3;
	n = m + 1;
	ll u, v;
	for(int i = 1; i < n; i++){
		cin >> u >> v;
		G[u].pb(v);
		G[v].pb(u);
	}
	DFS(1, -1);
	ll cr = cent(1, -1);
	if(G[cr].size() > 3) return cout << -1, 0;
	bool res = check(cr);
	for(auto adj : G[cr]){
		check(adj);
	}
	cout << st.size() << '\n';
	for(auto x : st) cout << x << ' ';
	return 0;
}

/*
in sision we trust !
*/


#include <bits/stdc++.h>

#define pb push_back
#define F first
#define S second
#define all(x) x.begin(), x.end()

using namespace std;

typedef long long ll;
typedef long double ld;
typedef string str;
typedef pair<ll, ll> pll;

const ll Mod = 1e9 + 7;
const int Maxn = 250 + 10;
const ll Inf = 1000000000000000LL;
ll n;
vector<ll> G[Maxn];

ll sub[Maxn];
void DFS(ll u, ll p){
	sub[u] = 1;
	for(auto adj : G[u]){
		if(adj == p) continue;
		DFS(adj, u);
		sub[u] += sub[adj];
	}
}
ll cent(ll u, ll p){
	for(auto adj : G[u]){
		if(adj == p) continue;
		if(sub[adj] + sub[adj] <= n) continue;
		return cent(adj, u);
	}
	return u;
}
ll dp[Maxn], f[Maxn];
vector<int> C[Maxn];

ll CMP(ll i, ll j){
	return dp[i] < dp[j];
}
ll gd = 0;

void dfs(ll u, ll p){

	ll cnt = 0;
	for(auto adj : G[u]){
		if(adj != p){
			dfs(adj, u);
			C[u].pb(adj);
			cnt ++;
		}
	}
	if(cnt == 0){
		dp[u] = 1;
		f[u] = false;
		return ;
	}
	if(cnt == 1){
		if(dp[C[u].back()] == 1){
			dp[u] = 2;
			f[u] = true;
			gd = u;
		} else {
			dp[u] = -Inf;
		}
		return ;
	}
	if(cnt == 2){
		if(dp[C[u][0]] == dp[C[u][1]]){
			dp[u] = dp[C[u][0]] + 1;
			f[u] = f[C[u][0]] | f[C[u][1]];
			if(f[C[u][0]] && f[C[u][1]]) dp[u] = -Inf;
		}else{
			dp[u] = -Inf;
		}
		return ;
	}
	sort(all(C[u]), CMP);

	ll c0 = C[u][0];
	ll c1 = C[u][1];
	ll c2 = C[u][2];
	if(dp[c0] == dp[c1] && dp[c1] + 1== dp[c2] ){
		dp[u] = dp[c2] + 1;
		f[u] = true;
		gd = u;
		if(f[c0] || f[c1] || f[c2]){
			dp[u] = -Inf;
		}
	}
}

ll N;
set<ll> st;
bool check(ll u){
	//cerr << u << '\n';
	memset(dp, 0, sizeof dp);
	fill(f, f + Maxn, false);
	for(int i = 0; i < Maxn; i++)C[i].clear();
	dfs(u, -1);
	if(dp[u] == N && f[u]){
		st.insert(gd);
	}
	return true;
}

int main(){
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	//ll N;
	cin >> N;
	ll m = (1ll << N) - 3;
	n = m + 1;
	ll u, v;
	for(int i = 1; i < n; i++){
		cin >> u >> v;
		G[u].pb(v);
		G[v].pb(u);
	}
	DFS(1, -1);
	ll cr = cent(1, -1);
	if(G[cr].size() > 3) return cout << -1, 0;
	bool res = check(cr);
	for(auto adj : G[cr]){
		check(adj);
	}
	cout << st.size() << '\n';
	for(auto x : st) cout << x << ' ';
	return 0;
}

/*
in sision we trust !
*/


#include <bits/stdc++.h>
using namespace std;

const int N = 18;

int n, nn, good, dp[1 << N], type[1 << N];
vector<int> ans, nei[1 << N], vec[1 << N];

void input() {
	cin >> n;
	nn = (1 << n) - 1;
	for (int i = 0; i < nn - 2; i++) {
		int u, v;
		cin >> u >> v;
		nei[--u].push_back(--v);
		nei[v].push_back(u);
	}
}

void dfs(int v = 0, int par = -1) {
	for (int u: nei[v])
		if (u ^ par) {
			dfs(u, v);
			dp[v] += dp[u];
			vec[v].push_back(dp[u]);
		}
	if (++dp[v] != nn - 1)
		vec[v].push_back(nn - 1 - dp[v]);
	sort(vec[v].begin(), vec[v].end());
}

void go(int v, int par = -1) {
	vector<int> vec;
	for (int u: nei[v])
		if (u ^ par) {
			go(u, v);
			vec.push_back(type[u]);
		}

	sort(vec.begin(), vec.end());
	if (vec.empty())
		type[v] = 2;
	else if (vec.size() == 1) {
		if (vec[0] == 2) {
			type[v] = 2 * 2 + 1;
			good = v;
		}
		else
			type[v] = -1;
	}
	else if (vec.size() == 2) {
		if (vec[0] & 1)
			type[v] = -1;
		if (vec[0] == vec[1])
			type[v] = vec[0] + 2;
		else if (vec[0] + 1 == vec[1])
			type[v] = vec[1] + 2;
		else
			type[v] = -1;
	}
	else if (vec.size() == 3) {
		if (vec[0] == vec[1] && vec[0] + 2 == vec[2] && (vec[0] % 2 == 0)) {
			type[v] = vec[2] + 2 + 1;
			good = v;
		}
		else
			type[v] = -1;
	}
	else
		type[v] = -1;
}

void check(int root) {
	go(root);
	if (type[root] != 2 * n + 1)
		return;
	ans.push_back(good);
}

void solve() {
	for (int v = 0; v < nn - 1; v++)
		if (vec[v].back() == (1 << (n - 1)) - 1)
			check(v);
}

void output() {
	sort(ans.begin(), ans.end());
	ans.resize(unique(ans.begin(), ans.end()) - ans.begin());
	cout << ans.size() << '\n';
	for (int v: ans)
		cout << ++v << ' ';
}

int main() {
	ios::sync_with_stdio(false), cin.tie(0);
	input();
	dfs();
	solve();
	output();
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

const int N = 18;

int n, nn, good, dp[1 << N], type[1 << N];
vector<int> ans, nei[1 << N], vec[1 << N];

void input() {
	cin >> n;
	nn = (1 << n) - 1;
	for (int i = 0; i < nn - 2; i++) {
		int u, v;
		cin >> u >> v;
		nei[--u].push_back(--v);
		nei[v].push_back(u);
	}
	if (n == 2) {
		cout << "2\n1 2";
		exit(0);
	}
}

void dfs(int v = 0, int par = -1) {
	for (int u: nei[v])
		if (u ^ par) {
			dfs(u, v);
			dp[v] += dp[u];
			vec[v].push_back(dp[u]);
		}
	if (++dp[v] != nn - 1)
		vec[v].push_back(nn - 1 - dp[v]);
	sort(vec[v].begin(), vec[v].end());
}

void go(int v, int par = -1) {
	vector<int> vec;
	for (int u: nei[v])
		if (u ^ par) {
			go(u, v);
			vec.push_back(type[u]);
		}

	sort(vec.begin(), vec.end());
	if (vec.empty())
		type[v] = 2;
	else if (vec.size() == 1) {
		if (vec[0] == 2) {
			type[v] = 2 * 2 + 1;
			good = v;
		}
		else
			type[v] = -1;
	}
	else if (vec.size() == 2) {
		if (vec[0] == vec[1] && vec[0] % 2 == 0)
			type[v] = vec[0] + 2;
		else if (vec[0] % 2 == 0 && vec[0] + 1 == vec[1])
			type[v] = vec[1] + 2;
		else
			type[v] = -1;
	}
	else if (vec.size() == 3) {
		if (vec[0] == vec[1] && vec[0] + 2 == vec[2] && (vec[0] % 2 == 0)) {
			type[v] = vec[2] + 2 + 1;
			good = v;
		}
		else
			type[v] = -1;
	}
	else
		type[v] = -1;
}

void check(int root) {
	go(root);
	if (type[root] != 2 * n + 1)
		return;
	ans.push_back(good);
}

void solve() {
	for (int v = 0; v < nn - 1; v++)
		if (vec[v].back() == (1 << (n - 1)) - 1)
			check(v);
		/*if (vec[v].size() == 2 && vec[v][0] + 1 == vec[v][1])
			check(v);
		else if (vec[v].size() == 3 && vec[v][0] == vec[v][1] && vec[v][2] == ((1 << (n - 1)) - 1))
			check(v);*/
}

void output() {
	sort(ans.begin(), ans.end());
	ans.resize(unique(ans.begin(), ans.end()) - ans.begin());
	cout << ans.size() << '\n';
	for (int v: ans)
		cout << ++v << ' ';
}

int main() {
	ios::sync_with_stdio(false), cin.tie(0);
	input();
	dfs();
	solve();
	output();
	return 0;
}


#include<bits/stdc++.h>

#define x first
#define y second

using namespace std;

#define NN 200010

vector<int> adj[NN];
vector<int> tmp[NN];

int dep[NN];
int deps[NN];
int sz[NN];

int dfs(int u, int fa = 0) {
	for(auto v : adj[u]) if(v != fa) {
		dfs(v, u);
		deps[u] = max(deps[u], deps[v] + 1);
	}
}

int rdfs(int u, int fa = 0) {
	for(auto v : adj[u]) if(v != fa) {
		dep[v] = dep[u] + 1;
		for(auto x : adj[u]) if(x != fa and x != v) {
			dep[v] = max(dep[v], deps[x] + 2);
		}
	}
	for(auto v : adj[u]) if(v != fa) rdfs(v, u);
}

int gt(int u, int fa = 0) {
	sz[u] = 1;
	for(auto v : adj[u]) if(v != fa) {
		gt(v, u);
		sz[u] += sz[v];
	}
	return 0;
}

int erase(int u, int v) {
	vector<int> res;
	for(auto x : adj[u]) if(x != v) res.push_back(x);

	sort(res.begin(), res.end());
	sort(adj[u].begin(), adj[u].end());

	if(adj[u] == res) {
		assert(0);
		return 0;
	}
	adj[u] = res;
	return 1;
}

int ok(int root, int fa = 0) {
	if(adj[root].size() == 0) return 1;

	int tot = 1, cnt = 0;
	vector<int> res;

	for(auto v : adj[root]) if(v != fa) {
		int x = ok(v, root);
		if(x == -1) return -1;
		cnt++; res.push_back(x);
		tot += x;
	}

	if(cnt != 2) return -1;
	if(res[0] != res[1]) return -1;
	return tot;
}

vector<int> ans;

int Solve(int root, int N) {
	for(int i=1; i<=N; i++) adj[i] = tmp[i];
	adj[N+1].clear();

	memset(dep, 0, sizeof dep);
	memset(deps, 0, sizeof deps);
	memset(sz, 0, sizeof sz);

	gt(root);

	int bad = 0;

	if(adj[root].size() == 1 || adj[root].size() == 4) {
		return 0;
	}

	if(adj[root].size() == 3) {
		bad = root;
	} else {
		int cnt = 0;
		for(int i=1; i<=N; i++) if(i != root) if(adj[i].size() == 2) {
			cnt++;
			bad = i;
		}
		for(int i=1; i<=N; i++) if(adj[i].size() == 4) {
			cnt++;
			bad = i;
		}
		if(cnt != 1) return 0;
	}

	if(bad != root and adj[bad].size() == 2) {
		adj[bad].push_back(N+1);
		adj[N+1].push_back(bad);
		if(ok(root)) {
			ans.push_back(bad);
			return 0;
		}
		return 0;
	}

	sort(adj[bad].begin(), adj[bad].end(), [&] (int u, int v) {
		return sz[u] < sz[v];
	});

	int u = adj[bad][0], v = adj[bad][1];

	erase(bad, u); erase(u, bad);
	erase(bad, v); erase(v, bad);

	adj[u].push_back(N+1); adj[v].push_back(N+1); adj[bad].push_back(N+1);
	adj[N+1].push_back(u); adj[N+1].push_back(v); adj[N+1].push_back(bad);

	if(ok(root) != -1) ans.push_back(bad);

	return 0;
}

int main(){
#ifndef ONLINE_JUDGE
	freopen("in.in", "r", stdin);
	freopen("out.out", "w", stdout);
#endif
	int n; cin >> n;

	int N = (1<<n) - 2;

	for(int i=1; i<N; i++) {
		int u, v;
		scanf("%d %d", &u, &v);
		adj[u].push_back(v);
		adj[v].push_back(u);
	}

	if(n == 2) {
		cout << 2 << endl;
		cout << 1 << ' ' << 2 << endl;
		return 0;
	}

	for(int i=1; i<=N; i++) if(adj[i].size() >= 5) {
		cout << 0 << endl;
		return 0;
	}

	int root = 2;

	dfs(1); rdfs(1);

	for(int i=1; i<=N; i++) dep[i] = max(dep[i], deps[i]);

//	for(int i=1; i<=N; i++) if(dep[root] > dep[i]) {
//		root = i;
//	}

	vector<int> pp;

//	for(int i=1; i<=N; i++) if(dep[i] == dep[root]) {
//		pp.push_back(i);
//	}
//
//	if(pp.size() >= 10) return puts("0"), 0;

	for(int i=1; i<=N; i++) if(dep[i] <= n - 1) {
		pp.push_back(i);
	}

	for(int i=1; i<=N; i++) tmp[i] = adj[i];

	for(auto x : pp) {
		Solve(x, N);
	}

	sort(ans.begin(), ans.end());
	ans.resize(unique(ans.begin(), ans.end()) - ans.begin());

	cout << ans.size() << endl;

	for(auto x : ans) {
		cout << x << endl;
	}

}


#include<bits/stdc++.h>

#define x first
#define y second

using namespace std;

#define NN 200010

vector<int> adj[NN];

int dep[NN];
int deps[NN];
int sz[NN];

int dfs(int u, int fa = 0) {
	for(auto v : adj[u]) if(v != fa) {
		dfs(v, u);
		deps[u] = max(deps[u], deps[v] + 1);
	}
}

int rdfs(int u, int fa = 0) {
	for(auto v : adj[u]) if(v != fa) {
		dep[v] = dep[u] + 1;
		for(auto x : adj[u]) if(x != fa and x != v) {
			dep[v] = max(dep[v], deps[x] + 2);
		}
	}
	for(auto v : adj[u]) if(v != fa) rdfs(v, u);
}

int gt(int u, int fa = 0) {
	sz[u] = 1;
	for(auto v : adj[u]) if(v != fa) {
		gt(v, u);
		sz[u] += sz[v];
	}
	return 0;
}

int erase(int u, int v) {
	vector<int> res;
	for(auto x : adj[u]) if(x != v) res.push_back(x);
	if(adj[u] == res) return 0;
	adj[u] = res;
	return 1;
}

int ok(int root, int fa = 0) {
	if(adj[root].size() == 0) return 1;

	int tot = 1, cnt = 0;
	vector<int> res;
	for(auto v : adj[root]) if(v != fa) {
		int x = ok(v, root);
		if(x == -1) return -1;
		cnt++; res.push_back(x);
		tot += x;
	}

	if(cnt != 2) return -1;
	if(res[0] != res[1]) return -1;
	return tot;
}

int main(){
#ifndef ONLINE_JUDGE
	freopen("in.in", "r", stdin);
	freopen("out.out", "w", stdout);
#endif
	int n; cin >> n;

	int N = (1<<n) - 2;

	for(int i=1; i<N; i++) {
		int u, v;
		scanf("%d %d", &u, &v);
		adj[u].push_back(v);
		adj[v].push_back(u);
	}

	if(n == 2) {
		cout << 2 << endl;
		cout << 1 << ' ' << 2 << endl;
		return 0;
	}

	for(int i=1; i<=N; i++) if(adj[i].size() >= 5) {
		cout << 0 << endl;
		return 0;
	}

	int root = 1;

	dfs(1); rdfs(1);

	for(int i=1; i<=N; i++) dep[i] = max(dep[i], deps[i]);

	for(int i=1; i<=N; i++) if(dep[root] > dep[i]) {
		root = i;
	}

	gt(root);

	int bad = 0;

	if(adj[root].size() == 1 || adj[root].size() == 4) {
		return puts("0"), 0;
	}

	if(adj[root].size() == 3) {
		bad = root;
	} else {
		int cnt = 0;
		for(int i=1; i<=N; i++) if(i != root) if(adj[i].size() == 2) {
			cnt++;
			bad = i;
		}
		for(int i=1; i<=N; i++) if(adj[i].size() == 4) {
			cnt++;
			bad = i;
		}
		if(cnt != 1) return puts("0"), 0;
	}

	if(bad != root and adj[bad].size() == 2) {
		adj[bad].push_back(N+1);
		adj[N+1].push_back(bad);
		if(ok(root)) {
			cout << 1 << endl;
			cout << bad << endl;
			return 0;
		}
		return puts("0"), 0;
	}

	sort(adj[bad].begin(), adj[bad].end(), [&] (int u, int v) {
		return sz[u] < sz[v];
	});

	int u = adj[bad][0], v = adj[bad][1];
	erase(bad, u); erase(u, bad);
	erase(bad, v); erase(v, bad);

	adj[u].push_back(N+1); adj[v].push_back(N+1); adj[bad].push_back(N+1);
	adj[N+1].push_back(u); adj[N+1].push_back(v); adj[N+1].push_back(bad);

	if(ok(root)) {
		cout << 1 << endl;
		cout << bad << endl;
		return 0;
	}

	return puts("0"), 0;
}