#include <cstring>
#include <string.h>
#include <map>
#include <deque>
#include <queue>
#include <stack>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <algorithm>
#include <vector>
#include <set>
#include <memory.h>
using namespace std;
const int OO=(int)1e8;
int n;
int arr[12];
int a,b;
int memo[11][16][16][16];
int dp(int idx,int h1,int h2,int h3)
{
	if(idx==n-1 && h1<=0 &&h2<=0 &&h3<=0)
		return 0;
	if(idx==n-1)
		return OO;
	h1=max(0,h1);
	h2=max(0,h2);
	h3=max(0,h3);
	int &x=memo[idx][h1][h2][h3];
	if(x!=-1)return x;
	int mn=(h1+b-1)/b;
	int ret=OO;
	for(int i=mn;i<=20;++i)
	{
		ret=min(ret,i+dp(idx+1,h2-(i*a),h3-(i*b),arr[idx+2]));
	}
	return x=ret;
}
bool f=0;
void build(int idx,int h1,int h2,int h3)
{
	if(idx==n-1 && h1<=0 &&h2<=0 &&h3<=0)
		return ;
	if(idx==n-1)
		return ;
	h1=max(0,h1);
	h2=max(0,h2);
	h3=max(0,h3);
	int x=dp(idx,h1,h2,h3);
	int mn=(h1+b-1)/b;
	int ret=OO;
	for(int i=mn;i<=20;++i)
	{
		ret=min(ret,i+dp(idx+1,h2-(i*a),h3-(i*b),arr[idx+2]));
		if(ret==x)
		{
			for(int j=0;j<i;++j)
			{
				if(f)
					cout<<" ";
				f=1;
				cout<<idx+1;
			}
			build(idx+1,h2-(i*a),h3-(i*b),arr[idx+2]);
			break;
		}
	}

	return ;
}
int main()
{
	#ifndef ONLINE_JUDGE
	freopen("1.txt","r",stdin);
	#endif
	cin>>n>>a>>b;
	memset(memo,-1,sizeof memo);
	arr[n]=-1;
	for(int i=0;i<n;++i)
	{
		cin>>arr[i];
		arr[i]++;
	}
	cout<<dp(1,arr[0],arr[1],arr[2])<<endl;
	build(1,arr[0],arr[1],arr[2]);
	return 0;
}


#include <cstring>
#include <string.h>
#include <map>
#include <deque>
#include <queue>
#include <stack>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <algorithm>
#include <vector>
#include <set>
#include <memory.h>
using namespace std;
const int OO=(int)1e8;
int n;
int arr[12];
int a,b;
int memo[11][16][16][16];
int dp(int idx,int h1,int h2,int h3)
{
	if(idx==n-1 && h1<=0 &&h2<=0 &&h3<=0)
		return 0;
	if(idx==n-1)
		return OO;
	h1=max(0,h1);
	h2=max(0,h2);
	h3=max(0,h3);
	int &x=memo[idx][h1][h2][h3];
	if(x!=-1)return x;
	int mn=(h1+b-1)/b;
	int ret=OO;
	for(int i=mn;i<16;++i)
	{
		ret=min(ret,i+dp(idx+1,h2-(i*a),h3-(i*b),arr[idx+2]));
	}
	return x=ret;
}
bool f=0;
void build(int idx,int h1,int h2,int h3)
{
	if(idx==n-1 && h1<=0 &&h2<=0 &&h3<=0)
		return ;
	if(idx==n-1)
		return ;
	int x=dp(idx,h1,h2,h3);
	int mn=(h1+b-1)/b;
	int ret=OO;
	for(int i=mn;i<16;++i)
	{
		ret=min(ret,i+dp(idx+1,h2-(i*a),h3-(i*b),arr[idx+2]));
		if(ret==x)
		{
			for(int j=0;j<i;++j)
			{
				if(f)
					cout<<" ";
				f=1;
				cout<<idx+1;
			}
			build(idx+1,h2-(i*a),h3-(i*b),arr[idx+2]);
			break;
		}
	}

	return ;
}
int main()
{
	#ifndef ONLINE_JUDGE
	freopen("1.txt","r",stdin);
	#endif
	cin>>n>>a>>b;
	memset(memo,-1,sizeof memo);
	arr[n]=-1;
	for(int i=0;i<n;++i)
	{
		cin>>arr[i];
		arr[i]++;
	}
	cout<<dp(1,arr[0],arr[1],arr[2])<<endl;
	build(1,arr[0],arr[1],arr[2]);
	return 0;
}


#include <cstring>
#include <string.h>
#include <map>
#include <deque>
#include <queue>
#include <stack>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <algorithm>
#include <vector>
#include <set>
#include <memory.h>
using namespace std;
const int OO=(int)1e8;
int n;
int arr[12];
int a,b;
int memo[11][16][16][16];
int dp(int idx,int h1,int h2,int h3)
{
	if(idx==n-1 && h1<=0 &&h2<=0 &&h3<=0)
		return 0;
	if(idx==n-1)
		return OO;
	h1=max(0,h1);
	h2=max(0,h2);
	h3=max(0,h3);
	int &x=memo[idx][h1][h2][h3];
	int mn=(h1+b-1)/b;
	int ret=OO;
	for(int i=mn;i<16;++i)
	{
		ret=min(ret,i+dp(idx+1,h2-(i*a),h3-(i*b),arr[idx+2]));
	}
	return x=ret;
}
bool f=0;
void build(int idx,int h1,int h2,int h3)
{
	if(idx==n-1 && h1<=0 &&h2<=0 &&h3<=0)
		return ;
	if(idx==n-1)
		return ;
	int x=dp(idx,h1,h2,h3);
	int mn=(h1+b-1)/b;
	int ret=OO;
	for(int i=mn;i<16;++i)
	{
		ret=min(ret,i+dp(idx+1,h2-(i*a),h3-(i*b),arr[idx+2]));
		if(ret==x)
		{
			for(int j=0;j<i;++j)
			{
				if(f)
					cout<<" ";
				f=1;
				cout<<idx+1;
			}
			build(idx+1,h2-(i*a),h3-(i*b),arr[idx+2]);
			break;
		}
	}

	return ;
}
int main()
{
	#ifndef ONLINE_JUDGE
	freopen("1.txt","r",stdin);
	#endif
	cin>>n>>a>>b;
	memset(memo,-1,sizeof memo);
	arr[n]=-1;
	for(int i=0;i<n;++i)
	{
		cin>>arr[i];
		arr[i]++;
	}
	cout<<dp(1,arr[0],arr[1],arr[2])<<endl;
	build(1,arr[0],arr[1],arr[2]);
	return 0;
}


#include <cstring>
#include <string.h>
#include <map>
#include <deque>
#include <queue>
#include <stack>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <algorithm>
#include <vector>
#include <set>
#include <memory.h>
using namespace std;
const int OO=(int)1e8;
int n;
int arr[12];
int a,b;
int memo[11][17][17][17];
int dp(int idx,int h1,int h2,int h3)
{
	if(idx==n-1 && h1<=0 &&h2<=0 &&h3<=0)
		return 0;
	if(idx==n-1)
		return OO;
	h1=max(0,h1);
	h2=max(0,h2);
	h3=max(0,h3);
	int &x=memo[idx][h1][h2][h3];
	if(x!=-1)return x;
	int mn=(h1+b-1)/b;
	int ret=OO;
	for(int i=mn;i<=20;++i)
	{
		ret=min(ret,i+dp(idx+1,h2-(i*a),h3-(i*b),arr[idx+2]));
	}
	return x=ret;
}
bool f=0;
void build(int idx,int h1,int h2,int h3)
{
	if(idx==n-1 && h1<=0 &&h2<=0 &&h3<=0)
		return ;
	if(idx==n-1)
		return ;
	h1=max(0,h1);
	h2=max(0,h2);
	h3=max(0,h3);
	int x=dp(idx,h1,h2,h3);
	int mn=(h1+b-1)/b;
	int ret=OO;
	for(int i=mn;i<=20;++i)
	{
		ret=min(ret,i+dp(idx+1,h2-(i*a),h3-(i*b),arr[idx+2]));
		if(ret==x)
		{
			for(int j=0;j<i;++j)
			{
				if(f)
					cout<<" ";
				f=1;
				cout<<idx+1;
			}
			build(idx+1,h2-(i*a),h3-(i*b),arr[idx+2]);
			break;
		}
	}

	return ;
}
int main()
{
	#ifndef ONLINE_JUDGE
	freopen("1.txt","r",stdin);
	#endif
	cin>>n>>a>>b;
	memset(memo,-1,sizeof memo);
	arr[n]=-1;
	for(int i=0;i<n;++i)
	{
		cin>>arr[i];
		arr[i]++;
	}
	cout<<dp(1,arr[0],arr[1],arr[2])<<endl;
	build(1,arr[0],arr[1],arr[2]);
	return 0;
}


