#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].begin());

	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];

	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)) 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) {
		for(int i=1; i<=N; i++) adj[i] = tmp[i];
		Solve(x, N);
	}

	sort(ans.begin(), ans.end());

	if(ans.size() == 0) {
		return puts("0"), 0;
	}

	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];
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].begin());

	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];

	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)) 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;
		for(int i=1; i<=3; i++) if(adj[i].size()) cout << i << ' ' ;
		puts("");
		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++) tmp[i] = adj[i];

	for(auto x : pp) {
		for(int i=1; i<=N; i++) adj[i] = tmp[i];
		Solve(x, N);
	}

	sort(ans.begin(), ans.end());

	if(ans.size() == 0) {
		return puts("0"), 0;
	}

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

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

}


#include<bits/stdc++.h>
#define pb push_back
#define y second
#define x first

using namespace std;
typedef long long INT;
typedef pair<int, int> pii;
template<typename T, typename U> inline void smin(T &a, const U &b) {if(a>b) a=b;}
template<typename T, typename U> inline void smax(T &a, const U &b) {if(a<b) a=b;}

#define NN 131313

vector<int> adj[NN];
int sz[NN], L[NN], R[NN], nn;

inline void dfs(int u, int fa=-1) {
	sz[u]=1;
	L[u]=++nn;
	for(int v: adj[u]) if(v!=fa) {
		dfs(v, u);
		sz[u]+=sz[v];
	}
	R[u]=nn;
}

int main() {
#ifdef kong
	freopen("in.in", "r", stdin);
	freopen("out.out", "w", stdout);
#endif

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

//	for(int i=1; i<=n; i++) cout<<sz[i]<<' '; puts("");

	if(n==2) {
		puts("2");
		puts("1 2");
		return 0;
	}

	for(int i=1; i<=N; i++) if(adj[i].size()>4) {
		puts("0");
		return 0;
	}

	vector<int> ans;
	for(int i=1; i<=N; i++) if(adj[i].size()==4) ans.pb(i);

	int num=0;
	for(int i=1; i<=N; i++) if(adj[i].size()==2) num++;
//	if(num==2) {
//		for(int i=1; i<=N; i++) if(adj[i].size()==2) ans.pb(i);
//	}

	printf("%d\n", ans.size());
	for(int x: ans) printf("%d ", x);
}


#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].begin());

	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++) tmp[i] = adj[i];
	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)) 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() >= 3) return puts("0"), 0;

	for(auto x : pp) {
		Solve(x, N);
		for(int i=1; i<=N; i++) adj[i] = tmp[i];
	}

	sort(ans.begin(), ans.end());

	if(ans.size() == 0) {
		assert(n == 3);
		return puts("0"), 0;
	}

	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];
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].begin());

	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];

	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)) 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) {
		for(int i=1; i<=N; i++) adj[i] = tmp[i];
		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];
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() == 1) 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];
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].begin());

	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++) tmp[i] = adj[i];
	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)) 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(2); rdfs(2);

	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() >= 3) return puts("0"), 0;

	for(auto x : pp) {
		Solve(x, N);
		for(int i=1; i<=N; i++) adj[i] = tmp[i];
	}

	sort(ans.begin(), ans.end());

	if(ans.size() == 0) return puts("0"), 0;

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

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

}


#include<bits/stdc++.h>
#define x first
#define y second
#define pb push_back

using namespace std;
using LL = long long;
using DO = double;
using pii = pair<int, int>;
using VI = vector<int>;

const int NN = (1<<17)+10, inf = 1e9;
VI adj[NN];
int deg[NN];
int n, m;

void check(int u, int fa=0, int deep=0) {
	if(deep>=n) {
		puts("0");
		exit(0);
	}
	int deg=0;
	for(auto v:adj[u]) if(v != fa) {
		check(v, u, deep+1);
		deg++;
	}
	if(deg>2) {
		puts("0");
		exit(0);
	}
}

int solve1() {
	int root=-1;
	int ans=-1;
	for(int i=1; i<=m; i++) if(deg[i] == 2) {
		int ok=1;
		for(auto v:adj[i]) if(deg[v] == 1) ok=0;
		if(ok) {
			if(root != -1) return puts("0"), 0;
			root=i;
		}
		else {
			if(ans != -1) return puts("0"), 0;
			ans=i;
		}
	}
	if(root == -1 || ans == -1) return puts("0"), 0;
	check(root);
	cout<<1<<endl;
	cout<<ans<<endl;
}

int mx[NN][2];

void get_mx(int u, int fa=0) {
	for(auto v:adj[u]) if(v!= fa) {
		get_mx(v, u);
		if(mx[v][0]+1>mx[u][1]) mx[u][1]=mx[v][0]+1;
		if(mx[u][0]<mx[u][1]) swap(mx[u][0], mx[u][1]);
	}
}
void rget_mx(int u, int fa=0) {
	for(auto v:adj[u]) if(v != fa) {
		if(mx[v][0] == mx[u][0]-1) {
			if(mx[v][1]<mx[u][1]+1) mx[v][1]=mx[u][1]+1;
		}else {
			if(mx[v][1]<mx[u][0]+1) mx[v][1]=mx[u][0]+1;
		}
		if(mx[v][0]<mx[v][1]) swap(mx[v][0], mx[v][1]);
		rget_mx(v, u);
	}
}

int per[NN];
int mxdp[NN], mndp[NN];

void dfs(int u, int fa=0) {
	per[u]=0;
	mxdp[u]=0;
	mndp[u]=inf;
	int deg=0;
	for(auto v:adj[u]) if(v != fa) {
		dfs(v, u);
		if(per[v] == 0) per[u]=-1;
		deg++;
		mxdp[u]=max(mxdp[u], mxdp[v]+1);
		mndp[u]=min(mndp[u], mndp[v]+1);
	}
	if(mndp[u] == inf) mndp[u]=0;

	if(deg == 0) per[u]=1;
	else if(deg == 2) {
		if(per[u] == -1) {
			per[u]=0;
			return;
		}
		if(mndp[u] != mxdp[u]) per[u]=0;
		else per[u]=1;
	}else per[u]=0;
}

int key;

void DFS(int u, int fa=0, int dp=0) {
	int deg=0, u1=-1, u2=-1, u3=-1;
	for(auto v:adj[u]) if(v != fa) {
		deg++;
		if(u1 == -1) u1=v;
		else if(u2 == -1) u2=v;
		else u3=v;
	}
	if(deg < 2) return;
	if(deg == 2) {
		if(per[u1] == 0 && per[u2] == 0) return;
		if(per[u1] && per[u2]) return;
		if(per[u1]) swap(u1, u2);
		if(mxdp[u2]+dp != n-2) return;

		DFS(u1, u, dp+1);
	}else {
		if(per[u1] == 0 || per[u2] == 0 || per[u3] == 0) return;
		if(mxdp[u1] > mxdp[u2]) swap(u1, u2);
		if(mxdp[u2] > mxdp[u3]) swap(u2, u3);
		if(mxdp[u1] > mxdp[u2]) swap(u1, u2);
		if(mxdp[u1] != mxdp[u2] || mxdp[u1]+1 != mxdp[u3] || mxdp[u3]+dp != n-2) return;
		key=u;
	}
}

int can(int root) {
	dfs(root);
	if(mxdp[root] != n-1 || mndp[root] != n-2) return 0;
	key=0;
	DFS(root);
	return key;
}

void solve(){
	get_mx(1);
	rget_mx(1);

	int root=-1, deg4=0;
	for(int i=1; i<=m; i++) if(deg[i]) {
		if(deg[i] == 2) {
			if(root != -1) {
				puts("0");
				exit(0);
			}
			root=i;
		}
		if(deg[i] == 4) deg4++;
	}
	VI res;
	if(deg4>1) {
		puts("0");
		exit(0);
	}
	if(root != -1) {
		int t=can(root);
		if(t) res.pb(t);
	}else {
		for(int i=1; i<=m; i++) if(deg[i] && mx[i][0]<=n-1) {
			int t=can(i);
			if(t) res.pb(t);
		}
	}
	sort(res.begin(), res.end());
	res.resize(unique(res.begin(), res.end())-res.begin());
	cout<<res.size()<<endl;
	for(auto r:res) cout<<r<<' ';
}

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

	cin>>n;
	m=(1<<n)-1;
	for(int i=0; i<m-2; i++) {
		int u, v;
		scanf("%d %d", &u, &v);
		adj[u].pb(v);
		adj[v].pb(u);
		deg[u]++;
		deg[v]++;
	}
	if(n == 2) {
		puts("2");
		for(int i=1; i<=3; i++) if(deg[i]) cout<<i<<' ';
		return 0;
	}

	int leaf=0;
	for(int i=1; i<=m; i++) {
		if(deg[i] == 1) leaf++;
		if(deg[i]>4) return puts("0"), 0;
	}

	if(leaf<(m+1)/2-1 || leaf>(m+1)/2) return puts("0"), 0;

	if(leaf == (m+1)/2-1) solve1();
	else solve();

	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].begin());

	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++) tmp[i] = adj[i];
	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)) 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(2); rdfs(2);

	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() >= 3) return puts("0"), 0;

	for(auto x : pp) {
		Solve(x, N);
		for(int i=1; i<=N; i++) adj[i] = tmp[i];
	}

	sort(ans.begin(), ans.end());

	if(ans.size() == 0) return puts("0"), 0;
	cout << ans.size() << endl;

	for(auto x : ans) {
		cout << x << endl;
		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].begin());

	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];

	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;
	}

	gt(root);

	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)) 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++) tmp[i] = adj[i];

	for(auto x : pp) {
		for(int i=1; i<=N; i++) adj[i] = tmp[i];
		Solve(x, N);
	}

	sort(ans.begin(), ans.end());

	if(ans.size() == 0) {
		return puts("0"), 0;
	}

	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];
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].begin());

	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)) 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) {
		for(int i=1; i<=N; i++) adj[i] = tmp[i];
		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];
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].begin());

	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)) 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);

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

	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;
}

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(2); rdfs(2);

	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;
}


