#include<bits/stdc++.h>
using namespace std;
const int MAXN = 100005;
long long a[50],b[50],n,ans,na,numa,nb,pa;
set <long long> t[50];//t[i]中存的是a数组中取i个数能得到的值 
int now[MAXN], method[MAXN], p[MAXN];
long long aa[MAXN],s[MAXN],ss;
int tf; 
template <typename T> void chkmax(T &x, T y) {x = max(x, y); }
template <typename T> void chkmin(T &x, T y) {x = min(x, y); } 
template <typename T> void read(T &x) {
	x = 0; int f = 1;
	char c = getchar();
	for (; !isdigit(c); c = getchar()) if (c == '-') f = -f;
	for (; isdigit(c); c = getchar()) x = x * 10 + c - '0';
	x *= f;
}
template <typename T> void write(T x) {
	if (x < 0) x = -x, putchar('-');
	if (x > 9) write(x / 10);
	putchar(x % 10 + '0');
}
template <typename T> void writeln(T x) {
	write(x);
	puts("");
}//输入输出优化 

void dfs1(int dep,int now,long long num){
	if (dep>(n+1)/2) {
		if (now!=0) t[now].insert(num);
	}
	else{
		dfs1(dep+1,now+1,num+a[dep]);
		dfs1(dep+1,now,num);
	}
}

void dfs2(int dep,int now,long long num){
	if (dep>n/2) {
		long long p=0;
		int k=n/2-now;
		if (!t[k].empty()) p=*t[k].lower_bound(ss/2-num);
		if (abs(ss-2*ans)>abs(ss-2*(num+p))) {
			ans=num+p; numa=num; pa=p;//ans:可以取到的与一半最接近的值  numa:可以在b数组中取到的值 
			nb=now; na=k;//pa:还要在a数组中取的值  nb:在b数组中取的数的个数 
						 //na：在a数组中取的数的个数 
		}
	}
	else{
		dfs2(dep+1,now+1,num+b[dep]);
		dfs2(dep+1,now,num);
	}
}

void dfs3(int pos,int tot,long long sum) {
	if (tf==0 && pos<=(n+1)/2+1){
		if (tot==na && sum==pa) {
			cout<<n/2;
			for (int i = 1; i <= na; i++) cout<<' '<<now[i]; 
			tf=1;
			return; 
		}//输出在a数组中的na个数
		if (sum>pa || tot>na) return;
		if (pos & 1) {
			dfs3(pos + 1, tot, sum);
			now[tot + 1] = pos;
			dfs3(pos + 1, tot + 1,sum + a[pos]);
		} else {
			now[tot + 1] = pos;
			dfs3(pos + 1, tot + 1, sum + a[pos]);
			dfs3(pos + 1, tot, sum);
		}//分奇偶效率更高，下同 
	}	
}

void dfs4(int pos,int tot,long long sum) {
	if (tf==0 && pos<=n/2+1) {
		if (tot==nb && sum==numa) {
			for (int i = 1; i <= nb; i++) cout<<' '<<now[i]+(n+1)/2; cout<<endl;
			tf=1;
			return;
		}//输出b数组中的nb个数 
		if (sum>numa || tot>nb) return;
		if (pos & 1) {
			dfs4(pos + 1, tot, sum);
			now[tot + 1] = pos;
			dfs4(pos + 1, tot + 1,sum + b[pos]);
		} else {
			now[tot + 1] =pos;
			dfs4(pos + 1, tot + 1, sum + b[pos]);
			dfs4(pos + 1, tot, sum);
		}
	}	
}

int main() {
	cin>>n;
	ss=0;
	for (int i=1; i<=(n+1)/2; i++) {
		cin>>a[i]; ss+=a[i]; 
	}
	for (int j=1; j<=n/2; j++) {
		cin>>b[j]; ss+=b[j];
	}
	for (int i=0; i<=18; i++) t[i].clear();
	dfs1(1,0,0);
	dfs2(1,0,0);
	tf=0; 
	dfs3(1,0,0);
	tf=0;
	dfs4(1,0,0);
	return 0;
}