#include <cstring>
#include <string.h>
#include <map>
#include <deque>
#include <queue>
#include <stack>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <algorithm>
#include <vector>
#include <set>
#include <memory.h>
using namespace std;
const int OO=(int)1e8;
int n;
int arr[12];
int a,b;
int memo[11][16][16][16];
int dp(int idx,int h1,int h2,int h3)
{
	if(idx==n-1 && h1<=0 &&h2<=0 &&h3<=0)
		return 0;
	if(idx==n-1)
		return OO;
	h1=max(0,h1);
	h2=max(0,h2);
	h3=max(0,h3);
	int &x=memo[idx][h1][h2][h3];
	int mn=(h1+b-1)/b;
	int ret=OO;
	for(int i=mn;i<20;++i)
	{
		ret=min(ret,i+dp(idx+1,h2-(i*a),h3-(i*b),arr[idx+2]));
	}
	return x=ret;
}
bool f=0;
void build(int idx,int h1,int h2,int h3)
{
	if(idx==n-1 && h1<=0 &&h2<=0 &&h3<=0)
		return ;
	if(idx==n-1)
		return ;
	int x=dp(idx,h1,h2,h3);
	int mn=(h1+b-1)/b;
	int ret=OO;
	for(int i=mn;i<20;++i)
	{
		ret=min(ret,i+dp(idx+1,h2-(i*a),h3-(i*b),arr[idx+2]));
		if(ret==x)
		{
			for(int j=0;j<i;++j)
			{
				if(f)
					cout<<" ";
				f=1;
				cout<<idx+1;
			}
			build(idx+1,h2-(i*a),h3-(i*b),arr[idx+2]);
			break;
		}
	}

	return ;
}
int main()
{
	#ifndef ONLINE_JUDGE
	freopen("1.txt","r",stdin);
	#endif
	cin>>n>>a>>b;
	memset(memo,-1,sizeof memo);
	arr[n]=-1;
	for(int i=0;i<n;++i)
	{
		cin>>arr[i];
		arr[i]++;
	}
	cout<<dp(1,arr[0],arr[1],arr[2])<<endl;
	build(1,arr[0],arr[1],arr[2]);
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
int n,a,b,h[20],att[100],ans;
bool dfs(int i,int x,int l)
{
	int j,m;
	if (i==0)
		{
			for (j=1;j<=n;j++)
				if (h[j]>=0)
					return false;
			return true;
		}
	if (h[x]<0)
		return dfs(i,x+1,l);
	if (x==n)
		{
			h[n]-=b;att[i]=n-1;
			if (dfs(i-1,x,l))
				{
					return true;
				}
			h[n]+=b;
		}
	else for (m=max(x,l);m<=x+1;m++)
			if (m>1&&m<n)
				{
					att[i]=m;
					h[m]-=a;h[m-1]-=b;h[m+1]-=b;
					if (dfs(i-1,x,l))
							return true;
					h[m]+=a;h[m-1]+=b;h[m+1]+=b;
				}
	return false;
}
int main()
{
	int i;
	cin>>n>>a>>b;
	for (i=1;i<=n;i++)
		cin>>h[i];
	for (ans=1;;ans++)
		if (dfs(ans,1,2)==1)
			{
				cout<<ans<<endl;
				for (i=1;i<=ans;i++)
					printf("%d ",att[i]);
				printf("\n");
				return 0;
			}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
int n,a,b,h[20],att[100],ans,t;
bool dfs(int i,int x,int l)
{
	int j,m;
	if (i==0)
		{
			for (j=1;j<=n;j++)
				if (h[j]>=0)
					return false;
			return true;
		}
	if (h[x]<0)
		return dfs(i,x+1,l);
	if (x==n)
		{
			h[n]-=b;
			if (dfs(i-1,x,l))
				{
					att[t]=n-1;
					t++;
					return true;
				}
			h[n]+=b;
		}
	else for (m=max(x,l);m<=x+1;m++)
			if (m>1&&m<n)
				{
					h[m]-=a;h[m-1]-=b;h[m+1]-=b;
					if (dfs(i-1,x,l))
						{
							att[t]=m;
							t++;
							return true;
						}
					h[m]+=a;h[m-1]+=b;h[m+1]+=b;
				}
	return false;
}
int main()
{
	t=0;
	int i;
	cin>>n>>a>>b;
	for (i=1;i<=n;i++)
		cin>>h[i];
	for (ans=1;;ans++)
		if (dfs(ans,1,2)==1)
			{
				cout<<ans<<endl;
				for (i=0;i<t;i++)
					printf("%d ",att[i]);
				printf("\n");
				return 0;
			}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
int n,a,b,h[20],att[100],ans,t;
int dfs(int i,int x,int l)
{
	int j,m;
	if (i==0)
		{
			for (j=1;j<=n;j++)
				if (h[j]>=0)
					return 0;
			return 1;
		}
	if (h[x]<0)
		return dfs(i,x+1,l);
	if (x==n)
		{
			h[n]-=b;
			if (dfs(i-1,x,l))
				{
					att[t]=n-1;
					t++;
					return 1;
				}
			h[n]+=b;
		}
	else for (m=max(x,l);m<=x+1;m++)
			if (m>1&&m<n)
				{
					h[m]-=a;h[m-1]-=b;h[m+1]-=b;
					if (dfs(i-1,x,l))
						{
							att[t]=m;
							t++;
							return 1;
						}
					h[m]+=a;h[m-1]+=b;h[m+1]+=b;
				}
	return 0;
}
int main()
{
	t=0;
	int i;
	cin>>n>>a>>b;
	for (i=1;i<=n;i++)
		cin>>h[i];
	for (ans=1;;ans++)
		if (dfs(ans,1,2)==1)
			{
				cout<<ans<<endl;
				for (i=0;i<t;i++)
					printf("%d ",att[i]);
				printf("\n");
				return 0;
			}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
int n,a,b,h[20],att[100],ans;
bool dfs(int i,int x,int l)
{
	int j,m;
	if (i==0)
		{
			for (j=1;j<=n;j++)
				if (h[j]>=0)
					return false;
			return true;
		}
	if (h[x]<0)
		return dfs(i,x+1,l);
	if (x==n)
		{
			h[n]-=b;att[i]=n-1;
			if (dfs(i-1,x,l))
					return true;
			h[n]+=b;
		}
	else for (m=max(x,l);m<=x+1;m++)
			if (m>1&&m<n)
				{
					att[i]=m;
					h[m]-=a;h[m-1]-=b;h[m+1]-=b;
					if (dfs(i-1,x,i))
							return true;
					h[m]+=a;h[m-1]+=b;h[m+1]+=b;
				}
	return false;
}
int main()
{
	int i;
	cin>>n>>a>>b;
	for (i=1;i<=n;i++)
		cin>>h[i];
	for (ans=1;;ans++)
		if (dfs(ans,1,2)==1)
			{
				cout<<ans<<endl;
				for (i=1;i<=ans;i++)
					printf("%d ",att[i]);
				printf("\n");
				return 0;
			}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
int n,a,b,h[20],att[100],ans;
bool dfs(int i,int x,int l)
{
	int j,m;
	if (i==0)
		{
			for (j=1;j<=n;j++)
				if (h[j]>=0)
					return false;
			return true;
		}
	if (h[x]<0)
		return dfs(i,x+1,l);
	if (x==n)
		{
			h[n]-=b;att[i]=n-1;
			if (dfs(i-1,x,l))
					return true;
			h[n]+=b;
		}
	else for (m=max(x,l);m<=x+1;m++)
			if (m>1&&m<n)
				{
					att[i]=m;
					h[m]-=a;h[m-1]-=b;h[m+1]-=b;
					if (dfs(i-1,x,m))
							return true;
					h[m]+=a;h[m-1]+=b;h[m+1]+=b;
				}
	return false;
}
int main()
{
	int i;
	cin>>n>>a>>b;
	for (i=1;i<=n;i++)
		cin>>h[i];
	for (ans=1;;ans++)
		if (dfs(ans,1,2))
			{
				cout<<ans<<endl;
				for (i=1;i<=ans;i++)
					printf("%d ",att[i]);
				printf("\n");
				return 0;
			}
	return 0;
}


#include <cmath>
#include <vector>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <algorithm>

using namespace std;

const int max_n = 55, inf = 111111111;

int n, a, b, ans, h[max_n];
vector <int> ans1;

int main() {
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    cin >> n >> a >> b;
    for (int i = 1; i <= n; ++i) {
        cin >> h[i];
    }
    while (h[1] >= 0) {
        h[2] -= a;
        h[1] -= b;
        h[3] -= b;
        ans++;
        ans1.push_back(2);
    }
    while (h[n] >= 0) {
        h[n - 1] -= a;
        h[n] -= b;
        h[n - 2] -= b;
        ans++;
        ans1.push_back(n - 1);
    }
    for (int i = 2; i < n; ++i) {
        if (h[i] >= 0) {
            if (a > b) {
                while (h[i] >= 0) {
                    h[i] -= a;
                    h[i + 1] -= b;
                    ans++;
                    ans1.push_back(i);
                }
            } else {
                while (h[i] >= 0) {
                    h[i + 1] -= a;
                    h[i] -= b;
                    h[i + 2] -= b;
                    ans++;
                    ans1.push_back(i + 1);
                }
            }
        }
    }
    cout << ans << endl;
    for (int i = 0; i < ans1.size(); ++i) {
        cout << ans1[i] << ' ';
    }
    return 0;
}


#include <cmath>
#include <vector>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <algorithm>

using namespace std;

const int max_n = 11, inf = 111111111;
const int br[11] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};

int n, a, b, h[max_n], ans, ans1[max_n], ans_num[max_n];

void gener(int kol, int poz) {
    /*for (int i = 1; i <= n; ++i) {
        cout << ans1[i] << ' ';
    }
    cout << endl;*/
    if (poz >= n || kol > ans || h[poz - 2] >= 0) {
        return;
    }
    int f = 0;
    for (int i = 1; i <= n; ++i) {
        if (h[i] >= 0) {
            f = 1;
            break;
        }
    }
    if (f == 0) {
        if (ans > kol) {
            ans = kol;
            for (int i = 1; i <= n; ++i) {
                ans_num[i] = ans1[i];
            }
        }
        return;
    }
    //gener(kol + 1, poz + 1, h, ans1);
    if (h[poz - 1] >= 0 || h[poz] >= 0 || h[poz + 1] >= 0) {
        h[poz] -= a;
        h[poz - 1] -= b;
        h[poz + 1] -= b;
        ans1[poz]++;
        gener(kol + 1, poz);
        ans1[poz]--;
        h[poz + 1] += b;
        h[poz - 1] += b;
        h[poz] += a;
    }
    if (poz + 1 < n) {
        h[poz + 1] -= a;
        h[poz] -= b;
        h[poz + 2] -= b;
        ans1[poz + 1]++;
        gener(kol + 1, poz + 1);
        h[poz + 1] += a;
        h[poz] += b;
        h[poz + 2] += b;
        ans1[poz + 1]--;
    }
    return;
}

int main() {
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    cin >> n >> a >> b;
    for (int i = 1; i <= n; ++i) {
        cin >> h[i];
    }
    ans = inf;
    h[0] = -1;
    gener(0, 2);
    ans = 0;
    for (int i = 1; i <= n; ++i) {
        ans += ans_num[i];
    }
    cout << ans << endl;
    for (int i = 1; i <= n; ++i) {
        for (int j = 0; j < ans_num[i]; ++j) {
            cout << i << " ";
        }
    }
    return 0;
}


#include <cmath>
#include <vector>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <algorithm>

using namespace std;

const int max_n = 11, inf = 111111111;
const int br[11] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};

int n, a, b, h[max_n], ans, ans1[max_n], ans_num[max_n];

void gener(int kol, int poz) {
    /*for (int i = 1; i <= n; ++i) {
        cout << ans1[i] << ' ';
    }
    cout << endl;*/
    if (poz >= n || kol > ans || h[poz - 2] >= 0) {
        return;
    }
    int f = 0;
    for (int i = 1; i <= n; ++i) {
        if (h[i] >= 0) {
            f = 1;
            break;
        }
    }
    if (f == 0) {
        if (ans > kol) {
            ans = kol;
            for (int i = 1; i <= n; ++i) {
                ans_num[i] = ans1[i];
            }
        }
        return;
    }
    gener(kol + 1, poz + 1);
    if (h[poz - 1] >= 0 || h[poz] >= 0 || h[poz + 1] >= 0) {
        h[poz] -= a;
        h[poz - 1] -= b;
        h[poz + 1] -= b;
        ans1[poz]++;
        gener(kol + 1, poz);
        ans1[poz]--;
        h[poz + 1] += b;
        h[poz - 1] += b;
        h[poz] += a;
    }
    if (poz + 1 < n) {
        h[poz + 1] -= a;
        h[poz] -= b;
        h[poz + 2] -= b;
        ans1[poz + 1]++;
        gener(kol + 1, poz + 1);
        h[poz + 1] += a;
        h[poz] += b;
        h[poz + 2] += b;
        ans1[poz + 1]--;
    }
    return;
}

int main() {
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    cin >> n >> a >> b;
    for (int i = 1; i <= n; ++i) {
        cin >> h[i];
    }
    ans = inf;
    h[0] = -1;
    gener(0, 2);
    ans = 0;
    for (int i = 1; i <= n; ++i) {
        ans += ans_num[i];
    }
    cout << ans << endl;
    for (int i = 1; i <= n; ++i) {
        for (int j = 0; j < ans_num[i]; ++j) {
            cout << i << " ";
        }
    }
    return 0;
}


#include <cmath>
#include <vector>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <algorithm>

using namespace std;

const int max_n = 11, inf = 111111111;

int n, a, b, sum_h, h[max_n], ans, ans1[max_n], ans_num[max_n];

void gener(int sum, int kol, int poz) {
    if (h[poz - 2] >= 0 || kol > ans) return;
    if (poz == n) {
        /*if (sum < sum_h) {
            return;
        }*/
        for (int i = 1; i <= n; ++i) {
            if (h[i] >= 0) {
                return;
            }
        }
        if (kol < ans) {
            ans = kol;
            for (int i = 2; i < n; ++i) {
                ans_num[i] = ans1[i];
            }
        }
        return;
    }
    for (int i = 0; i <= 15 / b; ++i) {
        ans1[poz] = i;
        h[poz] -= i * a;
        h[poz - 1] -= i * b;
        h[poz + 1] -= i * b;
        gener(sum + i * (a + 2 * b), kol + i, poz + 1);
        h[poz] += i * a;
        h[poz - 1] += i * b;
        h[poz + 1] += i * b;
    }
    return;
}

int main() {
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    cin >> n >> a >> b;
    for (int i = 1; i <= n; ++i) {
        cin >> h[i];
        sum_h += h[i];
    }
    ans = inf;
    h[0] = -1;
    gener(0, 0, 2);
    cout << ans << endl;
    for (int i = 1; i <= n; ++i) {
        for (int j = 0; j < ans_num[i]; ++j) {
            cout << i << " ";
        }
    }
    return 0;
}


#include <cmath>
#include <vector>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <algorithm>

using namespace std;

const int max_n = 11, inf = 111111111;

int n, a, b, sum_h, h[max_n], ans, ans1[max_n], ans_num[max_n];

void gener(int sum, int kol, int poz) {
    if (h[poz - 2] >= 0 || kol > ans) return;
    if (poz == n) {
        /*if (sum < sum_h) {
            return;
        }*/
        for (int i = 1; i <= n; ++i) {
            if (h[i] >= 0) {
                return;
            }
        }
        if (kol < ans) {
            ans = kol;
            for (int i = 2; i < n; ++i) {
                ans_num[i] = ans1[i];
            }
        }
        return;
    }
    for (int i = 0; i <= 15 / b + 1; ++i) {
        ans1[poz] = i;
        h[poz] -= i * a;
        h[poz - 1] -= i * b;
        h[poz + 1] -= i * b;
        gener(sum + i * (a + 2 * b), kol + i, poz + 1);
        h[poz] += i * a;
        h[poz - 1] += i * b;
        h[poz + 1] += i * b;
    }
    return;
}

int main() {
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    cin >> n >> a >> b;
    for (int i = 1; i <= n; ++i) {
        cin >> h[i];
        sum_h += h[i];
    }
    ans = inf;
    h[0] = -1;
    gener(0, 0, 2);
    cout << ans << endl;
    for (int i = 1; i <= n; ++i) {
        for (int j = 0; j < ans_num[i]; ++j) {
            cout << i << " ";
        }
    }
    return 0;
}


#include <cmath>
#include <vector>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <algorithm>

using namespace std;

const int max_n = 11, inf = 111111111;

int n, a, b, sum_h, h[max_n], ans, ans1[max_n], ans_num[max_n];

void gener(int sum, int kol, int poz) {
    if (poz == n) {
        if (sum < sum_h) {
            return;
        }
        for (int i = 1; i <= n; ++i) {
            if (h[i] >= 0) {
                return;
            }
        }
        if (kol < ans) {
            ans = kol;
            for (int i = 2; i < n; ++i) {
                ans_num[i] = ans1[i];
            }
        }
        return;
    }
    for (int i = 0; i < 9; ++i) {
        ans1[poz] = i;
        h[poz] -= i * a;
        h[poz - 1] -= i * b;
        h[poz + 1] -= i * b;
        gener(sum + i * (a + 2 * b), kol + i, poz + 1);
        h[poz] += i * a;
        h[poz - 1] += i * b;
        h[poz + 1] += i * b;
    }
    return;
}

int main() {
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    cin >> n >> a >> b;
    for (int i = 1; i <= n; ++i) {
        cin >> h[i];
        sum_h += h[i];
    }
    ans = inf;
    h[0] = -1;
    gener(0, 0, 2);
    cout << ans << endl;
    for (int i = 1; i <= n; ++i) {
        for (int j = 0; j < ans_num[i]; ++j) {
            cout << i << " ";
        }
    }
    return 0;
}


#include <cmath>
#include <vector>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <algorithm>

using namespace std;

const int max_n = 11, inf = 111111111;
const int br[11] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};

int n, a, b, h[max_n], ans, ans1[max_n], ans_num[max_n];

void gener(int kol, int poz) {
    for (int i = 1; i <= n; ++i) {
        cout << ans1[i] << ' ';
    }
    cout << endl;
    if (poz >= n || kol > ans || h[poz - 2] >= 0) {
        return;
    }
    int f = 0;
    for (int i = 1; i <= n; ++i) {
        if (h[i] >= 0) {
            f = 1;
            break;
        }
    }
    if (f == 0) {
        if (ans > kol) {
            ans = kol;
            for (int i = 1; i <= n; ++i) {
                ans_num[i] = ans1[i];
            }
        }
        return;
    }
    //gener(kol + 1, poz + 1, h, ans1);
    if (h[poz - 1] >= 0 || h[poz] >= 0 || h[poz + 1] >= 0) {
        h[poz] -= a;
        h[poz - 1] -= b;
        h[poz + 1] -= b;
        ans1[poz]++;
        gener(kol + 1, poz);
        ans1[poz]--;
        h[poz + 1] += b;
        h[poz - 1] += b;
        h[poz] += a;
    }
    if (poz + 1 < n) {
        h[poz + 1] -= a;
        h[poz] -= b;
        h[poz + 2] -= b;
        ans1[poz + 1]++;
        gener(kol + 1, poz + 1);
        h[poz + 1] += a;
        h[poz] += b;
        h[poz + 2] += b;
        ans1[poz + 1]--;
    }
    return;
}

int main() {
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    cin >> n >> a >> b;
    for (int i = 1; i <= n; ++i) {
        cin >> h[i];
    }
    ans = inf;
    h[0] = -1;
    gener(0, 2);
    ans = 0;
    for (int i = 1; i <= n; ++i) {
        ans += ans_num[i];
    }
    cout << ans << endl;
    for (int i = 1; i <= n; ++i) {
        for (int j = 0; j < ans_num[i]; ++j) {
            cout << i << " ";
        }
    }
    return 0;
}


#include <cmath>
#include <vector>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <algorithm>

using namespace std;

const int max_n = 11, inf = 111111111;

int n, a, b, h[max_n], ans, ans1[max_n], ans_num[max_n];

void gener(int kol, int poz) {
    /*for (int i = 1; i <= n; ++i) {
        cout << ans1[i] << ' ';
    }
    cout << endl;*/
    if (poz >= n || kol > ans || h[poz - 2] >= 0) {
        return;
    }
    int f = 0;
    for (int i = 1; i <= n; ++i) {
        if (h[i] >= 0) {
            f = 1;
            break;
        }
    }
    if (f == 0) {
        if (ans > kol) {
            ans = kol;
            for (int i = 2; i < n; ++i) {
                ans_num[i] = ans1[i];
            }
        }
        return;
    }
    if (h[poz - 1] < 0 && poz + 1 < n) gener(kol, poz + 1);
    if (h[poz - 1] >= 0 || h[poz] >= 0 || h[poz + 1] >= 0) {
        h[poz] -= a;
        h[poz - 1] -= b;
        h[poz + 1] -= b;
        ans1[poz]++;
        gener(kol + 1, poz);
        ans1[poz]--;
        h[poz + 1] += b;
        h[poz - 1] += b;
        h[poz] += a;
    }
    if (h[poz - 1] < 0 && poz + 1 < n) {
        h[poz + 1] -= a;
        h[poz] -= b;
        h[poz + 2] -= b;
        ans1[poz + 1]++;
        gener(kol + 1, poz + 1);
        h[poz + 1] += a;
        h[poz] += b;
        h[poz + 2] += b;
        ans1[poz + 1]--;
    }
    return;
}

int main() {
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    cin >> n >> a >> b;
    for (int i = 1; i <= n; ++i) {
        cin >> h[i];
    }
    ans = inf;
    h[0] = -1;
    gener(0, 2);
    cout << ans << endl;
    for (int i = 1; i <= n; ++i) {
        for (int j = 0; j < ans_num[i]; ++j) {
            cout << i << " ";
        }
    }
    return 0;
}


#include <cmath>
#include <vector>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <algorithm>

using namespace std;

const int max_n = 55, inf = 111111111;

int n, a, b, ans, h[max_n];
vector <int> ans1;

int main() {
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    cin >> n >> a >> b;
    for (int i = 1; i <= n; ++i) {
        cin >> h[i];
    }
    while (h[1] >= 0) {
        h[2] -= a;
        h[1] -= b;
        h[3] -= b;
        ans++;
        ans1.push_back(2);
    }
    while (h[n] >= 0) {
        h[n - 1] -= a;
        h[n] -= b;
        h[n - 2] -= b;
        ans++;
        ans1.push_back(n - 1);
    }
    for (int i = 2; i < n; ++i) {
        if (h[i] >= 0) {
            if (a / 2 > b) {
                while (h[i] > 0) {
                    h[i] -= a;
                    h[i + 1] -= b;
                    ans++;
                    ans1.push_back(i);
                }
            } else {
                while (h[i] >= 0) {
                    h[i + 1] -= a;
                    h[i] -= b;
                    h[i + 2] -= b;
                    ans++;
                    ans1.push_back(i + 1);
                }
            }
        }
    }
    cout << ans << endl;
    for (int i = 0; i < ans1.size(); ++i) {
        cout << ans1[i] << ' ';
    }
    return 0;
}


#include <cmath>
#include <vector>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <algorithm>

using namespace std;

const int max_n = 11, inf = 111111111;

int n, a, b, sum_h, h[max_n], ans, ans1[max_n], ans_num[max_n];

void gener(int sum, int kol, int poz) {
    if (poz == n) {
        /*if (sum < sum_h) {
            return;
        }*/
        for (int i = 1; i <= n; ++i) {
            if (h[i] >= 0) {
                return;
            }
        }
        if (kol < ans) {
            ans = kol;
            for (int i = 2; i < n; ++i) {
                ans_num[i] = ans1[i];
            }
        }
        return;
    }
    for (int i = 0; i < 15; ++i) {
        ans1[poz] = i;
        h[poz] -= i * a;
        h[poz - 1] -= i * b;
        h[poz + 1] -= i * b;
        gener(sum + i * (a + 2 * b), kol + i, poz + 1);
        h[poz] += i * a;
        h[poz - 1] += i * b;
        h[poz + 1] += i * b;
    }
    return;
}

int main() {
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    cin >> n >> a >> b;
    for (int i = 1; i <= n; ++i) {
        cin >> h[i];
        sum_h += h[i];
    }
    ans = inf;
    gener(0, 0, 2);
    cout << ans << endl;
    for (int i = 1; i <= n; ++i) {
        for (int j = 0; j < ans_num[i]; ++j) {
            cout << i << " ";
        }
    }
    return 0;
}


#include <cmath>
#include <vector>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <algorithm>

using namespace std;

const int max_n = 11, inf = 111111111;

int n, a, b, sum_h, h[max_n], ans, ans1[max_n], ans_num[max_n];

void gener(int sum, int kol, int poz) {
    if (h[poz - 2] >= 0 || kol > ans) return;
    if (poz == n) {
        /*if (sum < sum_h) {
            return;
        }*/
        for (int i = 1; i <= n; ++i) {
            if (h[i] >= 0) {
                return;
            }
        }
        if (kol < ans) {
            ans = kol;
            for (int i = 2; i < n; ++i) {
                ans_num[i] = ans1[i];
            }
        }
        return;
    }
    for (int i = ans1[poz]; i <= 15 / b; ++i) {
        int x = i * a, y = i * b;
        ans1[poz] = i;
        h[poz] -= x;
        h[poz - 1] -= y;
        h[poz + 1] -= y;
        gener(sum + x + 2 * y, kol + i, poz + 1);
        h[poz] += x;
        h[poz - 1] += y;
        h[poz + 1] += y;
    }
    return;
}

int main() {
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    cin >> n >> a >> b;
    for (int i = 1; i <= n; ++i) {
        cin >> h[i];
        sum_h += h[i];
    }
    while (h[1] >= 0) {
        h[2] -= a;
        h[1] -= b;
        h[3] -= b;
        ans1[2]++;
    }
    while (h[n] >= 0) {
        h[n - 1] -= a;
        h[n] -= b;
        h[n - 2] -= b;
        ans++;
        ans1[n - 1]++;
    }
    for (int i = 1; i <= n; ++i) {
        sum_h += h[i];
    }
    ans = inf;
    h[0] = -1;
    gener(0, 0, 2);
    cout << ans << endl;
    for (int i = 1; i <= n; ++i) {
        for (int j = 0; j < ans_num[i]; ++j) {
            cout << i << " ";
        }
    }
    return 0;
}


#include <cmath>
#include <vector>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <algorithm>

using namespace std;

const int max_n = 11, inf = 111111111;

int n, a, b, h[max_n], ans, ans_num[max_n], br[max_n];

void gener(int kol, int poz, int h[max_n], int ans1[max_n]) {
    if (poz >= n || kol > ans || h[poz - 2] >= 0) {
        return;
    }
    int f = 0;
    for (int i = 1; i <= n; ++i) {
        if (h[i] >= 0) {
            f = 1;
            break;
        }
    }
    if (f == 0) {
        if (ans > kol) {
            ans = kol;
            for (int i = 1; i <= n; ++i) {
                ans_num[i] = ans1[i];
            }
        }
        return;
    }
    if (h[poz - 1] >= 0 || h[poz] >= 0 || h[poz + 1] >= 0) {
        h[poz] -= a;
        h[poz - 1] -= b;
        h[poz + 1] -= b;
        ans1[poz]++;
        gener(kol + 1, poz, h, ans1);
        ans1[poz]--;
        h[poz + 1] += b;
        h[poz - 1] += b;
        h[poz] += a;
    }
    h[poz + 1] -= a;
    h[poz] -= b;
    h[poz + 2] -= b;
    ans1[poz + 1]++;
    gener(kol + 1, poz + 1, h, ans1);
    return;
}

int main() {
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    cin >> n >> a >> b;
    for (int i = 1; i <= n; ++i) {
        cin >> h[i];
    }
    ans = inf;
    h[0] = -1;
    gener(0, 2, h, br);
    cout << ans << endl;
    for (int i = 1; i <= n; ++i) {
        for (int j = 0; j < ans_num[i]; ++j) {
            cout << i << " ";
        }
    }
    return 0;
}


#include <cmath>
#include <vector>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <algorithm>

using namespace std;

const int max_n = 11, inf = 111111111;

int n, a, b, h[max_n], ans, ans1[max_n], ans_num[max_n];

void gener(int kol, int poz) {
    /*for (int i = 1; i <= n; ++i) {
        cout << ans1[i] << ' ';
    }
    cout << endl;*/
    if (poz >= n || kol > ans || h[poz - 2] >= 0) {
        return;
    }
    int f = 0;
    for (int i = 1; i <= n; ++i) {
        if (h[i] >= 0) {
            f = 1;
            break;
        }
    }
    if (f == 0) {
        if (ans > kol) {
            ans = kol;
            for (int i = 2; i < n; ++i) {
                ans_num[i] = ans1[i];
            }
        }
        return;
    }
    if (h[poz - 1] < 0 && poz + 1 < n) gener(kol, poz + 1);
    if (h[poz - 1] >= 0 || h[poz] >= 0 || h[poz + 1] >= 0) {
        h[poz] -= a;
        h[poz - 1] -= b;
        h[poz + 1] -= b;
        ans1[poz]++;
        gener(kol + 1, poz);
        ans1[poz]--;
        h[poz + 1] += b;
        h[poz - 1] += b;
        h[poz] += a;
    }
    if (h[poz - 1] < 0 && poz + 1 < n) {
        h[poz + 1] -= a;
        h[poz] -= b;
        h[poz + 2] -= b;
        ans1[poz + 1]++;
        gener(kol + 1, poz + 1);
        h[poz + 1] += a;
        h[poz] += b;
        h[poz + 2] += b;
        ans1[poz + 1]--;
    }
    return;
}

int main() {
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    cin >> n >> a >> b;
    for (int i = 1; i <= n; ++i) {
        cin >> h[i];
    }
    while (h[1] >= 0) {
        h[2] -= a;
        h[1] -= b;
        h[3] -= b;
        ans1[2]++;
    }
    ans = inf;
    h[0] = -1;
    gener(0, 2);
    cout << ans << endl;
    for (int i = 1; i <= n; ++i) {
        for (int j = 0; j < ans_num[i]; ++j) {
            cout << i << " ";
        }
    }
    return 0;
}


#include <cmath>
#include <vector>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <algorithm>

using namespace std;

const int max_n = 11, inf = 111111111;

int n, a, b, h[max_n], ans, ans_num[max_n], br[max_n];

void gener(int kol, int poz, int h[max_n], int ans1[max_n]) {
    if (poz >= n || kol > ans || h[poz - 2] >= 0) {
        return;
    }
    int f = 0;
    for (int i = 1; i <= n; ++i) {
        if (h[i] >= 0) {
            f = 1;
            break;
        }
    }
    if (f == 0) {
        if (ans > kol) {
            ans = kol;
            for (int i = 1; i <= n; ++i) {
                ans_num[i] = ans1[i];
            }
        }
        return;
    }
    if (h[poz - 1] >= 0 || h[poz] >= 0 || h[poz + 1] >= 0) {
        h[poz] -= a;
        h[poz - 1] -= b;
        h[poz + 1] -= b;
        ans1[poz]++;
        gener(kol + 1, poz, h, ans1);
        ans1[poz]--;
        h[poz + 1] += b;
        h[poz - 1] += b;
        h[poz] += a;
    }
    if (poz + 1 < n) {
        h[poz + 1] -= a;
        h[poz] -= b;
        h[poz + 2] -= b;
        ans1[poz + 1]++;
        gener(kol + 1, poz + 1, h, ans1);
    }
    return;
}

int main() {
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    cin >> n >> a >> b;
    for (int i = 1; i <= n; ++i) {
        cin >> h[i];
    }
    ans = inf;
    h[0] = -1;
    gener(0, 2, h, br);
    ans = 0;
    for (int i = 1; i <= n; ++i) {
        ans += ans_num[i];
    }
    cout << ans << endl;
    for (int i = 1; i <= n; ++i) {
        for (int j = 0; j < ans_num[i]; ++j) {
            cout << i << " ";
        }
    }
    return 0;
}


#include <cmath>
#include <vector>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <algorithm>

using namespace std;

const int max_n = 11, inf = 111111111;

int n, a, b, h[max_n], ans, ans1[max_n], ans_num[max_n];

void gener(int kol, int poz) {
    if (poz >= n || kol > ans || h[poz - 2] >= 0) {
        return;
    }
    int f = 0;
    for (int i = 1; i <= n; ++i) {
        if (h[i] >= 0) {
            f = 1;
            break;
        }
    }
    if (f == 0) {
        if (ans > kol) {
            ans = kol;
            for (int i = 2; i < n; ++i) {
                ans_num[i] = ans1[i];
            }
        }
        return;
    }
    if (h[poz - 1] < 0 && poz + 1 < n) gener(kol, poz + 1);
    if (h[poz - 1] >= 0 || h[poz] >= 0 || h[poz + 1] >= 0) {
        h[poz] -= a;
        h[poz - 1] -= b;
        h[poz + 1] -= b;
        ans1[poz]++;
        gener(kol + 1, poz);
        ans1[poz]--;
        h[poz + 1] += b;
        h[poz - 1] += b;
        h[poz] += a;
    }
    if (h[poz - 1] < 0 && poz + 1 < n) {
        h[poz + 1] -= a;
        h[poz] -= b;
        h[poz + 2] -= b;
        ans1[poz + 1]++;
        gener(kol + 1, poz + 1);
        h[poz + 1] += a;
        h[poz] += b;
        h[poz + 2] += b;
        ans1[poz + 1]--;
    }
    return;
}

int main() {
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    cin >> n >> a >> b;
    for (int i = 1; i <= n; ++i) {
        cin >> h[i];
    }
    while (h[1] >= 0) {
        h[2] -= a;
        h[1] -= b;
        h[3] -= b;
        ans1[2]++;
    }
    ans = inf;
    h[0] = -1;
    gener(ans1[2], 2);
    cout << ans << endl;
    for (int i = 1; i <= n; ++i) {
        for (int j = 0; j < ans_num[i]; ++j) {
            cout << i << " ";
        }
    }
    return 0;
}


#include <cmath>
#include <vector>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <algorithm>

using namespace std;

const int max_n = 11, inf = 111111111;

int n, a, b, sum_h, h[max_n], ans, ans1[max_n], ans_num[max_n];

void gener(int sum, int kol, int poz) {
    if (poz == n) {
        /*if (sum < sum_h) {
            return;
        }*/
        for (int i = 1; i <= n; ++i) {
            if (h[i] >= 0) {
                return;
            }
        }
        if (kol < ans) {
            ans = kol;
            for (int i = 2; i < n; ++i) {
                ans_num[i] = ans1[i];
            }
        }
        return;
    }
    for (int i = 0; i <= 15 / b; ++i) {
        ans1[poz] = i;
        h[poz] -= i * a;
        h[poz - 1] -= i * b;
        h[poz + 1] -= i * b;
        gener(sum + i * (a + 2 * b), kol + i, poz + 1);
        h[poz] += i * a;
        h[poz - 1] += i * b;
        h[poz + 1] += i * b;
    }
    return;
}

int main() {
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    cin >> n >> a >> b;
    for (int i = 1; i <= n; ++i) {
        cin >> h[i];
        sum_h += h[i];
    }
    ans = inf;
    gener(0, 0, 2);
    cout << ans << endl;
    for (int i = 1; i <= n; ++i) {
        for (int j = 0; j < ans_num[i]; ++j) {
            cout << i << " ";
        }
    }
    return 0;
}


#include <cmath>
#include <vector>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <algorithm>

using namespace std;

const int max_n = 11, inf = 111111111;
const int br[11] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};

int n, a, b, h[max_n], ans, ans1[max_n], ans_num[max_n];

void gener(int kol, int poz) {
    /*for (int i = 1; i <= n; ++i) {
        cout << ans1[i] << ' ';
    }
    cout << endl;*/
    if (poz >= n || kol > ans || h[poz - 2] >= 0) {
        return;
    }
    int f = 0;
    for (int i = 1; i <= n; ++i) {
        if (h[i] >= 0) {
            f = 1;
            break;
        }
    }
    if (f == 0) {
        if (ans > kol) {
            ans = kol;
            for (int i = 1; i <= n; ++i) {
                ans_num[i] = ans1[i];
            }
        }
        return;
    }
    gener(kol, poz + 1);
    if (h[poz - 1] >= 0 || h[poz] >= 0 || h[poz + 1] >= 0) {
        h[poz] -= a;
        h[poz - 1] -= b;
        h[poz + 1] -= b;
        ans1[poz]++;
        gener(kol + 1, poz);
        ans1[poz]--;
        h[poz + 1] += b;
        h[poz - 1] += b;
        h[poz] += a;
    }
    if (poz + 1 < n) {
        h[poz + 1] -= a;
        h[poz] -= b;
        h[poz + 2] -= b;
        ans1[poz + 1]++;
        gener(kol + 1, poz + 1);
        h[poz + 1] += a;
        h[poz] += b;
        h[poz + 2] += b;
        ans1[poz + 1]--;
    }
    return;
}

int main() {
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    cin >> n >> a >> b;
    for (int i = 1; i <= n; ++i) {
        cin >> h[i];
    }
    ans = inf;
    h[0] = -1;
    gener(0, 2);
    cout << ans << endl;
    for (int i = 1; i <= n; ++i) {
        for (int j = 0; j < ans_num[i]; ++j) {
            cout << i << " ";
        }
    }
    return 0;
}


#include <cmath>
#include <vector>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <algorithm>

using namespace std;

const int max_n = 11, inf = 111111111;

int n, a, b, h[max_n], ans, ans_num[max_n], br[max_n];

void gener(int kol, int poz, int h[max_n], int ans1[max_n]) {
    if (poz >= n || kol > ans || h[poz - 2] >= 0) {
        return;
    }
    int f = 0;
    for (int i = 1; i <= n; ++i) {
        if (h[i] >= 0) {
            f = 1;
            break;
        }
    }
    if (f == 0) {
        if (ans > kol) {
            ans = kol;
            for (int i = 1; i <= n; ++i) {
                ans_num[i] = ans1[i];
            }
        }
        return;
    }
    if (h[poz - 1] >= 0 || h[poz] >= 0 || h[poz + 1] >= 0) {
        h[poz] -= a;
        h[poz - 1] -= b;
        h[poz + 1] -= b;
        ans1[poz]++;
        gener(kol + 1, poz, h, ans1);
        ans1[poz]--;
        h[poz + 1] += b;
        h[poz - 1] += b;
        h[poz] += a;
    }

    if (poz + 1 < n) {
        h[poz + 1] -= a;
        h[poz] -= b;
        h[poz + 2] -= b;
        ans1[poz + 1]++;
        gener(kol + 1, poz + 1, h, ans1);
    }
    return;
}

int main() {
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    cin >> n >> a >> b;
    for (int i = 1; i <= n; ++i) {
        cin >> h[i];
    }
    ans = inf;
    h[0] = -1;
    gener(0, 2, h, br);
    cout << ans << endl;
    for (int i = 1; i <= n; ++i) {
        for (int j = 0; j < ans_num[i]; ++j) {
            cout << i << " ";
        }
    }
    return 0;
}


#include<stdio.h>
#include<string.h>
#include<iostream>
#include<string>
#include<math.h>
#include<map>
#include<set>
#include<vector>
#include<queue>
#include<algorithm>
#include<stack>
using namespace std;
    int n, a, b, f[20]={0}, SUM=454345;
    vector<int> U;
    vector< int > H;
void rec(vector<int> V, int X)
{
    int URT=V.size();
    if(URT>SUM) return;
    bool T=0;
    for(int i=2;i<n;i++)
    {
        if(f[i]>=0) { T=1; break; }
    }
    if(T==0)
    {
        if(URT<SUM) { SUM=URT; H=V; }
        return;
    }
    for(int i=2;i<n;i++)
    {
        if(f[i]>=0 || f[i-1]>=0 || f[i+1]>=0)
        {
            f[i]-=a;
            f[i+1]-=b;
            f[i-1]-=b;
            V.push_back(i);
            for(int q=1;q<=n+1;q++)
            {
                if(f[q]>=0) rec(V, q);
            }
            V.erase(V.begin()+V.size()-1);
            f[i]+=a;
            f[i+1]+=b;
            f[i-1]+=b;
        }

    }
}
int main()
{

    scanf("%d %d %d", &n, &a, &b);
    f[n+1]=23;
    for(int i=1;i<=n;i++) scanf("%d", &f[i]);
    while(f[1]>=0)
    {
        f[3]-=b;
        f[2]-=a;
        f[1]-=b;
        U.push_back(2);
    }
    while(f[n]>=0)
    {
        f[n]-=b;
        f[n-1]-=a;
        f[n-2]-=b;
        U.push_back(n-1);
    }
    rec(H,2);
    printf("%d\n", H.size()+U.size());
    for(int i=0;i<U.size();i++) printf("%d ", U[i]);
    for(int i=0;i<H.size();i++) printf("%d ", H[i]);
    return 0;
}


#include<stdio.h>
#include<string.h>
#include<iostream>
#include<string>
#include<math.h>
#include<map>
#include<set>
#include<vector>
#include<queue>
#include<algorithm>
#include<stack>
using namespace std;
    int n, a, b, f[200]={0}, SUM=9999999;
    vector<int> U;
    vector< int > H;
void rec(vector<int> V, int X)
{
    if(V.size()>=SUM) return;
    bool T=0;
    for(int i=1;i<=n;i++)
    {
        if(f[i]>=0) { T=1; break; }
    }
    if(T==0)
    {
        if(V.size()<SUM) { SUM=V.size(); H=V; }
        return;
    }
    for(int i=X;i<n;i++)
    {
        if(f[i]>=0 || f[i-1]>=0 || f[i+1]>=0)
        {
            f[i]-=a;
            f[i+1]-=b;
            f[i-1]-=b;

            V.push_back(i);
            rec(V, i);

            f[i]+=a;
            f[i+1]+=b;
            f[i-1]+=b;
        }
    }
}
int main()
{

    scanf("%d %d %d", &n, &a, &b);
    for(int i=1;i<=n;i++) scanf("%d", &f[i]);
    while(f[1]>=0)
    {
        f[3]-=b;
        f[2]-=a;
        f[1]-=b;
        U.push_back(2);
    }
    while(f[n]>=0)
    {
        f[n]-=b;
        f[n-1]-=a;
        f[n-2]-=b;
        U.push_back(n-1);
    }
    rec(H, 2);
    printf("%d\n", H.size()+U.size());
    for(int i=0;i<U.size();i++) printf("%d ", U[i]);
    for(int i=0;i<H.size();i++) printf("%d ", H[i]);
    return 0;
}


#include<stdio.h>
#include<string.h>
#include<iostream>
#include<string>
#include<math.h>
#include<map>
#include<set>
#include<vector>
#include<queue>
#include<algorithm>
#include<stack>
using namespace std;
    int n, a, b, f[20]={0}, SUM=454345;
    vector<int> U;
    vector< int > H;
void rec(vector<int> V, int X)
{
    int URT=V.size();
    if(URT>=SUM) return;
    bool T=0;
    for(int i=2;i<n;i++)
    {
        if(f[i]>=0) { T=1; break; }
    }
    if(T==0)
    {
        if(URT<SUM) { SUM=URT; H=V; }
        return;
    }
    for(int i=X;i<n;i++)
    {
        if(f[i]>=0)
        {
            f[i]-=a;
            f[i+1]-=b;
            f[i-1]-=b;
            V.push_back(i);
            rec(V, i);
            V.erase(V.begin()+URT);
            f[i]+=a;
            f[i+1]+=b;
            f[i-1]+=b;
        }
    }
}
int main()
{

    scanf("%d %d %d", &n, &a, &b);
    for(int i=1;i<=n;i++) scanf("%d", &f[i]);
    while(f[1]>=0)
    {
        f[3]-=b;
        f[2]-=a;
        f[1]-=b;
        U.push_back(2);
    }
    while(f[n]>=0)
    {
        f[n]-=b;
        f[n-1]-=a;
        f[n-2]-=b;
        U.push_back(n-1);
    }
    rec(H,2);
    printf("%d\n", H.size()+U.size());
    for(int i=0;i<U.size();i++) printf("%d ", U[i]);
    for(int i=0;i<H.size();i++) printf("%d ", H[i]);
    return 0;
}


#include<stdio.h>
#include<string.h>
#include<iostream>
#include<string>
#include<math.h>
#include<map>
#include<set>
#include<vector>
#include<queue>
#include<algorithm>
#include<stack>
using namespace std;
    int n, a, b, f[200]={0}, SUM=9999999;
    vector<int> U;
    vector< int > H;
void rec(vector<int> V, int X)
{
    if(V.size()>=SUM) return;
    bool T=0;
    for(int i=1;i<=n;i++)
    {
        if(f[i]>=0) { T=1; break; }
    }
    if(T==0)
    {
        if(V.size()<SUM) { SUM=V.size(); H=V; }
        return;
    }
    for(int i=2;i<n;i++)
    {
        if(f[i]>=0 || f[i-1]>=0 || f[i+1]>=0)
        {
            f[i]-=a;
            f[i+1]-=b;
            f[i-1]-=b;

            V.push_back(i);
            rec(V, i);

            f[i]+=a;
            f[i+1]+=b;
            f[i-1]+=b;
        }
    }
}
int main()
{

    scanf("%d %d %d", &n, &a, &b);
    for(int i=1;i<=n;i++) scanf("%d", &f[i]);
    while(f[1]>=0)
    {
        f[3]-=b;
        f[2]-=a;
        f[1]-=b;
        U.push_back(2);
    }
    while(f[n]>=0)
    {
        f[n]-=b;
        f[n-1]-=a;
        f[n-2]-=b;
        U.push_back(n-1);
    }
    rec(H, 2);
    printf("%d\n", H.size()+U.size());
    for(int i=0;i<U.size();i++) printf("%d ", U[i]);
    for(int i=0;i<H.size();i++) printf("%d ", H[i]);
    return 0;
}


#include<stdio.h>
#include<string.h>
#include<iostream>
#include<string>
#include<math.h>
#include<map>
#include<set>
#include<vector>
#include<queue>
#include<algorithm>
#include<stack>
using namespace std;
    int n, a, b, f[20]={0}, SUM=4543405;
    vector< int > H;
void rec(vector<int> V, int X)
{
    if(V.size()>=SUM) return;
    bool T=0;
    for(int i=1;i<=n;i++)
    {
        if(f[i]>=0) { T=1; break; }
    }
    if(T==0)
    {
        if(V.size()<SUM) { SUM=V.size(); H=V; }
        return;
    }
    for(int i=2;i<n;i++)
    {
        if(f[i]>=0 || f[i-1]>=0 || f[i+1]>=0)
        {
            f[i]-=a;
            f[i+1]-=b;
            f[i-1]-=b;
            V.push_back(i);
            rec(V, i);
            f[i]+=a;
            f[i+1]+=b;
            f[i-1]+=b;
        }
    }
}
int main()
{

    scanf("%d %d %d", &n, &a, &b);
    for(int i=1;i<=n;i++) scanf("%d", &f[i]);
    vector<int> xa;
    rec(xa, 2);
    printf("%d\n", H.size());
    for(int i=0;i<H.size();i++) printf("%d ", H[i]);
    return 0;
}


#include<stdio.h>
#include<string.h>
#include<iostream>
#include<string>
#include<math.h>
#include<map>
#include<set>
#include<vector>
#include<queue>
#include<algorithm>
#include<stack>
using namespace std;
    int n, a, b, f[20]={0}, SUM=454345;
    vector<int> U;
    vector< int > H;
void rec(vector<int> V, int X)
{
    int URT=V.size();
    if(URT>SUM) return;
    bool T=0;
    for(int i=2;i<n;i++)
    {
        if(f[i]>=0) { T=1; break; }
    }
    if(T==0)
    {
        if(URT<SUM) { SUM=URT; H=V; }
        return;
    }
    for(int i=2;i<n;i++)
    {
        if(f[i]>=0 || f[i-1]>=0 || f[i+1]>=0)
        {
            f[i]-=a;
            f[i+1]-=b;
            f[i-1]-=b;
            V.push_back(i);
            for(int q=1;q<=n+1;q++)
            {
                if(f[q]>=0) rec(V, q);
            }
            V.pop_back();
            f[i]+=a;
            f[i+1]+=b;
            f[i-1]+=b;
        }

    }
}
int main()
{

    scanf("%d %d %d", &n, &a, &b);
    f[n+1]=23;
    for(int i=1;i<=n;i++) scanf("%d", &f[i]);
    while(f[1]>=0)
    {
        f[3]-=b;
        f[2]-=a;
        f[1]-=b;
        U.push_back(2);
    }
    while(f[n]>=0)
    {
        f[n]-=b;
        f[n-1]-=a;
        f[n-2]-=b;
        U.push_back(n-1);
    }
    rec(H,2);
    printf("%d\n", H.size()+U.size());
    for(int i=0;i<U.size();i++) printf("%d ", U[i]);
    for(int i=0;i<H.size();i++) printf("%d ", H[i]);
    return 0;
}


#include<stdio.h>
#include<string.h>
#include<iostream>
#include<string>
#include<math.h>
#include<map>
#include<set>
#include<vector>
#include<queue>
#include<algorithm>
#include<stack>
using namespace std;
    int n, a, b, f[20]={0}, SUM=454345;
    vector<int> U;
    vector< int > H;
void rec(vector<int> V, int X)
{
    int URT=V.size();
    if(URT>SUM) return;
    bool T=0;
    for(int i=2;i<n;i++)
    {
        if(f[i]>=0) { T=1; break; }
    }
    if(T==0)
    {
        if(URT<SUM) { SUM=URT; H=V; }
        return;
    }
    for(int i=2;i<n;i++)
    {
        if(f[i]>=0 || f[i-1]>=0 || f[i+1]>=0)
        {
            f[i]-=a;
            f[i+1]-=b;
            f[i-1]-=b;
            V.push_back(i);
            for(int q=1;q<=n+1;q++)
            {
                if(f[q]>=0) rec(V, q);
            }
            V.pop_back();
            f[i]+=a;
            f[i+1]+=b;
            f[i-1]+=b;
        }
    }
}
int main()
{

    scanf("%d %d %d", &n, &a, &b);
    f[n+1]=23;
    for(int i=1;i<=n;i++) scanf("%d", &f[i]);
    while(f[1]>=0)
    {
        f[3]-=b;
        f[2]-=a;
        f[1]-=b;
        U.push_back(2);
    }
    while(f[n]>=0)
    {
        f[n]-=b;
        f[n-1]-=a;
        f[n-2]-=b;
        U.push_back(n-1);
    }
    rec(H,2);
    int T=H.size(), Y=U.size();
    printf("%d\n", T+Y);
    for(int i=0;i<Y;i++) printf("%d ", U[i]);
    for(int i=0;i<T;i++) printf("%d ", H[i]);
    return 0;
}


#include<stdio.h>
#include<string.h>
#include<iostream>
#include<string>
#include<math.h>
#include<map>
#include<set>
#include<vector>
#include<queue>
#include<algorithm>
#include<stack>
using namespace std;
    int n, a, b, f[20]={0}, SUM=454345;
    vector<int> U;
    vector< int > H;
void rec(vector<int> V, int X)
{
    if(V.size()>SUM) return;
    bool T=0;
    for(int i=2;i<n;i++)
    {
        if(f[i]>=0) { T=1; break; }
    }
    if(T==0)
    {
        if(V.size()<SUM) { SUM=V.size(); H=V; }
        return;
    }
    for(int i=2;i<n;i++)
    {
        if(f[i]>=0)
        {
            f[i]-=a;
            f[i+1]-=b;
            f[i-1]-=b;
            V.push_back(i);
            rec(V, i);
            f[i]+=a;
            f[i+1]+=b;
            f[i-1]+=b;
        }

    }
}
int main()
{

    scanf("%d %d %d", &n, &a, &b);
    for(int i=1;i<=n;i++) scanf("%d", &f[i]);
    while(f[1]>=0)
    {
        f[3]-=b;
        f[2]-=a;
        f[1]-=b;
        U.push_back(2);
    }
    while(f[n]>=0)
    {
        f[n]-=b;
        f[n-1]-=a;
        f[n-2]-=b;
        U.push_back(n-1);
    }
    rec(H, 2);
    printf("%d\n", H.size()+U.size());
    for(int i=0;i<U.size();i++) printf("%d ", U[i]);
    for(int i=0;i<H.size();i++) printf("%d ", H[i]);
    return 0;
}


#include<stdio.h>
#include<string.h>
#include<iostream>
#include<string>
#include<math.h>
#include<map>
#include<set>
#include<vector>
#include<queue>
#include<algorithm>
#include<stack>
using namespace std;
    int n, a, b, f[20]={0}, SUM=454345;
    vector<int> U;
    vector< int > H;
void rec(vector<int> V, int X)
{
    int URT=V.size();
    if(URT>SUM) return;
    bool T=0;
    for(int i=2;i<n;i++)
    {
        if(f[i]>=0) { T=1; break; }
    }
    if(T==0)
    {
        if(URT<SUM) { SUM=URT; H=V; }
        return;
    }
    for(int i=2;i<n;i++)
    {
        if(f[i]>=0)
        {
            f[i]-=a;
            f[i+1]-=b;
            f[i-1]-=b;
            V.push_back(i);
            for(int q=1;q<=n;q++)
            {
                if(f[q]>=0) rec(V, q);
            }
            V.erase(V.begin()+V.size()-1);
            f[i]+=a;
            f[i+1]+=b;
            f[i-1]+=b;
        }

    }
}
int main()
{

    scanf("%d %d %d", &n, &a, &b);
    f[n+1]=23;
    for(int i=1;i<=n;i++) scanf("%d", &f[i]);
    while(f[1]>=0)
    {
        f[3]-=b;
        f[2]-=a;
        f[1]-=b;
        U.push_back(2);
    }
    while(f[n]>=0)
    {
        f[n]-=b;
        f[n-1]-=a;
        f[n-2]-=b;
        U.push_back(n-1);
    }
    rec(H,2);
    printf("%d\n", H.size()+U.size());
    for(int i=0;i<U.size();i++) printf("%d ", U[i]);
    for(int i=0;i<H.size();i++) printf("%d ", H[i]);
    return 0;
}


#include<stdio.h>
#include<string.h>
#include<iostream>
#include<string>
#include<math.h>
#include<map>
#include<set>
#include<vector>
#include<queue>
#include<algorithm>
#include<stack>
using namespace std;
    int n, a, b, f[20]={0}, SUM=454345;
    vector<int> U;
    vector< int > H;
void rec(vector<int> V, int X)
{
    int URT=V.size();
    if(URT>SUM) return;
    bool T=0;
    for(int i=2;i<n;i++)
    {
        if(f[i]>=0) { T=1; break; }
    }
    if(T==0)
    {
        if(URT<SUM) { SUM=URT; H=V; }
        return;
    }
    for(int i=X;i<n;i++)
    {
        if(f[i]>=0)
        {
            f[i]-=a;
            f[i+1]-=b;
            f[i-1]-=b;
            V.push_back(i);
            rec(V, i);
            V.erase(V.begin()+V.size()-1);
            f[i]+=a;
            f[i+1]+=b;
            f[i-1]+=b;
        }

    }
}
int main()
{

    scanf("%d %d %d", &n, &a, &b);
    for(int i=1;i<=n;i++) scanf("%d", &f[i]);
    while(f[1]>=0)
    {
        f[3]-=b;
        f[2]-=a;
        f[1]-=b;
        U.push_back(2);
    }
    while(f[n]>=0)
    {
        f[n]-=b;
        f[n-1]-=a;
        f[n-2]-=b;
        U.push_back(n-1);
    }
    rec(H, 2);
    printf("%d\n", H.size()+U.size());
    for(int i=0;i<U.size();i++) printf("%d ", U[i]);
    for(int i=0;i<H.size();i++) printf("%d ", H[i]);
    return 0;
}


#include<stdio.h>
#include<string.h>
#include<iostream>
#include<string>
#include<math.h>
#include<map>
#include<set>
#include<vector>
#include<queue>
#include<algorithm>
#include<stack>
using namespace std;
    int n, a, b, f[20]={0}, SUM=454345;
    vector<int> U;
    vector< int > H;
void rec(vector<int> V, int X)
{
    int URT=V.size();
    if(URT>=SUM) return;
    bool T=0;
    for(int i=2;i<n;i++)
    {
        if(f[i]>=0) { T=1; break; }
    }
    if(T==0)
    {
        if(URT<SUM) { SUM=URT; H=V; }
        return;
    }
    for(int i=X;i<n;i++)
    {
        if(f[i]>=0 || f[i-1]>=0 || f[i+1]>=0)
        {
            f[i]-=a;
            f[i+1]-=b;
            f[i-1]-=b;
            V.push_back(i);
            rec(V, i);
            V.erase(V.begin()+URT);
            f[i]+=a;
            f[i+1]+=b;
            f[i-1]+=b;
        }
    }
}
int main()
{

    scanf("%d %d %d", &n, &a, &b);
    for(int i=1;i<=n;i++) scanf("%d", &f[i]);
    while(f[1]>=0)
    {
        f[3]-=b;
        f[2]-=a;
        f[1]-=b;
        U.push_back(2);
    }
    while(f[n]>=0)
    {
        f[n]-=b;
        f[n-1]-=a;
        f[n-2]-=b;
        U.push_back(n-1);
    }
    rec(H,2);
    printf("%d\n", H.size()+U.size());
    for(int i=0;i<U.size();i++) printf("%d ", U[i]);
    for(int i=0;i<H.size();i++) printf("%d ", H[i]);
    return 0;
}


#include<stdio.h>
#include<string.h>
#include<iostream>
#include<string>
#include<math.h>
#include<map>
#include<set>
#include<vector>
#include<queue>
#include<algorithm>
#include<stack>
using namespace std;
    int n, a, b, f[20]={0}, SUM=454345;
    vector<int> U;
    vector< int > H;
void rec(vector<int> V)
{
    if(V.size()>SUM) return;
    bool T=0;
    for(int i=2;i<n;i++)
    {
        if(f[i]>=0) { T=1; break; }
    }
    if(T==0)
    {
        if(V.size()<SUM) { SUM=V.size(); H=V; }
        return;
    }
    for(int i=2;i<n;i++)
    {
        if(f[i]>=0)
        {
            f[i]-=a;
            f[i+1]-=b;
            f[i-1]-=b;
            V.push_back(i);
            rec(V);
            V.erase(V.begin()+V.size()-1);
            f[i]+=a;
            f[i+1]+=b;
            f[i-1]+=b;
        }

    }
}
int main()
{

    scanf("%d %d %d", &n, &a, &b);
    for(int i=1;i<=n;i++) scanf("%d", &f[i]);
    while(f[1]>=0)
    {
        f[3]-=b;
        f[2]-=a;
        f[1]-=b;
        U.push_back(2);
    }
    while(f[n]>=0)
    {
        f[n]-=b;
        f[n-1]-=a;
        f[n-2]-=b;
        U.push_back(n-1);
    }
    rec(H);
    printf("%d\n", H.size()+U.size());
    for(int i=0;i<U.size();i++) printf("%d ", U[i]);
    for(int i=0;i<H.size();i++) printf("%d ", H[i]);
    return 0;
}


#include<stdio.h>
#include<string.h>
#include<iostream>
#include<string>
#include<math.h>
#include<map>
#include<set>
#include<vector>
#include<queue>
#include<algorithm>
#include<stack>
using namespace std;
    int n, a, b, f[20]={0}, SUM=454345;
    vector<int> U;
    vector< int > H;
void rec(vector<int> V, int X)
{
    if(V.size()>SUM) return;
    bool T=0;
    for(int i=2;i<n;i++)
    {
        if(f[i]>=0) { T=1; break; }
    }
    if(T==0)
    {
        if(V.size()<SUM) { SUM=V.size(); H=V; }
        return;
    }
    for(int i=X;i<n;i++)
    {
            f[i]-=a;
            f[i+1]-=b;
            f[i-1]-=b;
            V.push_back(i);
            rec(V, i);
            f[i]+=a;
            f[i+1]+=b;
            f[i-1]+=b;

    }
}
int main()
{

    scanf("%d %d %d", &n, &a, &b);
    for(int i=1;i<=n;i++) scanf("%d", &f[i]);
    while(f[1]>=0)
    {
        f[3]-=b;
        f[2]-=a;
        f[1]-=b;
        U.push_back(2);
    }
    while(f[n]>=0)
    {
        f[n]-=b;
        f[n-1]-=a;
        f[n-2]-=b;
        U.push_back(n-1);
    }
    rec(H, 2);
    printf("%d\n", H.size()+U.size());
    for(int i=0;i<U.size();i++) printf("%d ", U[i]);
    for(int i=0;i<H.size();i++) printf("%d ", H[i]);
    return 0;
}


#include<stdio.h>
#include<string.h>
#include<iostream>
#include<string>
#include<math.h>
#include<map>
#include<set>
#include<vector>
#include<queue>
#include<algorithm>
#include<stack>
using namespace std;
    int n, a, b, f[20]={0}, SUM=4543405;
    vector< int > H;
void rec(vector<int> V, int X)
{
    if(V.size()>=SUM) return;
    bool T=0;
    for(int i=1;i<=n;i++)
    {
        if(f[i]>=0) { T=1; break; }
    }
    if(T==0)
    {
        if(V.size()<SUM) { SUM=V.size(); H=V; }
        return;
    }
    for(int i=X;i<n;i++)
    {
        if(f[i]>=0 || f[i-1]>=0 || f[i+1]>=0)
        {
            f[i]-=a;
            f[i+1]-=b;
            f[i-1]-=b;
            V.push_back(i);
            rec(V, i);
            f[i]+=a;
            f[i+1]+=b;
            f[i-1]+=b;
        }
    }
}
int main()
{
    scanf("%d %d %d", &n, &a, &b);
    for(int i=1;i<=n;i++) scanf("%d", &f[i]);
    vector<int> xa;
    rec(xa, 2);
    printf("%d\n", H.size());
    for(int i=0;i<H.size();i++) printf("%d ", H[i]);
    return 0;
}


#include<stdio.h>
#include<string.h>
#include<iostream>
#include<string>
#include<math.h>
#include<map>
#include<set>
#include<vector>
#include<queue>
#include<algorithm>
#include<stack>
using namespace std;
    int n, a, b, f[200]={0}, SUM=9999999;
    vector<int> U;
    vector< int > H;
void rec(vector<int> V, int X)
{

if(V.size()!=0)
{
    f[X]-=a;
    f[X+1]-=b;
    f[X-1]-=b;
}
    if(V.size()>=SUM) return;
    bool T=0;
    for(int i=1;i<=n;i++)
    {
        if(f[i]>=0) { T=1; break; }
    }
    if(T==0)
    {
        if(V.size()<SUM) { SUM=V.size(); H=V; }
        return;
    }
    for(int i=2;i<n;i++)
    {
        if(f[i]>=0 || f[i-1]>=0 || f[i+1]>=0)
        {
            V.push_back(i);
            rec(V, i);

            f[i]+=a;
            f[i+1]+=b;
            f[i-1]+=b;
        }
    }
}
int main()
{

    scanf("%d %d %d", &n, &a, &b);
    for(int i=1;i<=n;i++) scanf("%d", &f[i]);
    while(f[1]>=0)
    {
        f[3]-=b;
        f[2]-=a;
        f[1]-=b;
        U.push_back(2);
    }
    while(f[n]>=0)
    {
        f[n]-=b;
        f[n-1]-=a;
        f[n-2]-=b;
        U.push_back(n-1);
    }
    rec(H, 2);
    printf("%d\n", H.size()+U.size());
    for(int i=0;i<U.size();i++) printf("%d ", U[i]);
    for(int i=0;i<H.size();i++) printf("%d ", H[i]);
    return 0;
}


#include<stdio.h>
#include<string.h>
#include<iostream>
#include<string>
#include<math.h>
#include<map>
#include<set>
#include<vector>
#include<queue>
#include<algorithm>
#include<stack>
using namespace std;
    int n, a, b, f[20]={0}, SUM=454345;
    vector<int> U;
    vector< int > H;
void rec(vector<int> V, int X)
{
    int URT=V.size();
    if(URT>SUM) return;
    bool T=0;
    for(int i=2;i<n;i++)
    {
        if(f[i]>=0) { T=1; break; }
    }
    if(T==0)
    {
        if(URT<SUM) { SUM=URT; H=V; }
        return;
    }
    for(int i=X;i<n;i++)
    {
        if(f[i]>=0)
        {
            f[i]-=a;
            f[i+1]-=b;
            f[i-1]-=b;
            V.push_back(i);
            for(int q=1;q<=n+1;q++)
            {
                if(f[q]>=0) rec(V, q);
            }
            V.erase(V.begin()+V.size()-1);
            f[i]+=a;
            f[i+1]+=b;
            f[i-1]+=b;
        }

    }
}
int main()
{

    scanf("%d %d %d", &n, &a, &b);
    f[n+1]=23;
    for(int i=1;i<=n;i++) scanf("%d", &f[i]);
    while(f[1]>=0)
    {
        f[3]-=b;
        f[2]-=a;
        f[1]-=b;
        U.push_back(2);
    }
    while(f[n]>=0)
    {
        f[n]-=b;
        f[n-1]-=a;
        f[n-2]-=b;
        U.push_back(n-1);
    }
    rec(H,2);
    printf("%d\n", H.size()+U.size());
    for(int i=0;i<U.size();i++) printf("%d ", U[i]);
    for(int i=0;i<H.size();i++) printf("%d ", H[i]);
    return 0;
}


#include<stdio.h>
#include<string.h>
#include<iostream>
#include<string>
#include<math.h>
#include<map>
#include<set>
#include<vector>
#include<queue>
#include<algorithm>
#include<stack>
using namespace std;
    int n, a, b, f[20]={0}, SUM=454345;
    vector<int> U;
    vector< int > H;
void rec(vector<int> V, int X)
{
    if(V.size()>SUM) return;
    bool T=0;
    for(int i=2;i<n;i++)
    {
        if(f[i]>=0) { T=1; break; }
    }
    if(T==0)
    {
        if(V.size()<SUM) { SUM=V.size(); H=V; }
        return;
    }
    for(int i=X;i<n;i++)
    {
        if(f[i]>=0)
        {
            f[i]-=a;
            f[i+1]-=b;
            f[i-1]-=b;
            V.push_back(i);
            rec(V, i);
            f[i]+=a;
            f[i+1]+=b;
            f[i-1]+=b;
        }

    }
}
int main()
{

    scanf("%d %d %d", &n, &a, &b);
    for(int i=1;i<=n;i++) scanf("%d", &f[i]);
    while(f[1]>=0)
    {
        f[3]-=b;
        f[2]-=a;
        f[1]-=b;
        U.push_back(2);
    }
    while(f[n]>=0)
    {
        f[n]-=b;
        f[n-1]-=a;
        f[n-2]-=b;
        U.push_back(n-1);
    }
    rec(H, 2);
    printf("%d\n", H.size()+U.size());
    for(int i=0;i<U.size();i++) printf("%d ", U[i]);
    for(int i=0;i<H.size();i++) printf("%d ", H[i]);
    return 0;
}


#include<stdio.h>
#include<string.h>
#include<iostream>
#include<string>
#include<math.h>
#include<map>
#include<set>
#include<vector>
#include<queue>
#include<algorithm>
#include<stack>
using namespace std;
    int n, a, b, f[20]={0}, SUM=454345;
    vector<int> U;
    vector< int > H;
void rec(vector<int> V)
{
    int URT=V.size();
    if(URT>SUM) return;
    bool T=0;
    for(int i=2;i<n;i++)
    {
        if(f[i]>=0) { T=1; break; }
    }
    if(T==0)
    {
        if(URT<SUM) { SUM=URT; H=V; }
        return;
    }
    for(int i=2;i<n;i++)
    {
        if(f[i]>=0)
        {
            f[i]-=a;
            f[i+1]-=b;
            f[i-1]-=b;
            V.push_back(i);
            rec(V);
            V.erase(V.begin()+V.size()-1);
            f[i]+=a;
            f[i+1]+=b;
            f[i-1]+=b;
        }

    }
}
int main()
{

    scanf("%d %d %d", &n, &a, &b);
    for(int i=1;i<=n;i++) scanf("%d", &f[i]);
    while(f[1]>=0)
    {
        f[3]-=b;
        f[2]-=a;
        f[1]-=b;
        U.push_back(2);
    }
    while(f[n]>=0)
    {
        f[n]-=b;
        f[n-1]-=a;
        f[n-2]-=b;
        U.push_back(n-1);
    }
    rec(H);
    printf("%d\n", H.size()+U.size());
    for(int i=0;i<U.size();i++) printf("%d ", U[i]);
    for(int i=0;i<H.size();i++) printf("%d ", H[i]);
    return 0;
}


#include<stdio.h>
#include<string.h>
#include<iostream>
#include<string>
#include<math.h>
#include<map>
#include<set>
#include<vector>
#include<queue>
#include<algorithm>
#include<stack>
using namespace std;
    int n, a, b, f[20]={0}, SUM=454345;
    vector<int> U;
    vector< int > H;
void rec(vector<int> V, int X)
{
    int URT=V.size();
    if(URT>SUM) return;
    bool T=0;
    for(int i=2;i<n;i++)
    {
        if(f[i]>=0) { T=1; break; }
    }
    if(T==0)
    {
        if(URT<SUM) { SUM=URT; H=V; }
        return;
    }
    for(int i=2;i<n;i++)
    {
        if(f[i]>=0)
        {
            f[i]-=a;
            f[i+1]-=b;
            f[i-1]-=b;
            V.push_back(i);
            for(int q=1;q<=n+1;q++)
            {
                if(f[q]>=0) rec(V, q);
            }
            V.erase(V.begin()+V.size()-1);
            f[i]+=a;
            f[i+1]+=b;
            f[i-1]+=b;
        }

    }
}
int main()
{

    scanf("%d %d %d", &n, &a, &b);
    f[n+1]=23;
    for(int i=1;i<=n;i++) scanf("%d", &f[i]);
    while(f[1]>=0)
    {
        f[3]-=b;
        f[2]-=a;
        f[1]-=b;
        U.push_back(2);
    }
    while(f[n]>=0)
    {
        f[n]-=b;
        f[n-1]-=a;
        f[n-2]-=b;
        U.push_back(n-1);
    }
    rec(H,2);
    printf("%d\n", H.size()+U.size());
    for(int i=0;i<U.size();i++) printf("%d ", U[i]);
    for(int i=0;i<H.size();i++) printf("%d ", H[i]);
    return 0;
}


#include<stdio.h>
#include<string.h>
#include<iostream>
#include<string>
#include<math.h>
#include<map>
#include<set>
#include<vector>
#include<queue>
#include<algorithm>
#include<stack>
using namespace std;
    int n, a, b, f[20]={0}, SUM=454345;
    vector<int> U;
    vector< int > H;
void rec(vector<int> V, int X)
{
    if(V.size()>SUM) return;
    bool T=0;
    for(int i=2;i<n;i++)
    {
        if(f[i]>=0) { T=1; break; }
    }
    if(T==0)
    {
        if(V.size()<SUM) { SUM=V.size(); H=V; }
        return;
    }
    for(int i=X;i<n;i++)
    {
        if(f[i]>=0)
        {
            f[i]-=a;
            f[i+1]-=b;
            f[i-1]-=b;
            V.push_back(i);
            rec(V, i);
        }
            f[i]+=a;
            f[i+1]+=b;
            f[i-1]+=b;
    }
}
int main()
{

    scanf("%d %d %d", &n, &a, &b);
    for(int i=1;i<=n;i++) scanf("%d", &f[i]);
    while(f[1]>=0)
    {
        f[3]-=b;
        f[2]-=a;
        f[1]-=b;
        U.push_back(2);
    }
    while(f[n]>=0)
    {
        f[n]-=b;
        f[n-1]-=a;
        f[n-2]-=b;
        U.push_back(n-1);
    }
    rec(H, 2);
    printf("%d\n", H.size()+U.size());
    for(int i=0;i<U.size();i++) printf("%d ", U[i]);
    for(int i=0;i<H.size();i++) printf("%d ", H[i]);
    return 0;
}


#include<stdio.h>
#include<string.h>
#include<iostream>
#include<string>
#include<math.h>
#include<map>
#include<set>
#include<vector>
#include<queue>
#include<algorithm>
#include<stack>
using namespace std;
    int n, a, b, f[100]={0}, SUM=0;
    vector<int> U;
    vector< int > H;
void rec(vector<int> V)
{
    bool T=0;
    for(int i=2;i<n;i++)
    {
        if(f[i]>=0) { T=1; break; }
    }
    if(T==0)
    {
        if(V.size()<SUM) { SUM=V.size(); H=V; }
        return;
    }
    for(int i=2;i<n;i++)
    {
        if(f[i]>=0)
        {
            f[i]-=a;
            f[i+1]-=b;
            f[i-1]-=b;
            V.push_back(i);
            rec(V);
        }
            f[i]+=a;
            f[i+1]+=b;
            f[i-1]+=b;
    }
}
int main()
{

    scanf("%d %d %d", &n, &a, &b);
    for(int i=1;i<=n;i++) scanf("%d", &f[i]);
    while(f[1]>=0)
    {
        f[3]-=b;
        f[2]-=a;
        f[1]-=b;
        U.push_back(2);
    }
    while(f[n]>=0)
    {
        f[n]-=b;
        f[n-1]-=a;
        f[n-2]-=b;
        U.push_back(n-1);
    }
    rec(H);
    printf("%d\n", H.size()+U.size());
    for(int i=0;i<U.size();i++) printf("%d ", U[i]);
    for(int i=0;i<H.size();i++) printf("%d ", H[i]);
    return 0;
}


#include<stdio.h>
#include<string.h>
#include<iostream>
#include<string>
#include<math.h>
#include<map>
#include<set>
#include<vector>
#include<queue>
#include<algorithm>
#include<stack>
using namespace std;
    int n, a, b, f[100]={0}, SUM=0;
    vector<int> U;
    vector< int > H;
void rec(vector<int> V, int X)
{
    bool T=0;
    for(int i=2;i<n;i++)
    {
        if(f[i]>=0) { T=1; break; }
    }
    if(T==0)
    {
        if(V.size()<SUM) { SUM=V.size(); H=V; }
        return;
    }
    for(int i=X;i<n;i++)
    {
        if(f[i]>=0)
        {
            f[i]-=a;
            f[i+1]-=b;
            f[i-1]-=b;
            V.push_back(i);
            rec(V, i);
        }
            f[i]+=a;
            f[i+1]+=b;
            f[i-1]+=b;
    }
}
int main()
{

    scanf("%d %d %d", &n, &a, &b);
    for(int i=1;i<=n;i++) scanf("%d", &f[i]);
    while(f[1]>=0)
    {
        f[3]-=b;
        f[2]-=a;
        f[1]-=b;
        U.push_back(2);
    }
    while(f[n]>=0)
    {
        f[n]-=b;
        f[n-1]-=a;
        f[n-2]-=b;
        U.push_back(n-1);
    }
    rec(H, 2);
    printf("%d\n", H.size()+U.size());
    for(int i=0;i<U.size();i++) printf("%d ", U[i]);
    for(int i=0;i<H.size();i++) printf("%d ", H[i]);
    return 0;
}


#include<stdio.h>
#include<string.h>
#include<iostream>
#include<string>
#include<math.h>
#include<map>
#include<set>
#include<vector>
#include<queue>
#include<algorithm>
#include<stack>
using namespace std;
    int n, a, b, f[20]={0}, SUM=454345;
    vector<int> U;
    vector< int > H;
void rec(vector<int> V, int X)
{
    if(V.size()>SUM) return;
    bool T=0;
    for(int i=1;i<=n;i++)
    {
        if(f[i]>=0) { T=1; break; }
    }
    if(T==0)
    {
        if(V.size()<SUM) { SUM=V.size(); H=V; }
        return;
    }
    for(int i=X;i<n;i++)
    {
        if(f[i]>=0 || f[i-1]>=0 || f[i+1]>=0)
        {
            f[i]-=a;
            f[i+1]-=b;
            f[i-1]-=b;
            V.push_back(i);
            rec(V, i);
            f[i]+=a;
            f[i+1]+=b;
            f[i-1]+=b;
        }
    }
}
int main()
{

    scanf("%d %d %d", &n, &a, &b);
    for(int i=1;i<=n;i++) scanf("%d", &f[i]);
    while(f[1]>=0)
    {
        f[3]-=b;
        f[2]-=a;
        f[1]-=b;
        U.push_back(2);
    }
    while(f[n]>=0)
    {
        f[n]-=b;
        f[n-1]-=a;
        f[n-2]-=b;
        U.push_back(n-1);
    }
    rec(H, 2);
    printf("%d\n", H.size()+U.size());
    for(int i=0;i<U.size();i++) printf("%d ", U[i]);
    for(int i=0;i<H.size();i++) printf("%d ", H[i]);
    return 0;
}


#include<stdio.h>
#include<string.h>
#include<iostream>
#include<string>
#include<math.h>
#include<map>
#include<set>
#include<vector>
#include<queue>
#include<algorithm>
#include<stack>
using namespace std;
    int n, a, b, f[20]={0}, SUM=454345;
    vector<int> U;
    vector< int > H;
void rec(vector<int> V, int X)
{
    int URT=V.size();
    if(URT>=SUM) return;
    bool T=0;
    for(int i=2;i<n;i++)
    {
        if(f[i]>=0) { T=1; break; }
    }
    if(T==0)
    {
        if(URT<SUM) { SUM=URT; H=V; }
        return;
    }
    for(int i=X;i<n;i++)
    {
        if(f[i]>=0 || f[i-1]>=0 || f[i+1]>=0)
        {
            f[i]-=a;
            f[i+1]-=b;
            f[i-1]-=b;
            V.push_back(i);
            rec(V, i);
            V.pop_back();
            f[i]+=a;
            f[i+1]+=b;
            f[i-1]+=b;
        }
    }
}
int main()
{

    scanf("%d %d %d", &n, &a, &b);
    for(int i=1;i<=n;i++) scanf("%d", &f[i]);
    while(f[1]>=0)
    {
        f[3]-=b;
        f[2]-=a;
        f[1]-=b;
        U.push_back(2);
    }
    while(f[n]>=0)
    {
        f[n]-=b;
        f[n-1]-=a;
        f[n-2]-=b;
        U.push_back(n-1);
    }
    rec(H,2);
    printf("%d\n", H.size()+U.size());
    for(int i=0;i<U.size();i++) printf("%d ", U[i]);
    for(int i=0;i<H.size();i++) printf("%d ", H[i]);
    return 0;
}


#include<stdio.h>
#include<string.h>
#include<iostream>
#include<string>
#include<math.h>
#include<map>
#include<set>
#include<vector>
#include<queue>
#include<algorithm>
#include<stack>
using namespace std;
    int n, a, b, f[20]={0}, SUM=454345;

    vector<int> U;
    vector< int > H;
void rec(vector<int> V, int X)
{
    int URT=V.size();
    if(URT>=SUM) return;
    bool T=0;
    for(int i=2;i<n;i++)
    {
        if(f[i]>=0) { T=1; break; }
    }
    if(T==0)
    {
        if(URT<SUM) { SUM=URT; H=V; }
        return;
    }
    for(int i=X;i<n;i++)
    {
        if(f[i]>=0 || f[i-1]>=0 || f[i+1]>=0)
        {
            f[i]-=a;
            f[i+1]-=b;
            f[i-1]-=b;
            V.push_back(i);
            rec(V, i);
            V.erase(V.begin()+URT);
            f[i]+=a;
            f[i+1]+=b;
            f[i-1]+=b;
        }
    }
}
int main()
{
SUM++;
    scanf("%d %d %d", &n, &a, &b);
    for(int i=1;i<=n;i++) scanf("%d", &f[i]);
    while(f[1]>=0)
    {
        f[3]-=b;
        f[2]-=a;
        f[1]-=b;
        U.push_back(2);
    }
    while(f[n]>=0)
    {
        f[n]-=b;
        f[n-1]-=a;
        f[n-2]-=b;
        U.push_back(n-1);
    }
    rec(H,2);
    printf("%d\n", H.size()+U.size());
    for(int i=0;i<U.size();i++) printf("%d ", U[i]);
    for(int i=0;i<H.size();i++) printf("%d ", H[i]);
    return 0;
}


#include<stdio.h>
#include<string.h>
#include<iostream>
#include<string>
#include<math.h>
#include<map>
#include<set>
#include<vector>
#include<queue>
#include<algorithm>
#include<stack>
using namespace std;
    int n, a, b, f[20]={0}, SUM=454345;
    vector<int> U;
    vector< int > H;
void rec(vector<int> V, int X)
{
    if(V.size()>sum) return;
    bool T=0;
    for(int i=2;i<n;i++)
    {
        if(f[i]>=0) { T=1; break; }
    }
    if(T==0)
    {
        if(V.size()<SUM) { SUM=V.size(); H=V; }
        return;
    }
    for(int i=X;i<n;i++)
    {
        if(f[i]>=0)
        {
            f[i]-=a;
            f[i+1]-=b;
            f[i-1]-=b;
            V.push_back(i);
            rec(V, i);
        }
            f[i]+=a;
            f[i+1]+=b;
            f[i-1]+=b;
    }
}
int main()
{

    scanf("%d %d %d", &n, &a, &b);
    for(int i=1;i<=n;i++) scanf("%d", &f[i]);
    while(f[1]>=0)
    {
        f[3]-=b;
        f[2]-=a;
        f[1]-=b;
        U.push_back(2);
    }
    while(f[n]>=0)
    {
        f[n]-=b;
        f[n-1]-=a;
        f[n-2]-=b;
        U.push_back(n-1);
    }
    rec(H, 2);
    printf("%d\n", H.size()+U.size());
    for(int i=0;i<U.size();i++) printf("%d ", U[i]);
    for(int i=0;i<H.size();i++) printf("%d ", H[i]);
    return 0;
}


#include<stdio.h>
#include<string.h>
#include<iostream>
#include<string>
#include<math.h>
#include<map>
#include<set>
#include<vector>
#include<queue>
#include<algorithm>
#include<stack>
using namespace std;
    int n, a, b, f[20]={0}, SUM=454340905;
    vector<int> U;
    vector< int > H;
void rec(vector<int> V, int X)
{
    if(V.size()>SUM) return;
    bool T=0;
    for(int i=1;i<=n;i++)
    {
        if(f[i]>=0) { T=1; break; }
    }
    if(T==0)
    {
        if(V.size()<SUM) { SUM=V.size(); H=V; }
        return;
    }
    for(int i=X;i<n;i++)
    {
        if(f[i]>=0 || f[i-1]>=0 || f[i+1]>=0)
        {
            f[i]-=a;
            f[i+1]-=b;
            f[i-1]-=b;
            V.push_back(i);
            rec(V, i);
            f[i]+=a;
            f[i+1]+=b;
            f[i-1]+=b;
        }
    }
}
int main()
{

    scanf("%d %d %d", &n, &a, &b);
    for(int i=1;i<=n;i++) scanf("%d", &f[i]);
    rec(H, 2);
    printf("%d\n", H.size());
    for(int i=0;i<H.size();i++) printf("%d ", H[i]);
    return 0;
}


#include<stdio.h>
#include<string.h>
#include<iostream>
#include<string>
#include<math.h>
#include<map>
#include<set>
#include<vector>
#include<queue>
#include<algorithm>
#include<stack>
using namespace std;
    int n, a, b, f[200]={0}, SUM=9999999;
    vector<int> U;
    vector< int > H;
void rec(vector<int> V, int X)
{

if(V.size()!=0)
{
    f[X]-=a;
    f[X+1]-=b;
    f[X-1]-=b;
}
    if(V.size()>=SUM) return;
    bool T=0;
    for(int i=1;i<=n;i++)
    {
        if(f[i]>=0) { T=1; break; }
    }
    if(T==0)
    {
        if(V.size()<SUM) { SUM=V.size(); H=V; }
        return;
    }
    for(int i=X;i<n;i++)
    {
        if(f[i]>=0 || f[i-1]>=0 || f[i+1]>=0)
        {
            V.push_back(i);
            rec(V, i);

            f[i]+=a;
            f[i+1]+=b;
            f[i-1]+=b;
        }
    }
}
int main()
{

    scanf("%d %d %d", &n, &a, &b);
    for(int i=1;i<=n;i++) scanf("%d", &f[i]);
    while(f[1]>=0)
    {
        f[3]-=b;
        f[2]-=a;
        f[1]-=b;
        U.push_back(2);
    }
    while(f[n]>=0)
    {
        f[n]-=b;
        f[n-1]-=a;
        f[n-2]-=b;
        U.push_back(n-1);
    }
    rec(H, 2);
    printf("%d\n", H.size()+U.size());
    for(int i=0;i<U.size();i++) printf("%d ", U[i]);
    for(int i=0;i<H.size();i++) printf("%d ", H[i]);
    return 0;
}


#include <cstring>
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cmath>
#include <algorithm>
#include <string>
using namespace std;
const int INF=0x3f3f3f3f;
int a[20],cnt[20],b[20],p,q,n,ans,pre1,pre2;
void dfs(int pos,int cnt[],int total)
{
    int t=a[pos]-q*cnt[pos-1];
    if (pos==n-1)
    {
        if (a[n-1]>=0) total+=t/q+1;
        if (total<ans)
        {
            ans=total;
            for (int i=1;i<=n;i++) b[i]=cnt[i];
        }
        return ;
    }
    if (t<0) dfs(pos+1,cnt,total);
    for (int i=0;i<=t/q+1;i++)
    {
        if (a[pos-1]-cnt[pos-1]*p-cnt[pos-2]*q-i*q<0)
        {
            cnt[pos]=i;
            dfs(pos+1,cnt,total+i);
        }
    }
}
int main()
{
    while (scanf("%d%d%d",&n,&p,&q)==3)
    {
        for (int i=1;i<=n;i++) scanf("%d",&a[i]);
        pre1=pre2=0;
        if (a[1]>=0)
        {
            pre1=a[1]/q+1;
            a[1]-=pre1*q;
            a[2]-=pre1*p;
            a[3]-=pre1*q;
        }
        if (a[n]>=0)
        {
            pre2=a[n]/q+1;
            a[n]-=pre2*q;
            a[n-1]-=pre2*p;
            a[n-2]-=pre2*q;
        }
        ans=INF;
        memset(cnt,0,sizeof(cnt));
        dfs(2,cnt,pre1+pre2);
        printf("%d\n",ans);
        b[2]+=pre1;
        b[n-1]+=pre2;
        bool first=false;
        for (int i=2;i<=n-1;i++)
        {
            for (int j=1;j<=b[i];j++)
            {
                if (!first) {printf("%d",i);first=true;}
                else printf(" %d",i);
            }
        }
        printf("\n");
    }
    return 0;
}


#include <cstring>
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cmath>
#include <algorithm>
#include <string>
using namespace std;
const int INF=0x3f3f3f3f;
int a[20],cnt[20],b[20],p,q,n,ans,pre1,pre2;
void dfs(int pos,int cnt[],int total)
{
    int t=a[pos]-q*cnt[pos-1];
    if (pos==n-1)
    {
        if (t>=0) cnt[pos]=t/p+1;
        if (a[pos-1]-cnt[pos-1]*p-cnt[pos-2]*q-cnt[pos]*q>=0)
            cnt[pos]+=(a[pos-1]-cnt[pos-1]*p-cnt[pos-2]*q-cnt[pos]*q)/q+1;
        total+=cnt[pos];
        if (total<ans)
        {
            ans=total;
            for (int i=1;i<=n;i++) b[i]=cnt[i];
        }
        cnt[pos]=0;
        return ;
    }
    int ed=max(t/p+1,max(a[pos-1]/q+1,a[pos+1]/q+1));
    for (int i=0;i<=ed;i++)
    {
        if (a[pos-1]-cnt[pos-1]*p-cnt[pos-2]*q-i*q<0)
        {
            cnt[pos]=i;
            dfs(pos+1,cnt,total+i);
            cnt[pos]=0;
        }
    }
}
int main()
{
    while (scanf("%d%d%d",&n,&p,&q)==3)
    {
        for (int i=1;i<=n;i++) scanf("%d",&a[i]);
        pre1=pre2=0;
        if (a[1]>=0)
        {
            pre1=a[1]/q+1;
            a[1]-=pre1*q;
            a[2]-=pre1*p;
            a[3]-=pre1*q;
        }
        if (a[n]>=0)
        {
            pre2=a[n]/q+1;
            a[n]-=pre2*q;
            a[n-1]-=pre2*p;
            a[n-2]-=pre2*q;
        }
        ans=INF;
        memset(cnt,0,sizeof(cnt));
        dfs(2,cnt,pre1+pre2);
        printf("%d\n",ans);
        b[2]+=pre1;
        b[n-1]+=pre2;
        bool first=false;
        for (int i=2;i<=n-1;i++)
        {
            for (int j=1;j<=b[i];j++)
            {
                if (!first) {printf("%d",i);first=true;}
                else printf(" %d",i);
            }
        }
        printf("\n");
    }
    return 0;
}


#include <cstring>
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cmath>
#include <algorithm>
#include <string>
using namespace std;
const int INF=0x3f3f3f3f;
int a[20],cnt[20],b[20],p,q,n,ans,pre1,pre2;
void dfs(int pos,int cnt[],int total)
{
    int t=a[pos]-q*cnt[pos-1];
    if (pos==n-1)
    {
        if (t>=0) total+=t/p+1;
        if (total<ans)
        {
            ans=total;
            for (int i=1;i<=n;i++) b[i]=cnt[i];
        }
        return ;
    }
    if (t<0) dfs(pos+1,cnt,total);
    for (int i=0;i<=max(t,0)/p+1;i++)
    {
        if (a[pos-1]-cnt[pos-1]*p-cnt[pos-2]*q-i*q<0)
        {
            cnt[pos]=i;
            dfs(pos+1,cnt,total+i);
            cnt[pos]=0;
        }
    }
}
int main()
{
    while (scanf("%d%d%d",&n,&p,&q)==3)
    {
        for (int i=1;i<=n;i++) scanf("%d",&a[i]);
        pre1=pre2=0;
        if (a[1]>=0)
        {
            pre1=a[1]/q+1;
            a[1]-=pre1*q;
            a[2]-=pre1*p;
            a[3]-=pre1*q;
        }
        if (a[n]>=0)
        {
            pre2=a[n]/q+1;
            a[n]-=pre2*q;
            a[n-1]-=pre2*p;
            a[n-2]-=pre2*q;
        }
        ans=INF;
        memset(cnt,0,sizeof(cnt));
        dfs(2,cnt,pre1+pre2);
        printf("%d\n",ans);
        b[2]+=pre1;
        b[n-1]+=pre2;
        bool first=false;
        for (int i=2;i<=n-1;i++)
        {
            for (int j=1;j<=b[i];j++)
            {
                if (!first) {printf("%d",i);first=true;}
                else printf(" %d",i);
            }
        }
        printf("\n");
    }
    return 0;
}


#include <cstring>
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cmath>
#include <algorithm>
#include <string>
using namespace std;
const int INF=0x3f3f3f3f;
int a[20],cnt[20],b[20],p,q,n,ans,pre1,pre2;
void dfs(int pos,int cnt[],int total)
{
    int t=a[pos]-q*cnt[pos-1];
    if (pos==n-1)
    {
        if (t>=0) cnt[pos]=t/p+1;
        if (a[pos-1]-cnt[pos-1]*p-cnt[pos-2]*q-cnt[pos]*q>=0)
            cnt[pos]+=(a[pos-1]-cnt[pos-1]*p-cnt[pos-2]*q-cnt[pos]*q)/q+1;
        total+=cnt[pos];
        if (total<ans)
        {
            ans=total;
            for (int i=1;i<=n;i++) b[i]=cnt[i];
        }
        cnt[pos]=0;
        return ;
    }
    for (int i=0;i<=max(t,0)/p+1;i++)
    {
        if (a[pos-1]-cnt[pos-1]*p-cnt[pos-2]*q-i*q<0)
        {
            cnt[pos]=i;
            dfs(pos+1,cnt,total+i);
            cnt[pos]=0;
        }
    }
}
int main()
{
    while (scanf("%d%d%d",&n,&p,&q)==3)
    {
        for (int i=1;i<=n;i++) scanf("%d",&a[i]);
        pre1=pre2=0;
        if (a[1]>=0)
        {
            pre1=a[1]/q+1;
            a[1]-=pre1*q;
            a[2]-=pre1*p;
            a[3]-=pre1*q;
        }
        if (a[n]>=0)
        {
            pre2=a[n]/q+1;
            a[n]-=pre2*q;
            a[n-1]-=pre2*p;
            a[n-2]-=pre2*q;
        }
        ans=INF;
        memset(cnt,0,sizeof(cnt));
        dfs(2,cnt,pre1+pre2);
        printf("%d\n",ans);
        b[2]+=pre1;
        b[n-1]+=pre2;
        bool first=false;
        for (int i=2;i<=n-1;i++)
        {
            for (int j=1;j<=b[i];j++)
            {
                if (!first) {printf("%d",i);first=true;}
                else printf(" %d",i);
            }
        }
        printf("\n");
    }
    return 0;
}


#include <cstring>
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cmath>
#include <algorithm>
#include <string>
using namespace std;
const int INF=0x3f3f3f3f;
int a[20],cnt[20],b[20],p,q,n,ans,pre1,pre2;
void dfs(int pos,int cnt[],int total)
{
    int t=a[pos]-q*cnt[pos-1];
    if (pos==n-1)
    {
        if (a[n-1]>=0) total+=t/q+1;
        if (total<ans)
        {
            ans=total;
            for (int i=1;i<=n;i++) b[i]=cnt[i];
        }
        return ;
    }
    for (int i=0;i<=max(t,0)/q+1;i++)
    {
        cnt[pos]=i;
        dfs(pos+1,cnt,total+i);
    }
}
int main()
{
    while (scanf("%d%d%d",&n,&p,&q)==3)
    {
        for (int i=1;i<=n;i++) scanf("%d",&a[i]);
        pre1=pre2=0;
        if (a[1]>=0)
        {
            pre1=a[1]/q+1;
            a[1]-=pre1*q;
            a[2]-=pre1*p;
            a[3]-=pre1*q;
        }
        if (a[n]>=0)
        {
            pre2=a[n]/q+1;
            a[n]-=pre2*q;
            a[n-1]-=pre2*p;
            a[n-2]-=pre2*q;
        }
        ans=INF;
        memset(cnt,0,sizeof(cnt));
        dfs(2,cnt,pre1+pre2);
        printf("%d\n",ans);
        b[2]+=pre1;
        b[n-1]+=pre2;
        bool first=false;
        for (int i=2;i<=n-1;i++)
        {
            for (int j=1;j<=b[i];j++)
            {
                if (!first) {printf("%d",i);first=true;}
                else printf(" %d",i);
            }
        }
        printf("\n");
    }
    return 0;
}


#include <cstring>
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cmath>
#include <algorithm>
#include <string>
using namespace std;
const int INF=0x3f3f3f3f;
int a[20],cnt[20],b[20],p,q,n,ans,pre1,pre2;
void dfs(int pos,int cnt[],int total)
{
    int t=a[pos]-q*cnt[pos-1];
    if (pos==n-1)
    {
        if (t>=0) cnt[pos]=t/p+1;
        if (a[pos-1]-cnt[pos-1]*p-cnt[pos-2]*q-cnt[pos]*q>=0)
            cnt[pos]+=(a[pos-1]-cnt[pos-1]*p-cnt[pos-2]*q-cnt[pos]*q)/q+1;
        total+=cnt[pos];
        if (total<ans)
        {
            ans=total;
            for (int i=1;i<=n;i++) b[i]=cnt[i];
        }
        return ;
    }
    for (int i=0;i<=max(t,0)/p+1;i++)
    {
        if (a[pos-1]-cnt[pos-1]*p-cnt[pos-2]*q-i*q<0)
        {
            cnt[pos]=i;
            dfs(pos+1,cnt,total+i);
            cnt[pos]=0;
        }
    }
}
int main()
{
    while (scanf("%d%d%d",&n,&p,&q)==3)
    {
        for (int i=1;i<=n;i++) scanf("%d",&a[i]);
        pre1=pre2=0;
        if (a[1]>=0)
        {
            pre1=a[1]/q+1;
            a[1]-=pre1*q;
            a[2]-=pre1*p;
            a[3]-=pre1*q;
        }
        if (a[n]>=0)
        {
            pre2=a[n]/q+1;
            a[n]-=pre2*q;
            a[n-1]-=pre2*p;
            a[n-2]-=pre2*q;
        }
        ans=INF;
        memset(cnt,0,sizeof(cnt));
        dfs(2,cnt,pre1+pre2);
        printf("%d\n",ans);
        b[2]+=pre1;
        b[n-1]+=pre2;
        bool first=false;
        for (int i=2;i<=n-1;i++)
        {
            for (int j=1;j<=b[i];j++)
            {
                if (!first) {printf("%d",i);first=true;}
                else printf(" %d",i);
            }
        }
        printf("\n");
    }
    return 0;
}


#include <cstring>
#include <cstdio>
#include <string>
#include <iostream>
#include <algorithm>
#include <cstdlib>
#include <cmath>
using namespace std;
int n,a,b,total,maxx,p;
int cnt[15],num[15];
int main()
{
    while (scanf("%d%d%d",&n,&a,&b)==3)
    {
        for (int i=1;i<=n;i++) scanf("%d",&cnt[i]);
        total=0;
        bool flag=true;
        for (int i=2;i<n;i++) if (cnt[i]>=0) {flag=false;break;}
        while (!flag)
        {
            maxx=-1;p=-1;
            for (int i=2;i<n;i++)
                if (cnt[i]>maxx) maxx=cnt[i],p=i;
            num[++total]=p;
            cnt[p]-=a;
            cnt[p-1]-=b;
            cnt[p+1]-=b;
            flag=true;
            for (int i=2;i<n;i++) if (cnt[i]>=0) {flag=false;break;}
        }
        while (cnt[1]>=0) {num[++total]=2;cnt[1]-=b;cnt[3]-=b;}
        while (cnt[n]>=0) {num[++total]=n-1;cnt[n]-=b;cnt[n-2]-=b;}
        cout<<total<<endl;
        for (int i=1;i<total;i++) cout<<num[i]<<" ";
        cout<<num[total]<<endl;
    }
    return 0;
}


#include <cstring>
#include <cstdio>
#include <string>
#include <iostream>
#include <algorithm>
#include <cstdlib>
#include <cmath>
using namespace std;
int n,a,b,total,maxx,p;
int cnt[15],num[150];
int main()
{
    while (scanf("%d%d%d",&n,&a,&b)==3)
    {
        for (int i=1;i<=n;i++) scanf("%d",&cnt[i]);
        total=0;
        bool flag=true;
        for (int i=2;i<n;i++) if (cnt[i]>=0) {flag=false;break;}
        while (!flag)
        {
            maxx=-1;p=-1;
            for (int i=2;i<n;i++)
                if (cnt[i]>maxx) maxx=cnt[i],p=i;
            num[++total]=p;
            cnt[p]-=a;
            cnt[p-1]-=b;
            cnt[p+1]-=b;
            flag=true;
            for (int i=2;i<n;i++) if (cnt[i]>=0) {flag=false;break;}
        }
        while (cnt[1]>=0) {num[++total]=2;cnt[1]-=b;cnt[3]-=b;}
        while (cnt[n]>=0) {num[++total]=n-1;cnt[n]-=b;cnt[n-2]-=b;}
        cout<<total<<endl;
        for (int i=1;i<total;i++) cout<<num[i]<<" ";
        cout<<num[total]<<endl;
    }
    return 0;
}


#include <iostream>

using namespace std;
int ini,n,m,h[300],a,b,cont,mini,i,s[1000005],sol[1000005];
bool bol;
void kill(int aa){
    //cout<<aa<<endl;
    if (aa<n){
        int t1=max((h[aa-1]+1+b -1)/b,0);
        int t2=max((h[aa]+1+a-1)/a,0);
        for (int x=t1;x<=max(t1,t2);x++){
          //  cout<<aa<<" mata "<<x<<endl;
            h[aa]-=a*x;
            h[aa+1]-=b*x;
            cont+=x;
            s[aa]=x;
            kill(aa+1);
            s[aa]=0;
            cont-=x;
            h[aa]+=a*x;
            h[aa+1]+=b*x;
        }
    }
    else{
        cont=cont+max(max((h[n]+b)/b,0),(h[n-1]+a)/a);
        if (cont<mini){
            mini=cont;
            for (int i=2;i<n;i++)
                sol[i]=s[i];
            sol[n-1]+=max(max((h[n]+b)/b,0),(h[n-1]+a)/a);
        }

        //cout<<"Conta: "<<cont<<endl;
    }
    return;
}
int main()
{
    cin>>n>>a>>b;
    for (i=1;i<=n;i++){
        cin>>h[i];
    }
    cont=0;
    mini=20000000;
    kill(2);
    cout<<mini<<endl;
    bol=true;
    i=2;
    while (i<n){
        if (sol[i]>0){
            if (!bol)
                cout<<" ";
            else
                bol=false;
            cout<<i;
            sol[i]--;
        }
        else{
            i++;
        }
    }
    cout<<endl;
    return 0;
}


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

class segment_tree {
  private:
    struct node {
      int i, j;
      long long val;
      node *left, *right;
      long long lazy;
    } *root;

    node *build(int i, int j) {
      if (i == j) {
        return new node{i, j, 0, nullptr, nullptr, 0};
      }
      node *left = build(i, (i + j) / 2);
      node *right = build((i + j) / 2 + 1, j);
      return new node{i, j, left->val + right->val, left, right, 0};
    }

    void propagate(node *cur) {
      if (cur->lazy != 0) {
        cur->val = cur->j - cur->i + 1;
        if (cur->left != nullptr) {
          cur->left->lazy = cur->lazy;
          cur->right->lazy = cur->lazy;
        }
        cur->lazy = 0;
      }
    }

    int query(node *cur, int i, int j) {
      propagate(cur);
      if (cur->i > j || cur->j < i) {
        return 0;
      }
      if (cur->i >= i && cur->j <= j) {
        return cur->val;
      }
      return query(cur->left, i, j) + query(cur->right, i, j);
    }

    void update(node *cur, int i, int j) {
      propagate(cur);
      if (cur->i > j || cur-> j < i) {
        return;
      }
      if (cur->i >= i && cur-> j <= j) {
        cur->lazy = 1;
        propagate(cur);
        return;
      }
      update(cur->left, i, j);
      update(cur->right, i, j);
      cur->val = cur->left->val + cur->right->val;
    }
  public:
    segment_tree(int n) {
      root = build(0, n - 1);
    }

    int query(int i, int j) {
      return query(root, i, j);
    }

    void update(int i, int j) {
      update(root, i, j);
    }
};

int solve(const vector<int>& sa, const vector<int>& ea, const vector<int>& sb, const vector<int>& eb) {
  int n = (int) sa.size();
  vector<int> v1(n), v2(n);
  iota(v1.begin(), v1.end(), 0);
  iota(v2.begin(), v2.end(), 0);
  sort(v1.begin(), v1.end(), [&](const int& a, const int& b) {
    return sa[a] < sa[b];
  });
  sort(v2.begin(), v2.end(), [&](const int& a, const int& b) {
    return ea[a] < ea[b];
  });
  segment_tree st(5 * n);
  for (int i = 0, j = 0; i < n; i++) {
    int idx = v1[i];
    while (j < n && ea[j] < sa[idx]) {
      st.update(sb[j], eb[j]);
      j++;
    }
    if (st.query(sb[idx], eb[idx]) > 0) {
      return 0;
    }
  }
  st = segment_tree(5 * n);
  iota(v1.begin(), v1.end(), 0);
  iota(v2.begin(), v2.end(), 0);
  sort(v1.rbegin(), v1.rend(), [&](const int& a, const int& b) {
    return ea[a] < ea[b];
  });
  sort(v2.rbegin(), v2.rend(), [&](const int& a, const int& b) {
    return sa[a] < sa[b];
  });
  for (int i = 0, j = 0; i < n; i++) {
    int idx = v1[i];
    while (j < n && sa[j] > ea[idx]) {
      st.update(sb[j], eb[j]);
      j++;
    }
    if (st.query(sb[idx], eb[idx]) > 0) {
      return 0;
    }
  }
  return 1;
}

void compress(vector< vector<int> >& a) {
  set<int> st;
  for (auto& v : a) {
    for (auto& x : v) {
      st.insert(x);
    }
  }
  int i = 0;
  map<int, int> mp;
  for (auto& x : st) {
    mp[x] = i++;
  }
  for (auto& v : a) {
    for (auto& x : v) {
      x = mp[x];
    }
  }
}

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  vector<int> sa(n), ea(n), sb(n), eb(n);
  for (int i = 0; i < n; i++) {
    cin >> sa[i] >> ea[i] >> sb[i] >> eb[i];
  }
  vector< vector<int> > tmp = {sa, ea, sb, eb};
  compress(tmp);
  sa = tmp[0], ea = tmp[1], sb = tmp[2], eb = tmp[3];
  if (solve(sa, ea, sb, eb) && solve(sb, eb, sa, ea)) {
    cout << "YES\n";
  } else {
    cout << "NO\n";
  }
  return 0;
}


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