#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)) 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 pb push_back
#define y second
#define x first

using namespace std;
typedef long long INT;
typedef pair<int, int> pii;
template<typename T, typename U> inline void smin(T &a, const U &b) {if(a>b) a=b;}
template<typename T, typename U> inline void smax(T &a, const U &b) {if(a<b) a=b;}

#define NN 131313

vector<int> adj[NN];

int main() {
#ifdef kong
	freopen("in.in", "r", stdin);
	freopen("out.out", "w", stdout);
#endif

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

	if(n==2) {
		puts("2");
		puts("1 2");
		return 0;
	}

	vector<int> ans;
	for(int i=1; i<=N; i++) if(adj[i].size()==4) ans.pb(i);

	printf("%d\n", ans.size());
	for(int x: ans) printf("%d ", x);
}


#include<bits/stdc++.h>
#define pb push_back
#define y second
#define x first

using namespace std;
typedef long long INT;
typedef pair<int, int> pii;
template<typename T, typename U> inline void smin(T &a, const U &b) {if(a>b) a=b;}
template<typename T, typename U> inline void smax(T &a, const U &b) {if(a<b) a=b;}

#define NN 131313

vector<int> adj[NN];

int main() {
#ifdef kong
	freopen("in.in", "r", stdin);
	freopen("out.out", "w", stdout);
#endif

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

	if(n==2) {
		puts("2");
		puts("1 2");
		return 0;
	}

	for(int i=1; i<=N; i++) if(adj[i].size()>4) {
		puts("0");
		puts("");
		return 0;
	}

	vector<int> ans;
	for(int i=1; i<=N; i++) if(adj[i].size()==4) ans.pb(i);

	int num=0;
	for(int i=1; i<=N; i++) if(adj[i].size()==2) num++;
	if(num==2) {
		for(int i=1; i<=N; i++) if(adj[i].size()==2) ans.pb(i);
	}

	printf("%d\n", ans.size());
	for(int x: ans) printf("%d ", x);
}


/*input
6
53 61
35 53
35 39
34 53
34 54
34 62
43 54
23 43
12 43
1 54
1 7
1 57
40 62
30 40
28 40
4 62
4 60
4 45
19 61
19 36
36 42
36 52
10 19
10 48
10 46
2 61
2 51
2 27
5 51
3 51
15 27
22 27
39 47
6 47
6 59
6 24
9 47
9 49
9 21
20 39
14 20
14 18
13 14
8 20
8 44
8 29
33 35
33 38
16 33
16 17
16 26
17 55
17 41
26 31
11 26
25 38
25 50
25 32
37 38
37 58
37 56
*/
#include <bits/stdc++.h>
using namespace std;
#define sp ' '
#define endl '\n'
#define fi first
#define se second
#define __builtin_popcount __builtin_popcountll
#define bit(x,y) ((x>>y)&1LL)
#define loop(i,l,r) for(int i=(l); i<=(r); i++)
#define rloop(i,l,r) for(int i=(l); i>=(r); i--)
#define mp make_pair
const int N = 150005;
template <class T1, class T2>
ostream &operator<<(ostream &os, const pair<T1, T2> &a) {
	return os << '(' << a.first << ", " << a.second << ')';
}
template <class T>
ostream &operator<<(ostream &os, const vector<T> &a) {
	os << '[';
	for (unsigned int i = 0; i < a.size(); i++)
		os << a[i] << (i < a.size() - 1 ? ", " : "");
	os << ']';
	return os;
}

int n; int D;
int m;
vector<vector<int> > a(N);
int depth[N];
int numLeaf = 0; bool delLeaf;

void pdfs(int u, int p) {
	depth[u] = 1;
	for (auto v : a[u]) {
		if (v == p) continue;
		pdfs(v, u); depth[u] = max(depth[u], depth[v] + 1);
	}
}

void dfs(int u, int p, int &del, int expect) {
	vector<int > child;
	for (auto v : a[u]) {
		if (v == p) continue;
		child.push_back(v);
	}
	// set depth u
	if (child.size() >= 4) {
		throw 1;
	}
	sort(child.begin(), child.end(), [&](int x, int y) {
		return depth[x] < depth[y];
	});
	if (child.size() == 3) {
		if (depth[child[0]] != depth[child[1]]) throw 1;
		if (depth[child[2]] != expect) throw 1;
		if (depth[child[0]] != expect - 1) throw 1;
		if (del != -1) throw 1;
		del = u;
		dfs(child[0], u, del, expect - 2); dfs(child[1], u, del, expect - 2);
		dfs(child[2], u, del, expect - 1);
	}
	else if (child.size() == 2) {
		if (depth[child[0]] != depth[child[1]]) throw 1;
		if (depth[child[0]] != expect) throw 1;
		dfs(child[0], u, del, expect - 1); dfs(child[1], u, del, expect - 1);
	}
	else if (child.size() == 1) {
		if (depth[child[0]] != expect) throw 1;
		if (del != -1) throw 1;
		del = u; delLeaf = true;
		dfs(child[0], u, del, expect - 1);
	}
	else {
		numLeaf++;
	}
}

int par[N];
int dis[N];

vector<int> canRoot;
void bfs(int root) {
	queue<int> q; q.push(root); pair<int, int> mx = mp(0, 0);
	memset(dis, 127, sizeof(dis)); dis[root] = 0;
	q.push(root);
	while (!q.empty()) {
		int u = q.front(); q.pop();
		mx = max(mx, mp(dis[u], u));
		for (auto v : a[u]) {
			if (dis[v] > dis[u] + 1) {
				dis[v] = dis[u] + 1;
				par[v] = u;
				q.push(v);
			}
		}
	}
	if (mx.fi < D - 1) return;
	loop(i, 1, D - 1) {
		mx.se = par[mx.se];
	}
	canRoot.push_back(mx.se);
}

mt19937 rd(chrono::steady_clock::now().time_since_epoch().count());
#define rand rd
signed main() {
	ios_base::sync_with_stdio(false); cin.tie(0);
	cin >> n; D = n;
	m = (1 << n) - 3;
	loop(i, 1, m) {
		int u, v; cin >> u >> v;
		a[u].push_back(v); a[v].push_back(u);
	}
	n = (1 << n) - 2;
	vector<int> leaves;

	loop(i, 1, n) if (a[i].size() == 1) leaves.push_back(i);
	shuffle(leaves.begin(), leaves.end(), rd);
	loop(i, 0, 19) {
		if (i == leaves.size()) break;
		bfs(leaves[i]);
	}
	sort(canRoot.begin(), canRoot.end()); canRoot.resize(distance(canRoot.begin(), unique(canRoot.begin(), canRoot.end())));
	vector<int> order;
	for (auto u : canRoot) {
		try {
			int del = -1;
			memset(depth, 0, sizeof(depth));
			pdfs(u, u); numLeaf = delLeaf = 0;
			dfs(u, u, del, D - 1);
			if (del != -1 && numLeaf + delLeaf == (1 << (D - 1))) {
				order.push_back(del);
			}
		}
		catch (...) {

		}
	}
	sort(order.begin(), order.end());
	order.resize(distance(order.begin(), unique(order.begin(), order.end())));
	cout << order.size() << endl;
	if (!order.empty()) {
		for (auto it : order) cout << it << sp;
		cout << endl;
	}
}


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

2
1 2

4
1 2
1 3
2 4
2 5
3 6
3 13
3 14
4 7
4 8
5 9
5 10
6 11
6 12

3
1 2
2 3
3 4
4 5
5 6

*/
#include <bits/stdc++.h>
using namespace std;
#define sp ' '
#define endl '\n'
#define fi first
#define se second
#define __builtin_popcount __builtin_popcountll
#define bit(x,y) ((x>>y)&1LL)
#define loop(i,l,r) for(int i=(l); i<=(r); i++)
#define rloop(i,l,r) for(int i=(l); i>=(r); i--)
#define mp make_pair
const int N = 150005;
template <class T1, class T2>
ostream &operator<<(ostream &os, const pair<T1, T2> &a) {
	return os << '(' << a.first << ", " << a.second << ')';
}
template <class T>
ostream &operator<<(ostream &os, const vector<T> &a) {
	os << '[';
	for (unsigned int i = 0; i < a.size(); i++)
		os << a[i] << (i < a.size() - 1 ? ", " : "");
	os << ']';
	return os;
}

int n; int D;
int m;
vector<vector<int> > a(N);
int depth[N];
int numLeaf = 0; bool delLeaf;

void pdfs(int u, int p) {
	depth[u] = 1;
	for (auto v : a[u]) {
		if (v == p) continue;
		pdfs(v, u); depth[u] = max(depth[u], depth[v] + 1);
	}
}

void dfs(int u, int p, int &del, int expect) {
	vector<int > child;
	for (auto v : a[u]) {
		if (v == p) continue;
		child.push_back(v);
	}
	// set depth u
	if (child.size() > 4) {
		throw 1;
	}
	sort(child.begin(), child.end(), [&](int x, int y) {
		return depth[x] < depth[y];
	});
	// cout << u << sp << del << sp << child << endl;
	if (child.size() == 4) {
		if (depth[child[0]] != depth[child[1]] || depth[child[2]] != depth[child[3]]) throw 1;
		if (depth[child[3]] != expect) throw 1;
		if (depth[child[0]] != expect - 1) throw 1;
		if (del != -1) throw 1;
		del = u;
		dfs(child[0], u, del, expect - 2); dfs(child[1], u, del, expect - 2);
		dfs(child[2], u, del, expect - 1); dfs(child[3], u, del, expect - 1);
	}
	else if (child.size() == 3) {
		if (depth[child[0]] != depth[child[1]]) throw 1;
		if (depth[child[2]] != expect) throw 1;
		if (depth[child[0]] != expect - 1) throw 1;
		if (del != -1) throw 1;
		del = u;
		dfs(child[0], u, del, expect - 2); dfs(child[1], u, del, expect - 2);
		dfs(child[2], u, del, expect - 1);
	}
	else if (child.size() == 2) {
		if (depth[child[0]] != depth[child[1]]) throw 1;
		if (depth[child[0]] != expect) throw 1;
		dfs(child[0], u, del, expect - 1); dfs(child[1], u, del, expect - 1);
	}
	else if (child.size() == 1) {
		if (depth[child[0]] != expect) throw 1;
		if (del != -1) throw 1;
		del = u; delLeaf = true;
		dfs(child[0], u, del, expect - 1);
	}
	else {
		numLeaf++;
	}
}

int par[N];
int dis[N];

vector<int> canRoot;
void bfs(int root) {
	queue<int> q; q.push(root); pair<int, int> mx = mp(0, 0);
	memset(dis, 127, sizeof(dis)); dis[root] = 0;
	q.push(root);
	while (!q.empty()) {
		int u = q.front(); q.pop();
		mx = max(mx, mp(dis[u], u));
		for (auto v : a[u]) {
			if (dis[v] > dis[u] + 1) {
				dis[v] = dis[u] + 1;
				par[v] = u;
				q.push(v);
			}
		}
	}
	loop(i, 1, D - 1) {
		mx.se = par[mx.se];
	}
	canRoot.push_back(mx.se);
}

mt19937 rd(chrono::steady_clock::now().time_since_epoch().count());
#define rand rd
signed main() {
	ios_base::sync_with_stdio(false); cin.tie(0);
	cin >> n; D = n;
	m = (1 << n) - 3;
	loop(i, 1, m) {
		int u, v; cin >> u >> v;
		a[u].push_back(v); a[v].push_back(u);
	}
	n = (1 << n) - 2;
	vector<int> leaves;

	loop(i, 1, n) if (a[i].size() == 1) leaves.push_back(i);
	loop(i, 0, 4) {
		bfs(leaves[rd() % leaves.size()]);
	}
	vector<int> order;
	for (auto u : canRoot) {
		try {
			int del = -1;
			memset(depth, 0, sizeof(depth));
			pdfs(u, u); numLeaf = delLeaf = 0;
			dfs(u, u, del, D - 1);
			if (del != -1 && numLeaf + delLeaf == (1 << (D - 1))) {
				order.push_back(del);
			}
		}
		catch (...) {

		}
	}
	sort(order.begin(), order.end());
	order.resize(distance(order.begin(), unique(order.begin(), order.end())));
	cout << order.size() << endl;
	if (!order.empty()) {
		for (auto it : order) cout << it << sp;
		cout << endl;
	}
}


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

2
1 2

4
1 2
1 3
2 4
2 5
3 6
3 13
3 14
4 7
4 8
5 9
5 10
6 11
6 12

*/
#include <bits/stdc++.h>
using namespace std;
#define sp ' '
#define endl '\n'
#define fi first
#define se second
#define __builtin_popcount __builtin_popcountll
#define bit(x,y) ((x>>y)&1LL)
#define loop(i,l,r) for(int i=(l); i<=(r); i++)
#define rloop(i,l,r) for(int i=(l); i>=(r); i--)
#define mp make_pair
const int N = 150005;
template <class T1, class T2>
ostream &operator<<(ostream &os, const pair<T1, T2> &a) {
	return os << '(' << a.first << ", " << a.second << ')';
}
template <class T>
ostream &operator<<(ostream &os, const vector<T> &a) {
	os << '[';
	for (unsigned int i = 0; i < a.size(); i++)
		os << a[i] << (i < a.size() - 1 ? ", " : "");
	os << ']';
	return os;
}

int n; int D;
int m;
vector<vector<int> > a(N);
int depth[N];

void pdfs(int u, int p) {
	depth[u] = 1;
	for (auto v : a[u]) {
		if (v == p) continue;
		pdfs(v, u); depth[u] = max(depth[u], depth[v] + 1);
	}
}

void dfs(int u, int p, int &del, int expect) {
	vector<int > child;
	for (auto v : a[u]) {
		if (v == p) continue;
		child.push_back(v);
	}
	// set depth u
	if (child.size() > 4) {
		throw 1;
	}
	sort(child.begin(), child.end(), [&](int x, int y) {
		return depth[x] < depth[y];
	});
	// cout << u << sp << del << sp << child << endl;
	if (child.size() == 4) {
		if (depth[child[0]] != depth[child[1]] || depth[child[2]] != depth[child[3]]) throw 1;
		if (depth[child[3]] != expect) throw 1;
		if (depth[child[0]] != expect - 1) throw 1;
		if (del != -1) throw 1;
		del = u;
		dfs(child[0], u, del, expect - 2); dfs(child[1], u, del, expect - 2);
		dfs(child[2], u, del, expect - 1); dfs(child[3], u, del, expect - 1);
	}
	else if (child.size() == 3) {
		if (depth[child[0]] != depth[child[1]]) throw 1;
		if (depth[child[2]] != expect) throw 1;
		if (depth[child[0]] != expect - 1) throw 1;
		if (del != -1) throw 1;
		del = u;
		dfs(child[0], u, del, expect - 2); dfs(child[1], u, del, expect - 2);
		dfs(child[2], u, del, expect - 1);
	}
	else if (child.size() == 2) {
		if (depth[child[0]] != depth[child[1]]) throw 1;
		if (depth[child[0]] != expect) throw 1;
		dfs(child[0], u, del, expect - 1); dfs(child[1], u, del, expect - 1);
	}
	else if (child.size() == 1) {
		if (depth[child[0]] != expect) throw 1;
		if (del != -1) throw 1;
		del = u;
		dfs(child[0], u, del, expect - 1);
	}
	else {

	}
}

signed main() {
	ios_base::sync_with_stdio(false); cin.tie(0);
	cin >> n; D = n;
	m = (1 << n) - 3;
	loop(i, 1, m) {
		int u, v; cin >> u >> v;
		a[u].push_back(v); a[v].push_back(u);
	}
	int canRootCon = 2;
	if (n == 2) {
		canRootCon = 1;
	}
	n = (1 << n) - 2;
	vector<int> canRoot;
	loop(i, 1, n) {
		if (a[i].size() == canRootCon) {
			canRoot.push_back(i);
		}
	}
	vector<int> order;
	for (auto u : canRoot) {
		try {
			int del = -1;
			memset(depth, 0, sizeof(depth));
			pdfs(u, u);
			dfs(u, u, del, D - 1);
			if (del != -1) {
				order.push_back(del);
			}
		}
		catch (...) {

		}
	}
	sort(order.begin(), order.end());
	order.resize(distance(order.begin(), unique(order.begin(), order.end())));
	cout << order.size() << endl;
	if (!order.empty()) {
		for (auto it : order) cout << it << sp;
		cout << endl;
	}
}


/*input
6
53 61
35 53
35 39
34 53
34 54
34 62
43 54
23 43
12 43
1 54
1 7
1 57
40 62
30 40
28 40
4 62
4 60
4 45
19 61
19 36
36 42
36 52
10 19
10 48
10 46
2 61
2 51
2 27
5 51
3 51
15 27
22 27
39 47
6 47
6 59
6 24
9 47
9 49
9 21
20 39
14 20
14 18
13 14
8 20
8 44
8 29
33 35
33 38
16 33
16 17
16 26
17 55
17 41
26 31
11 26
25 38
25 50
25 32
37 38
37 58
37 56
*/
#include <bits/stdc++.h>
using namespace std;
#define sp ' '
#define endl '\n'
#define fi first
#define se second
#define __builtin_popcount __builtin_popcountll
#define bit(x,y) ((x>>y)&1LL)
#define loop(i,l,r) for(int i=(l); i<=(r); i++)
#define rloop(i,l,r) for(int i=(l); i>=(r); i--)
#define mp make_pair
const int N = 150005;
template <class T1, class T2>
ostream &operator<<(ostream &os, const pair<T1, T2> &a) {
	return os << '(' << a.first << ", " << a.second << ')';
}
template <class T>
ostream &operator<<(ostream &os, const vector<T> &a) {
	os << '[';
	for (unsigned int i = 0; i < a.size(); i++)
		os << a[i] << (i < a.size() - 1 ? ", " : "");
	os << ']';
	return os;
}

int n; int D;
int m;
vector<vector<int> > a(N);
int depth[N];
int numLeaf = 0; bool delLeaf;

void pdfs(int u, int p) {
	depth[u] = 1;
	for (auto v : a[u]) {
		if (v == p) continue;
		pdfs(v, u); depth[u] = max(depth[u], depth[v] + 1);
	}
}