class segment_tree {
  private:
    struct node {
      int i, j;
      long long val;
      node *left, *right;
      long long lazy;
    } *root;

    node *build(int i, int j, const vector<int>& a) {
      if (i == j) {
        return new node{i, j, a[i], nullptr, nullptr, 0};
      }
      node *left = build(i, (i + j) / 2, a);
      node *right = build((i + j) / 2 + 1, j, a);
      return new node{i, j, left->val + right->val, left, right, 0};
    }

    void propagate(node *cur) {
      if (cur->lazy != 0) {
        cur->val += (cur->j - cur->j + 1) * cur->lazy;
        if (cur->left != nullptr) {
          cur->left->lazy += cur->lazy;
          cur->right->lazy += cur->lazy;
        }
        cur->lazy = 0;
      }
    }

    int query(node *cur, int i, int j) {
      propagate(cur);
      if (cur->i > j || cur->j < i) {
        return 0;
      }
      if (cur->i >= i && cur->j <= j) {
        return cur->val;
      }
      return query(cur->left, i, j) + query(cur->right, i, j);
    }

    void update(node *cur, int i, int j, long long val) {
      propagate(cur);
      if (cur->i > j || cur-> j < i) {
        return;
      }
      if (cur->i >= i && cur-> j <= j) {
        cur->lazy += val;
        propagate(cur);
        return;
      }
      update(cur->left, i, j, val);
      update(cur->right, i, j, val);
      cur->val = cur->left->val + cur->right->val;
    }
  public:
    segment_tree(const vector<int>& a) {
      root = build(0, (int) a.size() - 1, a);
    }