void dfs(int u, int p, int &del, int expect) {
	vector<int > child;
	for (auto v : a[u]) {
		if (v == p) continue;
		child.push_back(v);
	}
	// set depth u
	if (child.size() >= 4) {
		throw 1;
	}
	sort(child.begin(), child.end(), [&](int x, int y) {
		return depth[x] < depth[y];
	});
	if (child.size() == 3) {
		if (depth[child[0]] != depth[child[1]]) throw 1;
		if (depth[child[2]] != expect) throw 1;
		if (depth[child[0]] != expect - 1) throw 1;
		if (del != -1) throw 1;
		del = u;
		dfs(child[0], u, del, expect - 2); dfs(child[1], u, del, expect - 2);
		dfs(child[2], u, del, expect - 1);
	}
	else if (child.size() == 2) {
		if (depth[child[0]] != depth[child[1]]) throw 1;
		if (depth[child[0]] != expect) throw 1;
		dfs(child[0], u, del, expect - 1); dfs(child[1], u, del, expect - 1);
	}
	else if (child.size() == 1) {
		if (depth[child[0]] != expect) throw 1;
		if (del != -1) throw 1;
		del = u; delLeaf = true;
		dfs(child[0], u, del, expect - 1);
	}
	else {
		numLeaf++;
	}
}

int par[N];
int dis[N];

vector<int> canRoot;
void bfs(int root) {
	queue<int> q; q.push(root); pair<int, int> mx = mp(0, 0);
	memset(dis, 127, sizeof(dis)); dis[root] = 0;
	q.push(root);
	while (!q.empty()) {
		int u = q.front(); q.pop();
		mx = max(mx, mp(dis[u], u));
		for (auto v : a[u]) {
			if (dis[v] > dis[u] + 1) {
				dis[v] = dis[u] + 1;
				par[v] = u;
				q.push(v);
			}
		}
	}
	loop(i, 1, D - 1) {
		mx.se = par[mx.se];
	}
	canRoot.push_back(mx.se);
}

mt19937 rd(chrono::steady_clock::now().time_since_epoch().count());
#define rand rd
signed main() {
	ios_base::sync_with_stdio(false); cin.tie(0);
	cin >> n; D = n;
	m = (1 << n) - 3;
	loop(i, 1, m) {
		int u, v; cin >> u >> v;
		a[u].push_back(v); a[v].push_back(u);
	}
	n = (1 << n) - 2;
	vector<int> leaves;

	loop(i, 1, n) if (a[i].size() == 1) leaves.push_back(i);
	loop(i, 0, 3) {
		if (i == leaves.size()) break;
		bfs(leaves[i]);
	}
	vector<int> order;
	for (auto u : canRoot) {
		try {
			int del = -1;
			memset(depth, 0, sizeof(depth));
			pdfs(u, u); numLeaf = delLeaf = 0;
			dfs(u, u, del, D - 1);
			if (del != -1 && numLeaf + delLeaf == (1 << (D - 1))) {
				order.push_back(del);
			}
		}
		catch (...) {

		}
	}
	sort(order.begin(), order.end());
	order.resize(distance(order.begin(), unique(order.begin(), order.end())));
	cout << order.size() << endl;
	if (!order.empty()) {
		for (auto it : order) cout << it << sp;
		cout << endl;
	}
}


/*input
6
53 61
35 53
35 39
34 53
34 54
34 62
43 54
23 43
12 43
1 54
1 7
1 57
40 62
30 40
28 40
4 62
4 60
4 45
19 61
19 36
36 42
36 52
10 19
10 48
10 46
2 61
2 51
2 27
5 51
3 51
15 27
22 27
39 47
6 47
6 59
6 24
9 47
9 49
9 21
20 39
14 20
14 18
13 14
8 20
8 44
8 29
33 35
33 38
16 33
16 17
16 26
17 55
17 41
26 31
11 26
25 38
25 50
25 32
37 38
37 58
37 56
*/
#include <bits/stdc++.h>
using namespace std;
#define sp ' '
#define endl '\n'
#define fi first
#define se second
#define __builtin_popcount __builtin_popcountll
#define bit(x,y) ((x>>y)&1LL)
#define loop(i,l,r) for(int i=(l); i<=(r); i++)
#define rloop(i,l,r) for(int i=(l); i>=(r); i--)
#define mp make_pair
const int N = 150005;
template <class T1, class T2>
ostream &operator<<(ostream &os, const pair<T1, T2> &a) {
	return os << '(' << a.first << ", " << a.second << ')';
}
template <class T>
ostream &operator<<(ostream &os, const vector<T> &a) {
	os << '[';
	for (unsigned int i = 0; i < a.size(); i++)
		os << a[i] << (i < a.size() - 1 ? ", " : "");
	os << ']';
	return os;
}

int n; int D;
int m;
vector<vector<int> > a(N);
int depth[N];
int numLeaf = 0; bool delLeaf;

void pdfs(int u, int p) {
	depth[u] = 1;
	for (auto v : a[u]) {
		if (v == p) continue;
		pdfs(v, u); depth[u] = max(depth[u], depth[v] + 1);
	}
}

void dfs(int u, int p, int &del, int expect) {
	vector<int > child;
	for (auto v : a[u]) {
		if (v == p) continue;
		child.push_back(v);
	}
	// set depth u
	if (child.size() >= 4) {
		throw 1;
	}
	sort(child.begin(), child.end(), [&](int x, int y) {
		return depth[x] < depth[y];
	});
	if (child.size() == 3) {
		if (depth[child[0]] != depth[child[1]]) throw 1;
		if (depth[child[2]] != expect) throw 1;
		if (depth[child[0]] != expect - 1) throw 1;
		if (del != -1) throw 1;
		del = u;
		dfs(child[0], u, del, expect - 2); dfs(child[1], u, del, expect - 2);
		dfs(child[2], u, del, expect - 1);
	}
	else if (child.size() == 2) {
		if (depth[child[0]] != depth[child[1]]) throw 1;
		if (depth[child[0]] != expect) throw 1;
		dfs(child[0], u, del, expect - 1); dfs(child[1], u, del, expect - 1);
	}
	else if (child.size() == 1) {
		if (depth[child[0]] != expect) throw 1;
		if (del != -1) throw 1;
		del = u; delLeaf = true;
		dfs(child[0], u, del, expect - 1);
	}
	else {
		numLeaf++;
	}
}

int par[N];
int dis[N];

vector<int> canRoot;
void bfs(int root) {
	queue<int> q; q.push(root); pair<int, int> mx = mp(0, 0);
	memset(dis, 127, sizeof(dis)); dis[root] = 0;
	q.push(root);
	while (!q.empty()) {
		int u = q.front(); q.pop();
		mx = max(mx, mp(dis[u], u));
		for (auto v : a[u]) {
			if (dis[v] > dis[u] + 1) {
				dis[v] = dis[u] + 1;
				par[v] = u;
				q.push(v);
			}
		}
	}
	loop(i, 1, D - 1) {
		mx.se = par[mx.se];
	}
	canRoot.push_back(mx.se);
}

mt19937 rd(chrono::steady_clock::now().time_since_epoch().count());
#define rand rd
signed main() {
	ios_base::sync_with_stdio(false); cin.tie(0);
	cin >> n; D = n;
	m = (1 << n) - 3;
	loop(i, 1, m) {
		int u, v; cin >> u >> v;
		a[u].push_back(v); a[v].push_back(u);
	}
	n = (1 << n) - 2;
	vector<int> leaves;

	loop(i, 1, n) if (a[i].size() == 1) leaves.push_back(i);
	shuffle(leaves.begin(), leaves.end(), rd);
	loop(i, 0, 4) {
		if (i == leaves.size()) break;
		bfs(leaves[i]);
	}
	vector<int> order;
	for (auto u : canRoot) {
		try {
			int del = -1;
			memset(depth, 0, sizeof(depth));
			pdfs(u, u); numLeaf = delLeaf = 0;
			dfs(u, u, del, D - 1);
			if (del != -1 && numLeaf + delLeaf == (1 << (D - 1))) {
				order.push_back(del);
			}
		}
		catch (...) {

		}
	}
	sort(order.begin(), order.end());
	order.resize(distance(order.begin(), unique(order.begin(), order.end())));
	cout << order.size() << endl;
	if (!order.empty()) {
		for (auto it : order) cout << it << sp;
		cout << endl;
	}
}


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

2
1 2

4
1 2
1 3
2 4
2 5
3 6
3 13
3 14
4 7
4 8
5 9
5 10
6 11
6 12

3
1 2
2 3
3 4
4 5
5 6

*/
#include <bits/stdc++.h>
using namespace std;
#define sp ' '
#define endl '\n'
#define fi first
#define se second
#define __builtin_popcount __builtin_popcountll
#define bit(x,y) ((x>>y)&1LL)
#define loop(i,l,r) for(int i=(l); i<=(r); i++)
#define rloop(i,l,r) for(int i=(l); i>=(r); i--)
#define mp make_pair
const int N = 150005;
template <class T1, class T2>
ostream &operator<<(ostream &os, const pair<T1, T2> &a) {
	return os << '(' << a.first << ", " << a.second << ')';
}
template <class T>
ostream &operator<<(ostream &os, const vector<T> &a) {
	os << '[';
	for (unsigned int i = 0; i < a.size(); i++)
		os << a[i] << (i < a.size() - 1 ? ", " : "");
	os << ']';
	return os;
}

int n; int D;
int m;
vector<vector<int> > a(N);
int depth[N];
int numLeaf = 0; bool delLeaf;

void pdfs(int u, int p) {
	depth[u] = 1;
	for (auto v : a[u]) {
		if (v == p) continue;
		pdfs(v, u); depth[u] = max(depth[u], depth[v] + 1);
	}
}

void dfs(int u, int p, int &del, int expect) {
	vector<int > child;
	for (auto v : a[u]) {
		if (v == p) continue;
		child.push_back(v);
	}
	// set depth u
	if (child.size() >= 4) {
		throw 1;
	}
	sort(child.begin(), child.end(), [&](int x, int y) {
		return depth[x] < depth[y];
	});
	if (child.size() == 3) {
		if (depth[child[0]] != depth[child[1]]) throw 1;
		if (depth[child[2]] != expect) throw 1;
		if (depth[child[0]] != expect - 1) throw 1;
		if (del != -1) throw 1;
		del = u;
		dfs(child[0], u, del, expect - 2); dfs(child[1], u, del, expect - 2);
		dfs(child[2], u, del, expect - 1);
	}
	else if (child.size() == 2) {
		if (depth[child[0]] != depth[child[1]]) throw 1;
		if (depth[child[0]] != expect) throw 1;
		dfs(child[0], u, del, expect - 1); dfs(child[1], u, del, expect - 1);
	}
	else if (child.size() == 1) {
		if (depth[child[0]] != expect) throw 1;
		if (del != -1) throw 1;
		del = u; delLeaf = true;
		dfs(child[0], u, del, expect - 1);
	}
	else {
		numLeaf++;
	}
}

int par[N];
int dis[N];

vector<int> canRoot;
void bfs(int root) {
	queue<int> q; q.push(root); pair<int, int> mx = mp(0, 0);
	memset(dis, 127, sizeof(dis)); dis[root] = 0;
	q.push(root);
	while (!q.empty()) {
		int u = q.front(); q.pop();
		mx = max(mx, mp(dis[u], u));
		for (auto v : a[u]) {
			if (dis[v] > dis[u] + 1) {
				dis[v] = dis[u] + 1;
				par[v] = u;
				q.push(v);
			}
		}
	}
	loop(i, 1, D - 1) {
		mx.se = par[mx.se];
	}
	canRoot.push_back(mx.se);
}

mt19937 rd(chrono::steady_clock::now().time_since_epoch().count());
#define rand rd
signed main() {
	ios_base::sync_with_stdio(false); cin.tie(0);
	cin >> n; D = n;
	m = (1 << n) - 3;
	loop(i, 1, m) {
		int u, v; cin >> u >> v;
		a[u].push_back(v); a[v].push_back(u);
	}
	n = (1 << n) - 2;
	vector<int> leaves;

	loop(i, 1, n) if (a[i].size() == 1) leaves.push_back(i);
	loop(i, 0, 4) {
		bfs(leaves[rd() % leaves.size()]);
	}
	vector<int> order;
	for (auto u : canRoot) {
		try {
			int del = -1;
			memset(depth, 0, sizeof(depth));
			pdfs(u, u); numLeaf = delLeaf = 0;
			dfs(u, u, del, D - 1);
			if (del != -1 && numLeaf + delLeaf == (1 << (D - 1))) {
				order.push_back(del);
			}
		}
		catch (...) {

		}
	}
	sort(order.begin(), order.end());
	order.resize(distance(order.begin(), unique(order.begin(), order.end())));
	cout << order.size() << endl;
	if (!order.empty()) {
		for (auto it : order) cout << it << sp;
		cout << endl;
	}
}


#pragma GCC optimize("Ofast,unroll-loops,no-stack-protector")
#include<bits/stdc++.h>
#define int int_fast64_t
using namespace std;
typedef pair<int,int> pii;
#define REP(i,j,k) for(int i=(j);i<(k);++i)
#define RREP(i,j,k) for(int i=int(j)-1;i>=(k);--i)
#define tr(it,a) for(auto it:a)
#define ALL(a) a.begin(),a.end()
#define umin(x,y) (x=min(x,(y)))
#define umax(x,y) (x=max(x,(y)))
#define pb push_back
#define f first
#define s second
#define endl '\n'
// #define __debug
#ifdef __debug
	#define IOS (void)0
	#define pr(...) cerr<<__VA_ARGS__
	#define ar(a,s,t) {REP(zy,s,t)pr(a[zy]<<' ');pr(endl);}
#else
	#define IOS cin.tie(0),cout.tie(0),ios_base::sync_with_stdio(false)
	#define pr(...) (void)0
	#define ar(...) (void)0
#endif
//
const int maxn=15e4+9;
int k,n,cnt,anc,res=0,sz[maxn];
vector<int>cand,g[maxn];

int find(int u,int f){
	int re=1,mx=0;
	REP(i,0,g[u].size()){
		int v=g[u][i];
		if(v==f)continue;
		int tt=find(v,u);
		umax(mx,tt);
		re+=tt;
	}
	umax(mx,n-re);
	if(mx<=n/2)cand.pb(u);
	return re;
}

void check(int u,int f){
	sz[u]=1;
	vector<int>vt;
	REP(i,0,g[u].size()){
		int v=g[u][i];
		if(v==f)continue;
		check(v,u);
		sz[u]+=sz[v];
		vt.pb(sz[v]);
	}
	sort(ALL(vt));
	if(vt.size()==1&&vt[0]==1||vt.size()==3&&vt[0]==vt[1]&&vt[2]==2*vt[0]+1)anc=u,++cnt,++sz[u];
	else if(vt.size()==0||vt.size()==2&&vt[0]==vt[1]);
	else cnt=2;
}

main(){
	IOS;
	cin>>k,n=(1<<k)-2;
	REP(i,1,n){
		int a,b;cin>>a>>b,--a,--b;
		g[a].pb(b),g[b].pb(a);
	}
	find(0,-1);
	if(cand.size()>2)return cout<<0<<endl,0;
	vector<int>vt;
	REP(i,0,cand.size()){
		cnt=0;
		check(cand[i],-1);
		if(cnt==1)vt.pb(anc),++res;
	}
	cout<<res<<endl;
	sort(ALL(vt));
	REP(i,0,vt.size())cout<<vt[i]+1<<" ";
}


import sys

def max_square(number_of_sticks, sticks):
    if number_of_sticks < 4:
        return 0
    else:
        sticks.sort()
        sticks.reverse()
        max_sq = 0
        max_stick = 0
        i = 1
        while i < len(sticks):
            if sticks[i - 1] - sticks[i] <= 1:
                if max_stick == 0:
                    max_stick = sticks[i]
                    i += 1
                else:
                    max_sq += max_stick * sticks[i]
                    max_stick = 0
                    i += 1
            i += 1
        return max_sq

if __name__ == "__main__":
    first_line = int(sys.stdin.readline())
    second_line = [int(i) for i in sys.stdin.readline().split()]
    sys.stdout.write(str(max_square(first_line, second_line)))


ans = 0
n = 0
n = int(input(""))
l = input("")
st = []
for x in l.split(" "):
    st.append(int(x))
st.sort()
i = n-1
while i>=3:
    if st[i]>st[i-1]+1:
        i = i -1
        continue
    l = st[i-1]
    i = i -2
    while i>0 and st[i]>st[i-1]+1:
        i=i-1
    if i == 0:
        break
    b = st [i-1]
    ans = ans + l*b
    i = i - 2
print(ans)


x,y=0,0
n=int(input())
n-=1
l=list(map(int,input().split()))
l.sort()
while(n>0):
    # print(l[n])
    if l[n]-l[n-1]<=1:
        if not x:
            x=l[n]-l[n]+l[n-1]
            n-=1
        else:
            y=l[n]-l[n]+l[n-1]
            break
    n-=1
print(x*y)


x,y=0,0
n=int(input())
n-=1
l=list(map(int,input().split()))
l.sort()
t=0
while(n>0):
    # print(l[n])
    if l[n]-l[n-1]<=1:
        if not x:
            x=l[n]-l[n]+l[n-1]
            n-=1
        else:
            y=l[n]-l[n]+l[n-1]
            t+=x*y
            x,y=0,0
            n-=1
    n-=1
print(t)


x,y=0,0
n=int(input())
n-=1
l=list(map(int,input().split()))
l.sort()
t=0
while(n>0):
    # print(l[n])
    if l[n]-l[n-1]<=1:
        if not x:
            x=l[n]-l[n]+l[n-1]
            n-=1
        else:
            y=l[n]-l[n]+l[n-1]
            t+=x*y
            x,y=0,0
    n-=1
print(t)


n = int(input())

lst = []
lst.extend(map(int, input().split()))

tarea = 0

lst.sort()
lst = lst[::-1]
lst.append(0)

i = 0
mark = 0
ar = []
while i != n:
    if (lst[i] - lst[i+1])<=1:
        ar.append(lst[i+1])
        mark += 1
        i += 2
    else:
        i += 1
    if mark == 2:
        tarea = tarea + ar[0]*ar[1]
        ar = []
        mark = 0

print(tarea)


n = int(input())

lst = []
lst.extend(map(int, input().split()))

tarea = 0

lst.sort()
lst = lst[::-1]
lst.append(0)

i = 0
mark = 0
ar = []
while i != n:
    if (lst[i] - lst[i+1])<=1:
        ar.append(lst[i+1])
        mark += 1
        i += 2
    else:
        i += 1
    if mark == 2:
        tarea = tarea + ar[0]*ar[1]
        ar = []

print(tarea)


n = int(input())

lst = []
lst.extend(map(int, input().split()))

tarea = 0

lst.sort()
lst = lst[::-1]
lst.append(0)

i = 0
mark = 0
ar = []
while i != n:
    if (lst[i] - lst[i+1])<=1:
        ar.append(lst[i+1])
        mark += 1
        i += 2
    else:
        i += 1
    if mark == 2:
        tarea = tarea + ar[0]*ar[1]

print(tarea)


from sys import stdin, stdout

def rectangular(n, array):
    sum = 0
    crutch = 0
    if n < 4:
        return 0
    array.sort()
    for i in range(n - 1, -1, -1):
        if array[i] - array[i - 1] <= 1:
            if crutch == 0:
                crutch = array[i - 1]
                i -= 1
            else:
                sum += crutch * array[i - 1]
                crutch = 0
                i -= 1

    return sum

if __name__ == "__main__":
    n = int(stdin.readline())
    array = [int(i) for i in stdin.readline().split()]
    print(rectangular(n, array))