    int query(int i, int j) {
      return query(root, i, j);
    }

    void update(int i, int j, long long val) {
      update(root, i, j, val);
    }
};

int solve(const vector<int>& sa, const vector<int>& ea, const vector<int>& sb, const vector<int>& eb) {
  int n = (int) sa.size();
  vector<int> v1(n), v2(n);
  iota(v1.begin(), v1.end(), 0);
  iota(v2.begin(), v2.end(), 0);
  sort(v1.begin(), v1.end(), [&](const int& a, const int& b) {
    return sa[a] < sa[b];
  });
  sort(v2.begin(), v2.end(), [&](const int& a, const int& b) {
    return ea[a] < ea[b];
  });
  segment_tree st(vector<int>(5 * n, 0));
  for (int i = 0, j = 0; i < n; i++) {
    int idx = v1[i];
    while (j < n && ea[j] < sa[idx]) {
      st.update(sb[j], eb[j], +1);
      j++;
    }
    if (st.query(sb[i], eb[i]) > 0) {
      return 0;
    }
  }
  st = segment_tree(vector<int>(5 * n, 0));
  iota(v1.begin(), v1.end(), 0);
  iota(v2.begin(), v2.end(), 0);
  sort(v1.rbegin(), v1.rend(), [&](const int& a, const int& b) {
    return ea[a] < ea[b];
  });
  sort(v2.rbegin(), v2.rend(), [&](const int& a, const int& b) {
    return sa[a] < sa[b];
  });
  for (int i = 0, j = 0; i < n; i++) {
    int idx = v1[i];
    while (j < n && sa[j] > ea[idx]) {
      st.update(sb[j], eb[j], +1);
      j++;
    }
    if (st.query(sb[i], eb[i]) > 0) {
      return 0;
    }
  }
  return 1;
}

void compress(vector<int>& sa, vector<int>& ea) {
  set<int> st;
  for (auto& x : sa) {
    st.insert(x);
  }
  for (auto& x : ea) {
    st.insert(x);
  }
  map<int, int> mp;
  int i = 0;
  for (auto& x : st) {
    mp[x] = i++;
  }
  for (auto& x : sa) {
    x = mp[x];
  }
  for (auto& x : ea) {
    x = mp[x];
  }
}

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  vector<int> sa(n), ea(n), sb(n), eb(n);
  for (int i = 0; i < n; i++) {
    cin >> sa[i] >> ea[i] >> sb[i] >> eb[i];
  }
  compress(sa, ea);
  compress(sb, eb);
  if (solve(sa, ea, sb, eb) && solve(sb, eb, sa, ea)) {
    cout << "YES\n";
  } else {
    cout << "NO\n";
  }
  return 0;
}