from sys import stdin, stdout

def rectangular(n, array):
    sum = 0
    crutch = 0
    if n < 4:
        return 0
    array.sort()
    for i in range(n - 1, -1, -1):
        if array[i] - array[i - 1] <= 1:
            if crutch == 0:
                crutch = array[i - 1]
                i -= 1
            else:
                sum += crutch * array[i - 1]
                crutch = 0
                i -= 1
    return sum

if __name__ == "__main__":
    n = int(stdin.readline())
    array = [int(i) for i in stdin.readline().split()]
    print(rectangular(n, array))


from sys import stdin, stdout

def rectangular(n, array):
    sum = 0
    crutch = 0
    if n < 4:
        return 0
    array.sort()
    for i in range(n - 1, -1, -1):
        if array[i] - array[i - 1] <= 1:
            if crutch == 0:
                crutch = array[i - 1]
                continue
            else:
                sum += crutch * array[i - 1]
                crutch = 0
                continue

    return sum

if __name__ == "__main__":
    n = int(stdin.readline())
    array = [int(i) for i in stdin.readline().split()]
    print(rectangular(n, array))


from sys import stdin, stdout

def rectangular(n, array):
    sum = 0
    crutch = 0
    another_crutch = 0
    if n < 4:
        return 0
    array.sort()
    for i in range(n - 1, -1, -1):
        if array[i] - array[i - 1] <= 1:
            if crutch == 0:
                crutch = array[i - 1]
                another_crutch = 1
            else:
                sum += crutch * array[i - 1]
                crutch = 0
                another_crutch = 1
        if another_crutch != 0:
            another_crutch = 0
            continue
    return sum

if __name__ == "__main__":
    n = int(stdin.readline())
    array = [int(i) for i in stdin.readline().split()]
    print(rectangular(n, array))


ffrom sys import stdin, stdout

def rectangular(n, array):
    i = 0
    sum = 0
    if n < 4:
        return 0
    array.sort()
    array.reverse()
    while i <= n - 4:
        if array[i] - array[i + 1] <= 1:
            if array[i + 2] - array[i + 3] <= 1:
                sum += array[i + 1] * array[i + 3]
                i += 3

        i += 1
    return sum

if __name__ == "__main__":
    n = int(stdin.readline())
    array = [int(i) for i in stdin.readline().split()]
    print(rectangular(n, array))


ffrom sys import stdin, stdout

def rectangular(n, array):
    i = 0
    sum = 0
    crutch = 0
    if n < 4:
        return 0
    array.sort()
    array.reverse()
    while i <= n - 4:
        if array[i] - array[i + 1] <= 1:
            if crutch == 0:
                crutch = array[i + 1]
                i += 1
            else:
                sum += crutch * array[i + 1]
                crutch = 0
                i += 1

        i += 1
    return sum

if __name__ == "__main__":
    n = int(stdin.readline())
    array = [int(i) for i in stdin.readline().split()]
    print(rectangular(n, array))


from sys import stdin, stdout

def rectangular(n, array):
    sum = 0
    crutch = 0
    if n < 4:
        return 0
    array.sort()
    for i in range(0, n, -1):
        if array[i] - array[i - 1] <= 1:
            if crutch == 0:
                crutch = array[i]
                continue
            else:
                sum += crutch * array[i]
                crutch = 0
                continue

    return sum

if __name__ == "__main__":
    n = int(stdin.readline())
    array = [int(i) for i in stdin.readline().split()]
    print(rectangular(n, array))


from sys import stdin, stdout

def rectangular(n, array):
    sum = 0
    crutch = 0
    another_crutch = 0
    if n < 4:
        return 0
    array.sort()
    for i in range(n - 1, -1, -1):
        if another_crutch != 0:
            another_crutch = 0
            continue
        if array[i] - array[i - 1] <= 1:
            if crutch == 0:
                crutch = array[i - 1]
                another_crutch = 1
            else:
                sum += crutch * array[i - 1]
                crutch = 0
                another_crutch = 1
    return sum

if __name__ == "__main__":
    n = int(stdin.readline())
    array = [int(i) for i in stdin.readline().split()]
    print(rectangular(n, array))


from sys import stdin, stdout

def rectangular(n, array):
    i = 0
    sum = 0
    if n < 4:
        return 0
    array.sort()
    array.reverse()
    while i <= n - 4:
        if array[i] - array[i + 1] <= 1:
            if array[i + 2] - array[i + 3] <= 1:
                sum += (min(array[i], array[i + 1]) * min(array[i + 2], array[i + 3]))

        i += 4
    return sum

if __name__ == "__main__":
    n = int(stdin.readline())
    array = [int(i) for i in stdin.readline().split()]
    print(rectangular(n, array))


from sys import stdin, stdout

def rectangular(n, array):
    i = 0
    sum = 0
    if n < 4:
        return 0
    array.sort()
    array.reverse()
    while i <= n - 4:
        if array[i] - array[i + 1] <= 1:
            if array[i + 2] - array[i + 3] <= 1:
                sum += array[i + 1] * array[i + 3]
                i += 3

        i += 1
    return sum

if __name__ == "__main__":
    n = int(stdin.readline())
    array = [int(i) for i in stdin.readline().split()]
    print(rectangular(n, array))


from sys import stdin

if __name__ == "__main__":
    number_of_sticks = int(stdin.readline().rstrip('\n'))
    second_line = stdin.readline().rstrip('\n')
    sticks = [int(x) for x in second_line.split(' ')]

def execute(number_of_sticks, sticks):
    max = 0
    if number_of_sticks < 4:
        return max
    else:
        sticks.sort()
        sticks.reverse()
        current_max = 0
        i = 1
        while i < len(sticks):
            if sticks[i - 1] - sticks[i] <= 1:
                if current_max == 0:
                    current_max = sticks[i]
                    i += 1
                else:
                    max += current_max * sticks[i]
                    current_max = 0
                    i += 1
            i += 1
        return max

if __name__ == "__main__":
    print(execute(number_of_sticks, sticks))


from sys import stdin, stdout

def rectangular(n, array):
    i = 0
    sum = 0
    if n < 4:
        return 0
    array.sort()
    array.reverse()
    while i <= n - 4:
        if array[i] - array[i + 1] <= 1:
            if array[i + 2] - array[i + 3] <= 1:
                sum += (min(array[i], array[i + 1]) * min(array[i + 2], array[i + 3]))
                i += 3

        i += 1
    return sum

if __name__ == "__main__":
    n = int(stdin.readline())
    array = [int(i) for i in stdin.readline().split()]
    print(rectangular(n, array))


from sys import stdin, stdout

def rectangular(n, array):
    sum = 0
    crutch = 0
    if n < 4:
        return 0
    array.sort()
    for i in range(n - 1, -1, -2):
        if array[i] - array[i - 1] <= 1:
            if crutch == 0:
                crutch = array[i - 1]
            else:
                sum += crutch * array[i - 1]
                crutch = 0
    return sum

if __name__ == "__main__":
    n = int(stdin.readline())
    array = [int(i) for i in stdin.readline().split()]
    print(rectangular(n, array))


from sys import stdin, stdout

def rectangular(n, array):
    i = 1
    sum = 0
    crutch = 0
    if n < 4:
        return 0
    array.sort()
    array.reverse()
    while i <= n:
        if array[i-1] - array[i] <= 1:
            if crutch == 0:
                crutch = array[i]
                i += 1
            else:
                sum += crutch * array[i]
                crutch = 0
                i += 1

        i += 1
    return sum

if __name__ == "__main__":
    n = int(stdin.readline())
    array = [int(i) for i in stdin.readline().split()]
    print(rectangular(n, array))


ffrom sys import stdin, stdout

def rectangular(n, array):
    i = 1
    sum = 0
    crutch = 0
    if n < 4:
        return 0
    array.sort()
    array.reverse()
    while i < n:
        if array[i-1] - array[i] <= 1:
            if crutch == 0:
                crutch = array[i]
                i += 1
            else:
                sum += crutch * array[i]
                crutch = 0
                i += 1

        i += 1
    return sum

if __name__ == "__main__":
    n = int(stdin.readline())
    array = [int(i) for i in stdin.readline().split()]
    print(rectangular(n, array))


from sys import stdin, stdout

def rectangular(n, array):
    i = 1
    sum = 0
    crutch = 0
    if n < 4:
        return 0
    array.sort()
    array.reverse()
    while i < n:
        if array[i-1] - array[i] <= 1:
            if crutch == 0:
                crutch = array[i]
                i += 1
            else:
                sum += crutch * array[i]
                crutch = 0
                i += 1

        i += 1
    return sum

if __name__ == "__main__":
    n = int(stdin.readline())
    array = [int(i) for i in stdin.readline().split()]
    print(rectangular(n, array))


from sys import stdin, stdout

def rectangular(n, array):
    i = 1
    sum = 0
    crutch = 0
    if n < 4:
        return 0
    array.sort()
    array.reverse()
    while i <= n:
        if array[i-1] - array[i] <= 1:
            if crutch == 0:
                crutch = array[i]
                i += 1
            else:
                sum += crutch * array[i]
                crutch = 0
                i += 1

        i += 1
    return sum


from sys import stdin, stdout

def rectangular(n, array):
    i = 0
    sum = 0
    crutch = 0
    if n < 4:
        return 0
    array.sort()
    array.reverse()
    while i <= n - 4:
        if array[i] - array[i + 1] <= 1:
            if crutch == 0:
                crutch = array[i + 1]
                i += 1
            else:
                sum += crutch * array[i + 1]
                crutch = 0

        i += 1
    return sum

if __name__ == "__main__":
    n = int(stdin.readline())
    array = [int(i) for i in stdin.readline().split()]
    print(rectangular(n, array))


from sys import stdin, stdout

def rectangular(n, array):
    i = 0
    sum = 0
    if n < 4:
        return 0
    array.sort()
    array.reverse()
    while i <= n - 4:
        if array[i + 1] - array[i] <= 1:
            if array[i + 3] - array[i + 2] <= 1:
                sum += (min(array[i], array[i + 1]) * min(array[i + 2], array[i + 3]))

        i += 4
    return sum

if __name__ == "__main__":
    n = int(stdin.readline())
    array = [int(i) for i in stdin.readline().split()]
    print(rectangular(n, array))


from sys import stdin, stdout

def rectangular(n, array):
    sum = 0
    i = n - 2
    crutch = 0
    if n < 4:
        return 0
    array.sort()
    while i > -1:
        if array[i + 1] - array[i] <= 1:
            if crutch == 0:
                crutch = array[i]
                i -=1
            else:
                sum += crutch * array[i]
                crutch = 0
                i -=1
        i -=1
    return sum

if __name__ == "__main__":
    n = int(stdin.readline())
    array = [int(i) for i in stdin.readline().split()]
    print(rectangular(n, array))


from sys import stdin, stdout

def rectangular(n, array):
    sum = 0
    crutch = 0
    if n < 4:
        return 0
    array.sort()
    for i in range(n-1, -1, -1):
        if array[i] - array[i - 1] <= 1:
            if crutch == 0:
                crutch = array[i-1]
                i-=1
            else:
                sum += crutch * array[i-1]
                crutch = 0
                i-=1

    return sum


# coding=utf-8

n = input()
l = list(map(int, input().split()))

a, b = 0, 0
result = 0
for i in sorted(l, reverse=True):
    if a == 0 or a > i + 1:
        a = i
    elif b == 0:
        a, b = 0, i
    else:
        result += i * b
        a, b = 0, 0

print(result)


# coding=utf-8

n = input()
l = list(map(int, input().split()))

l.sort()

result = 0
for i in range(len(l) - 3):
    if l[i] <= l[i + 1] <= l[i + 2] <= l[i + 3]:
        if (l[i] == l[i + 1] or l[i] == l[i + 1] - 1) and (l[i + 2] == l[i + 3] or l[i + 2] == l[i + 3] - 1):
            r = l[i] * l[i + 2]
            result = max(result, r)

print(result)


n = int(input())
sticks = list(map(int, input().split()))

length = [0] * 1000000
miv = 1000000
mav = 0
answ = 0
for i in range(len(sticks)):
	length[sticks[i]-1] = length[sticks[i]-1] + 1
	if sticks[i]-1 > mav:
		mav = sticks[i] - 1
	if sticks[i] -1 < miv:
		miv = sticks[i] -1

length = length[miv:mav+1]
for i in range(len(length)-1, -1, -1):
	if length[i] % 2 == 1:
		if i > 0 and length[i-1] > 0:
			length[i] = length[i] - 1
			length[i-1] = length[i-1] + 1
		else:
			length[i] = length[i] - 1

square = []
for i in range(len(length)-1, -1, -1):

	while length[i] > 0:
		square.append(i + miv + 1)
		length[i] = length[i] - 2
		if len(square) == 2:
			answ += square[0] * square[1]
			square = []
print(answ)


n = int(input())
sticks = list(map(int, input().split()))

length = [0] * 1000000
miv = 1000000
mav = 0
answ = 0
for i in range(len(sticks)):
	length[sticks[i]] = length[sticks[i]] + 1
	if sticks[i] > mav:
		mav = sticks[i]
	if sticks[i] < miv:
		miv = sticks[i]

length = length[miv:mav+1]
for i in range(len(length)-1, -1, -1):
	if length[i] % 2 == 1:
		if i > 0 and length[i-1] > 0:
			length[i] = length[i] - 1
			length[i-1] = length[i-1] + 1
		else:
			length[i] = length[i] - 1

squares = []
square = []
for i in range(len(length)-1, -1, -1):

	while length[i] > 0:
		square.append(i + miv)
		length[i] = length[i] - 2
		if len(square) == 2:
			squares.append(square)
			square = []

for i in range(len(squares)):
	mult = squares[i][0] * squares[i][1]
	answ += mult
print(answ)


n = int(input())
sticks = list(map(int, input().split()))

length = [0] * 1000000
miv = 1000000
mav = 0
answ = 0
for i in range(len(sticks)):
	length[sticks[i]] = length[sticks[i]] + 1
	if sticks[i] > mav:
		mav = sticks[i]
	if sticks[i] < miv:
		miv = sticks[i]

length = length[miv:mav+1]
for i in range(len(length)-1, -1, -1):
	if length[i] % 2 == 1:
		if i > 0 and length[i-1] > 0:
			length[i] = length[i] - 1
			length[i-1] = length[i-1] + 1
		else:
			length[i] = length[i] - 1

square = []
for i in range(len(length)-1, -1, -1):

	while length[i] > 0:
		square.append(i + miv)
		length[i] = length[i] - 2
		if len(square) == 2:
			answ += square[0] * square[1]
			square = []
print(answ)


n = int(input())
sticks = list(map(int, input().split()))

length = [0] * 1000000
miv = 1000000
mav = 0
answ = 0
for i in range(len(sticks)):
	length[sticks[i]] = length[sticks[i]] + 1
	if sticks[i] > mav:
		mav = sticks[i]
	if sticks[i] < miv:
		miv = sticks[i]

length = length[miv:mav+1]
for i in range(len(length)-1, -1, -1):
	if length[i] % 2 == 1:
		if i > 0 and length[i-1] > 0:
			length[i] = length[i] - 1
			length[i-1] = length[i-1] + 1
		else:
			length[i] = length[i] - 1
squares = []
square = []
for i in range(len(length)-1, -1, -1):
	for k in range(2):
		if length[i] > 0:
			square.append(i + miv )
			length[i] = length[i] - 2
	if len(square) == 2:
		squares.append(square)
		square = []

for i in range(len(squares)):
	mult = squares[i][0] * squares[i][1]
	answ += mult
print(answ)


n = int(input())
sticks = list(map(int, input().split()))

length = [0] * 1000000
miv = 1000000
mav = 0
answ = 0
for i in range(len(sticks)):
	length[sticks[i]] = length[sticks[i]] + 1
	if sticks[i] > mav:
		mav = sticks[i]
	if sticks[i] < miv:
		miv = sticks[i]

length = length[miv:mav+1]
for i in range(len(length)-1, -1, -1):
	if length[i] % 2 == 1:
		if i > 0 and length[i-1] > 0:
			length[i] = length[i] - 1
			length[i-1] = length[i-1] + 1
		else:
			length[i] = length[i] - 1

squares = []
square = []
for i in range(len(length)-1, -1, -1):

	for k in range(2):
		if length[i] > 0 and len(square) < 2:
			square.append(i + miv)
			length[i] = length[i] - 2
	if len(square) == 2:
		squares.append(square)
		square = []

for i in range(len(squares)):
	mult = squares[i][0] * squares[i][1]
	answ += mult
print(answ)


n=int(input())
l=list(map(int,input().split()))

l.sort()
ls=[]
i=1
while i<n:
	if (l[i]==l[i-1]):
		ls.append(l[i])
		i+=2
	elif (l[i]-1==l[i-1]):
	    ls.append(l[i-1])
	    i+=2
	else:
		i+=1

total=0
for i in range(len(ls)-1,1,-2):
    cs=ls[i-1]*ls[i]
    total+=cs

print(total)


n=int(input())
l=list(map(int,input().split()))

l.sort()
ls=[]
i=1
while i<n:
	if (l[i]==l[i-1]):
		ls.append(l[i])
		i+=2
	elif (l[i]-1==l[i-1]):
	    ls.append(l[i-1])
	    i+=2
	else:
		i+=1

total=0
for i in range(len(ls)-1,0,-2):
    cs=ls[i-1]*ls[i]
    total+=cs

print(total)


n=int(input())
l=list(map(int,input().split()))

l.sort()
ls=[]
i=1
while i<n:
	if (l[i]==l[i-1]):
		ls.append(l[i])
		i+=2
	elif (l[i]-1==l[i-1]):
	    ls.append(l[i-1])
	    i+=2
	else:
		i+=1

total=0
for i in range(1,len(ls),2):
    cs=ls[i-1]*ls[i]
    total+=cs

print(total)


n=int(input())
l=list(map(int,input().split()))

l.sort()
ls=[]
i=1
while i<n:
	if (l[i]==l[i-1]):
		ls.append(l[i])
		i+=2
	elif (l[i]-1==l[i-1]):
	    ls.append(l[i-1])
	    i+=2
	else:
		i+=1

total=0
cs=sum(ls)
for i in range(len(ls)):
    xs=cs-ls[i]
    ys=xs*ls[i]
    total+=ys
    cs=cs-ls[i]

print(total)


n=int(input())
l=list(map(int,input().split()))

l.sort()
ls=[]
i=1
while i<n:
	if (l[i]==l[i-1]):
		ls.append(l[i])
		i+=2
	elif (l[i]-1==l[i-1]):
	    ls.append(l[i-1])
	    i+=2
	else:
		i+=1

total=0
for i in range(len(ls)-1,-1,-2):
    cs=ls[i-1]*ls[i]
    total+=cs

print(total)


n, v, ps, pp = int(input()), 0, 0, 0
for l in sorted(map(int, input().split()), reverse=True):
    if ps == 0 or ps > l + 1:
        ps = l
    elif pp == 0:
        pp, ps = l, 0
    else:
        v, pp, ps = v + pp * l, 0, 0
print(v)


n = int(input())
l = [int(i) for i in input().split()]

l.sort(reverse=True)

ans = 0
area = 0
ignore_next = False

for i in range(n - 1):
  if ignore_next:
    ignore_next = False
    continue

  l1 = l[i]
  l2 = l[i+1]
  length = 0
  #print("compare", l1, l2)
  if l1 == l2:
    length = l1
  elif l1 == l2 + 1:
    length = l1 - 1
  #print('length=', length, ' area=', area)
  if length:
    if area:
      ans += area * length
      area = 0
    else:
      area = length
    ignore_next = True

print(ans)


n = int(input())
l = [int(i) for i in input().split()]

l.sort(reverse=True)

ans = 0
area = 0
ignore_next = False

for i in range(n - 1):
  if ignore_next:
    ignore_next = False
    continue

  l1 = l[i]
  l2 = l[i+1]
  length = 0
  if l1 == l2:
    length = l1
  elif l1 == l2 + 1:
    length = l1 - 1
  if length:
    if area:
      ans += area * length
      area = 0
    else:
      area = length
    ignore_next = True

print(ans)


#!/c/Python34/python
# coding: utf-8 ans

def main():
    n = int(input())
    L = sorted(map(int, input().split()))
    L.reverse()
    K = []
    i = 1
    while(i < n):
        if L[i-1] == L[i]:
            K.append(L[i])
            i += 1
        elif L[i-1]-L[i] == 1:
            K.append(L[i])
            i += 1
        i += 1
    ans = 0
    for i in range(1, len(K), 2):
        ans += K[i-1] * K[i]
    print(ans)
    #print(K)

if __name__ == '__main__':
    main()


x = int(input())
L = [int(i) for i in input().split()]
L.sort()
L = L[::-1]
a = 0
c = 0
A = []
while len(L) >= 2:
    if L[0] == L[1] or L[0] == L[1]+1:
            A.append(L[1])
            L.pop(0)
            L.pop(0)

    else:
        L.pop(0)
try:
    while c < len(A):
        a += A[c]*A[c+1]
        c += 2
    print(a)
except IndexError:
    print(0)


x = input()
L = [int(i) for i in input().split()]
t = 1
A = []
c=0
while len(L)> 1 :
    try:
        if L.count(max(L)) >= 2:
            A.append( max(L))
            L = [x for x in L if x != max(L)]
        elif L.count(max(L)-1) >=1:
            A.append( max(L)-1)
            L.remove(max(L))
            L = [x for x in L if x != max(L)]
        else:
            L.remove(max(L))

    except ValueError:
        pass
try:
    print(A[0]*A[1])
except IndexError:
    print(0)


x = int(input())
L = [int(i) for i in input().split()]
L.sort()
L = L[::-1]
a = 0
c = 0
A = []
while len(L) >= 2:
    if L[0] == L[1] or L[0] == L[1]+1:
            A.append(L[1])
            L.pop(0)
            L.pop(0)

    else:
        L.pop(0)
try:
    while c < len(A):
        a += A[c]*A[c+1]
        c += 2
    print(a)
except IndexError:
    print(a)


n,l = int(input()),list(map(int,input().split()))
l.sort(reverse=True)
ans=0
size = []
i=0
while i <n-1:
    if l[i]-l[i+1]<=1:
        size.append(l[i+1])
        i+=2
    else:
        i+=1

for index in range(len(size)//2):
    ans+=size[2*index]*size[2*index+1]
print(ans)


n = int(input())

a, b = 0, 0

ans = 0

for i in sorted(map(int,input().split()),reverse=True):

    if a == 0 or a > i + 1:

        a = i

    elif b == 0:

        a, b= 0, i

    else:

        ans += i * b

        a, b = 0, 0

print(ans)

# Made By Mostafa_Khaled


n = int(input())
answer = 0
sticks = input().split()
for i in range(n):
    sticks[i] = int(sticks[i])
sticks.sort(reverse=True)
# print(sticks)
i = 0
while i < n-3:
    pack = []
    for j in range(i, i+4):
        pack.append(sticks[j])
    # print(pack)
    pack.sort(reverse=True)
    if pack[0]-1 == pack[1]:
        pack[0] -= 1
    if pack[2]-1 == pack[3]:
        pack[2] -= 1
    k1 = pack.count(min(pack))
    k2 = pack.count(max(pack))
    if k1 >= 2 and k2 >= 2:
        answer += pack[pack.index(min(pack))]*pack[pack.index((max(pack)))]
        i += 4
    else:
        i += 1
print(answer)


n = int(input())
answer = 0
sticks = input().split()
for i in range(n):
    sticks[i] = int(sticks[i])
sticks.sort(reverse=True)
# print(sticks)
i = 0
v = []
while i < n-1:
    if abs(sticks[i]-sticks[i+1]) < 2:
        v.append(min(sticks[i], sticks[i+1]))
        i+=2
    else:
        i+=1
v.sort(reverse=True)
i = 0
while i < len(v)-1:
    answer += v[i]*v[i+1]
    i += 2
print(answer)


n=int(input())
L=[int(x) for x in input().split()]
L.sort(reverse=True)
i=0
while i<n-1:
	if L[i]-1==L[i+1]:
		L[i]-=1
		i+=1
	elif L[i]==L[i+1]:
		i+=1
	i+=1
val=[]
i=0
while i<n-1:
	if L[i]==L[i+1]:
		val.append(L[i])
		i+=1
	i+=1
area=0
n=len(val)
i=0
while i<n-1:
	area+=val[i]*val[i+1]
	i+=2
print(area)


n=int(input())
L=[int(x) for x in input().split()]
L.sort(reverse=True)
i=0
while i<n-1:
	if L[i]-1==L[i+1]:
		L[i]-=1
		i+=1
	i+=1
val=[]
i=0
while i<n-1:
	if L[i]==L[i+1]:
		val.append(L[i])
		i+=1
	i+=1
area=0
n=len(val)
i=0
while i<n-1:
	area+=val[i]*val[i+1]
	i+=2
print(area)


from sys import stdin, stdout

__author__ = 'vks'

n = int(stdin.readline())
sticks = [int(i) for i in stdin.readline().split()]
sticks.sort()
square = 0
n -= 1
while n > 0:
    a = 0
    b = 0
    while n > 0 and abs(sticks[n] - sticks[n - 1]) > 0:
        n -= 1
    if n > 0:
        a = min(sticks[n], sticks[n - 1])
    n -= 2
    while n > 0 and abs(sticks[n] - sticks[n - 1]) > 0:
        n -= 1
    if n > 0:
        b = min(sticks[n], sticks[n - 1])
    n -= 2
    square += a * b
stdout.write(str(square) + "\n")


from sys import stdin, stdout

__author__ = 'vks'

n = int(stdin.readline())
sticks = [int(i) for i in stdin.readline().split()]
sticks.sort()
square = 0
n -= 1
while n > 0:
    a = 0
    b = 0
    while n > 0 and abs(sticks[n] - sticks[n - 1]) > 1:
        n -= 1
    if n > 0:
        a = min(sticks[n], sticks[n - 1])
    n -= 2
    while n > 0 and abs(sticks[n] - sticks[n - 1]) > 1:
        n -= 1
    if n > 0:
        b = min(sticks[n], sticks[n - 1])
    n -= 2
    square += a * b
stdout.write(str(square) + "\n")


n = int(input())

rects = [int(s) for s in input().split()]
rects.sort()

sumsquare = 0
stash = []

i = len(rects) - 1

while i > 0:
	if rects[i] - rects[i-1] == 1 or rects[i] == rects[i-1]:
		if len(stash) == 2:
			sumsquare += stash[0]*stash[1]
			stash.clear()

		stash.append(rects[i-1])
		rects.pop()
		rects.pop()

		i -= 2
	else:
		i -= 1

if len(stash) == 2:
	sumsquare += stash[0]*stash[1]
	stash.clear()

print(sumsquare)


from functools import reduce
from operator import *
from math import *
from sys import *
from string import *
setrecursionlimit(10**7)
RI=lambda: list(map(int,input().split()))
RS=lambda: input().rstrip().split()
#################################################
n=RI()[0]
l=RI()
l.sort(reverse=True)
ans=0
pre=0
i=0
while i<len(l)-1:
    if l[i]-l[i+1]<=1:
        if pre:
            ans+=(pre*l[i+1])
            pre=0
        else:
            pre=l[i+1]
        i+=1
    i+=1
print(ans)


from functools import reduce
from operator import *
from math import *
from sys import *
from string import *
setrecursionlimit(10**7)
RI=lambda: list(map(int,input().split()))
RS=lambda: input().rstrip().split()
#################################################
n=RI()[0]
l=RI()
l.sort(reverse=True)
ans=0
i=0
while i<len(l)-3:
    if l[i]-l[i+1]<=1 and l[i+2]-l[i+3]<=1:
        ans+=(l[i+1]*l[i+3])
        i+=3
    i+=1
print(ans)


__author__ = 'alexkane'

from sys import stdin

if __name__ == "__main__":
    number_of_sticks = int(stdin.readline().rstrip('\n'))
    second_line = stdin.readline().rstrip('\n')
    sticks = [int(x) for x in second_line.split(' ')]

def execute(number_of_sticks, sticks):
    max = 0
    if number_of_sticks < 4:
        return max
    else:
        sticks.sort()
        sticks.reverse()
        current_max = 0
        i = 1
        while i < len(sticks):
            if sticks[i] - sticks[i - 1] <= 1:
                if current_max == 0:
                    current_max = sticks[i]
                    i += 1
                else:
                    max += current_max * sticks[i]
                    current_max = 0
                    i += 1
            i += 1
        return max

if __name__ == "__main__":
    print(execute(number_of_sticks, sticks))