#include<bits/stdc++.h>

using namespace std;

#define LL long long
#define mod 1000000007
#define N 100005

int fm,ft;
vector<int> fs;

void go(int m, int n, int a, int b, int h[], vector<int> s)
{
    if(m==fm)
    {
        if(s.size()<ft)
        {
            ft = s.size();
            fs = s;
        }
        return;
    }

    int hh[n];
    for(int i=0;i<n;i++)
        hh[i]=h[i];
    for(int i=1;i<n-1;i++)
    {
        if(!(m&(1<<i)))
        {
            int x,tm = m;
            if(h[i]<0)
                x = 0;
            else
                x = h[i]/a+1;

            hh[i] = -1;
            tm|=(1<<i);
            vector<int> ss = s;

            hh[i-1] = h[i-1]-b*x;
            if(i==1)
            {
                x = max(x,h[i-1]/b+1);
                hh[i-1] = -1;
                tm|=(1<<(i-1));
            }
            hh[i+1] = h[i+1]-b*x;
            if(i==n-2)
            {
                x = max(x,h[i+1]/b+1);
                hh[i+1] = -1;
                tm|=(1<<(i+1));
            }

            while(x--)  ss.push_back(i);
            go(tm,n,a,b,hh,ss);
            hh[i] = h[i];
            hh[i+1] = h[i+1];
            hh[i-1] = h[i-1];
        }
    }
}

int main()
{
    int h[10],n,a,b,i;

    cin>>n>>a>>b;
    for(i=0;i<n;i++)
    {
        cin>>h[i];
        fm|=(1<<i);
    }
    ft = INT_MAX;
    vector<int> s;
    go(0,n,a,b,h,s);

    cout<<ft<<endl;
    for(i=0;i<fs.size();i++)
        cout<<fs[i]+1<<' ';
    return 0;
}


#include <algorithm>
#include <iostream>
#include <cstring>
#include <cstdlib>
#include <cstdio>
#include <queue>
#include <cmath>
#include <stack>
#include <map>
#include <ctime>
#include <iomanip>

#pragma comment(linker, "/STACK:1024000000,1024000000")
#define EPS (1e-6)
#define LL long long
#define ULL unsigned long long
#define _LL __int64
#define INF 0x3f3f3f3f
#define Mod 676

using namespace std;

int h[20],dp[20][20][20],next[20][20][20];

int n,a,b;

int dfs(int site,int pre,int now)
{
    if(dp[site][pre][now] != INF)
        return dp[site][pre][now];

    if(site == n-1)
    {
        if(h[site] >= pre*b+now*a || h[site+1] >= now*b)
            return dp[site][pre][now] = 1 + INF;
        return dp[site][pre][now] = now;
    }

    dp[site][pre][now] = 0;

    int tmp = INF;

    for(int i = 0;i <= 16; ++i)
    {
        if(h[site] >= (pre+i)*b + now*a)
            continue;
        if(now + dfs(site+1,now,i) < tmp)
        {
            tmp = now + dfs(site+1,now,i);
            next[site][pre][now] = i;
        }
    }

    return dp[site][pre][now] = tmp;
}

int main()
{
    int i;

    scanf("%d %d %d",&n,&a,&b);

    for(i = 1;i <= n; ++i)
        scanf("%d",&h[i]);

    memset(dp,INF,sizeof(dp));

    int Min = INF,pos;

    for(int i = (h[1]+b)/b;i <= 16; ++i)
        if(dfs(2,0,i)+i < Min)
            Min = dfs(2,0,i),pos = i;

    printf("%d\n",Min);

    int ans[20] = {0};

    int tmp,pre = 0,now = pos;

    for(i = 2;i < n; ++i)
    {
        ans[i] = now;
        tmp = next[i][pre][now];
        pre = now;
        now = tmp;
    }

    for(i = 1;i <= n; ++i)
        while(ans[i]--)
            printf("%d ",i);

    return 0;
}


#include <algorithm>
#include <iostream>
#include <cstring>
#include <cstdlib>
#include <cstdio>
#include <queue>
#include <cmath>
#include <stack>
#include <map>
#include <ctime>
#include <iomanip>

#pragma comment(linker, "/STACK:1024000000,1024000000")
#define EPS (1e-6)
#define LL long long
#define ULL unsigned long long
#define _LL __int64
#define INF 0x3f3f3f3f
#define Mod 676

using namespace std;

int h[20],dp[20][20][20],next[20][20][20];

int n,a,b;

int dfs(int site,int pre,int now)
{
    if(dp[site][pre][now] != -1)
        return dp[site][pre][now];

    dp[site][pre][now] = 0;

    if(site == n-1)
        return dp[site][pre][now] = now*b <= h[site+1] ? INF : now;
    int tmp = INF;

    for(int i = max((h[site]-pre*b-now*a+b)/b,0);i <= 15; ++i)
    {
        if(i+dfs(site+1,now,i) < tmp)
            tmp = i+dfs(site+1,now,i) , next[site][pre][now] = i;
    }

    return dp[site][pre][now] = tmp;
}

int main()
{
    scanf("%d %d %d",&n,&a,&b);

    for(int i = 1;i <= n; ++i)
        scanf("%d",&h[i]);

    memset(dp,-1,sizeof(dp));

    for(int i = (h[1]+b)/b;i <= 15; ++i)
        dfs(2,0,i);

    int Min = INF,pos;

   for(int i = (h[1]+b)/b;i <= 15; ++i)
        if(dp[2][0][i] == -1)
            continue;
        else if(dp[2][0][i] < Min)
            Min = dp[2][0][i],pos = i;

    printf("%d\n",Min);

    int ans[20] = {0};

    int pre = 0,now = pos,tmp;

    for(int i = 2;i < n; ++i)
    {
        ans[i] = now;
        tmp = next[i][pre][now];
        pre = now;
        now = tmp;
    }

    for(int i = 2;i <= n; ++i)
        while(ans[i]--)
            printf("%d ",i);

    return 0;
}


#include <algorithm>
#include <iostream>
#include <cstring>
#include <cstdlib>
#include <cstdio>
#include <queue>
#include <cmath>
#include <stack>
#include <map>
#include <ctime>
#include <iomanip>

#pragma comment(linker, "/STACK:1024000000,1024000000")
#define EPS (1e-6)
#define LL long long
#define ULL unsigned long long
#define _LL __int64
#define INF 0x3f3f3f3f
#define Mod 676

using namespace std;

int h[20],dp[20][20][20],next[20][20][20];

int n,a,b;

int dfs(int site,int pre,int now)
{
    if(dp[site][pre][now] != -1)
        return dp[site][pre][now];

    dp[site][pre][now] = 0;

    if(site == n-1)
        return dp[site][pre][now] = now*b <= h[site] ? INF : now;
    int tmp = INF;

    for(int i = max((h[site]-pre*b-now*a+b)/b,0);i <= 15; ++i)
    {
        if(i+dfs(site+1,now,i) < tmp)
            tmp = i+dfs(site+1,now,i) , next[site][pre][now] = i;
    }

    return dp[site][pre][now] = tmp;
}

int main()
{
    scanf("%d %d %d",&n,&a,&b);

    for(int i = 1;i <= n; ++i)
        scanf("%d",&h[i]);

    memset(dp,-1,sizeof(dp));

    for(int i = (h[1]+b)/b;i <= 15; ++i)
        dfs(2,0,i);

    int Min = INF,pos;

   for(int i = (h[1]+b)/b;i <= 15; ++i)
        if(dp[2][0][i] == -1)
            continue;
        else if(dp[2][0][i] < Min)
            Min = dp[2][0][i],pos = i;

    printf("%d\n",Min);

    int ans[20] = {0};

    int pre = 0,now = pos,tmp;

    for(int i = 2;i < n; ++i)
    {
        ans[i] = now;
        tmp = next[i][pre][now];
        pre = now;
        now = tmp;
    }

    for(int i = 2;i <= n; ++i)
        while(ans[i]--)
            printf("%d ",i);

    return 0;
}


#include <algorithm>
#include <iostream>
#include <cstring>
#include <cstdlib>
#include <cstdio>
#include <queue>
#include <cmath>
#include <stack>
#include <map>
#include <ctime>
#include <iomanip>

#pragma comment(linker, "/STACK:1024000000,1024000000")
#define EPS (1e-6)
#define LL long long
#define ULL unsigned long long
#define _LL __int64
#define INF 0x3f3f3f3f
#define Mod 676

using namespace std;

int h[15],ans[15] = {0};

int main()
{
    int n,a,b,i;

    scanf("%d %d %d",&n,&a,&b);

    for(i = 1;i <= n; ++i)
        scanf("%d",&h[i]);

    if(n == 3)
    {
        int anw = max( (h[2]+a)/a , max((h[1]+b)/b,(h[3]+b)/b) );

        printf("%d\n",anw);
        while(anw--)
            printf("%d%c",2,anw ? ' ' : '\n');
        return 0;
    }

    h[2] -= (h[1]+b)/b*a;
    h[3] -= (h[1]+b)/b*b;
    ans[2] = (h[1]+b)/b;
    h[1] = -1;

    h[n-1] -= (h[n]+b)/b*a;
    h[n-2] -= (h[n]+b)/b*b;
    ans[n-1] = (h[n]+b)/b;
    h[n] = -1;

    for(i = 2;i < n; ++i)
    {
        while(h[i-1] >= 0 && h[i] >= 0 && h[i+1] >= 0)
            ans[i]++,h[i-1] -= b,h[i+1] -= b ,h[i] -= a;
    }

    for(i = 2;i < n; ++i)
    {
        if(h[i] >= 0 && h[i+1] >= 0)
        {
            int sa,sb;

            h[i] > h[i+1] ? sa = i,sb = i+1 : sa = i+1,sb = i;

            while(h[i] >= 0)
                ans[sa]++,h[sa] -= a,h[sb] -= b;
        }
    }

    for(i = 2;i < n; ++i)
    {
        if(h[i-1] >= 0 && h[i+1] >= 0)
        {
            if(h[i-1] <= b || h[i+1] <= b || 2*b >= a)
            {
                while(h[i-1] >= 0 && h[i+1] >= 0)
                    ans[i]++,h[i-1] -= b,h[i+1] -= b;
            }
        }
    }

    for(i = 2;i < n; ++i)
        while(h[i] >= 0)
            h[i] -= a,ans[i]++;

    int anw = 0;

    for(i = 1;i <= n; ++i)
        anw += ans[i];

    printf("%d\n",anw);

    for(i = 1;i <= n; ++i)
        while(ans[i]--)
            printf("%d ",i);

    return 0;
}


#include <algorithm>
#include <iostream>
#include <cstring>
#include <cstdlib>
#include <cstdio>
#include <queue>
#include <cmath>
#include <stack>
#include <map>
#include <ctime>
#include <iomanip>

#pragma comment(linker, "/STACK:1024000000,1024000000")
#define EPS (1e-6)
#define LL long long
#define ULL unsigned long long
#define _LL __int64
#define INF 0x3f3f3f3f
#define Mod 676

using namespace std;

int h[20],dp[20][20][20],next[20][20][20];

int n,a,b;

int dfs(int site,int pre,int now)
{
    if(dp[site][pre][now] != INF)
        return dp[site][pre][now];

    if(site == n-1)
    {
        if(h[site] >= pre*b+now*a || h[site+1] >= now*b)
            return dp[site][pre][now] = 1 + INF;
        return dp[site][pre][now] = now;
    }

    dp[site][pre][now] = 0;

    int tmp = INF;

    for(int i = 0;i <= 16; ++i)
    {
        if(h[site] >= (pre+i)*b + now*a)
            continue;
        if(now + dfs(site+1,now,i) < tmp)
        {
            tmp = now + dfs(site+1,now,i);
            next[site][pre][now] = i;
        }
    }

    return dp[site][pre][now] = tmp;
}

int main()
{
    int i;

    scanf("%d %d %d",&n,&a,&b);

    for(i = 1;i <= n; ++i)
        scanf("%d",&h[i]);

    memset(dp,INF,sizeof(dp));

    int Min = INF,pos;

    for(int i = (h[1]+b)/b;i <= 16; ++i)
        if(dfs(2,0,i) < Min)
            Min = dfs(2,0,i),pos = i;

    printf("%d\n",Min);

    int ans[20] = {0};

    int tmp,pre = 0,now = pos;

    for(i = 2;i < n; ++i)
    {
        ans[i] = now;
        tmp = next[i][pre][now];
        pre = now;
        now = tmp;
    }

    for(i = 1;i <= n; ++i)
        while(ans[i]--)
            printf("%d ",i);

    return 0;
}


#include <algorithm>
#include <iostream>
#include <cstring>
#include <cstdlib>
#include <cstdio>
#include <queue>
#include <cmath>
#include <stack>
#include <map>
#include <ctime>
#include <iomanip>

#pragma comment(linker, "/STACK:1024000000,1024000000")
#define EPS (1e-6)
#define LL long long
#define ULL unsigned long long
#define _LL __int64
#define INF 0x3f3f3f3f
#define Mod 676

using namespace std;

int h[20],dp[20][20][20],next[20][20][20];

int n,a,b;

int dfs(int site,int pre,int now)
{
    if(dp[site][pre][now] != -1)
        return dp[site][pre][now];

    dp[site][pre][now] = 0;

    if(site == n-1)
        return dp[site][pre][now] = now*b <= h[site+1] ? INF : now;
    int tmp = INF;

    for(int i = max((h[site]-pre*b-now*a+b)/b,0);i <= 15; ++i)
    {
        if(i+dfs(site+1,now,i) < tmp)
            tmp = now+dfs(site+1,now,i) , next[site][pre][now] = i;
    }

    return dp[site][pre][now] = tmp;
}

int main()
{
    scanf("%d %d %d",&n,&a,&b);

    for(int i = 1;i <= n; ++i)
        scanf("%d",&h[i]);

    memset(dp,-1,sizeof(dp));

    for(int i = (h[1]+b)/b;i <= 15; ++i)
        dfs(2,0,i);

    int Min = INF,pos;

   for(int i = (h[1]+b)/b;i <= 15; ++i)
        if(dp[2][0][i] == -1)
            continue;
        else if(dp[2][0][i] < Min)
            Min = dp[2][0][i],pos = i;

    printf("%d\n",Min);

    int ans[20] = {0};

    int pre = 0,now = pos,tmp;

    for(int i = 2;i < n; ++i)
    {
        ans[i] = now;
        tmp = next[i][pre][now];
        pre = now;
        now = tmp;

    }

    for(int i = 2;i <= n; ++i)
        while(ans[i]--)
            printf("%d ",i);

    return 0;
}


#include <algorithm>
#include <iostream>
#include <cstring>
#include <cstdlib>
#include <cstdio>
#include <queue>
#include <cmath>
#include <stack>
#include <map>
#include <ctime>
#include <iomanip>

#pragma comment(linker, "/STACK:1024000000,1024000000")
#define EPS (1e-6)
#define LL long long
#define ULL unsigned long long
#define _LL __int64
#define INF 0x3f3f3f3f
#define Mod 676

using namespace std;

int h[20],dp[20][20][20],next[20][20][20];

int n,a,b;

int dfs(int site,int pre,int now)
{
    if(dp[site][pre][now] != INF)
        return dp[site][pre][now];

    if(site == n-1)
    {
        if(h[site] >= pre*b+now*a || h[site+1] >= now*b)
            return dp[site][pre][now] = 1 + INF;
        return dp[site][pre][now] = now;
    }

    dp[site][pre][now] = 0;

    int tmp = INF;

    for(int i = 0;i <= 16; ++i)
    {
        if(h[site] >= (pre+i)*b + now*a)
            continue;
        if(i + dfs(site+1,now,i) < tmp)
        {
            tmp = i + dfs(site+1,now,i);
            next[site][pre][now] = i;
        }
    }

    return dp[site][pre][now] = tmp;
}

int main()
{
    int i;

    scanf("%d %d %d",&n,&a,&b);

    for(i = 1;i <= n; ++i)
        scanf("%d",&h[i]);

    memset(dp,INF,sizeof(dp));

    int Min = INF,pos;

    for(int i = (h[1]+b)/b;i <= 16; ++i)
        if(dfs(2,0,i) < Min)
            Min = dfs(2,0,i),pos = i;

    printf("%d\n",Min);

    int ans[20] = {0};

    int tmp,pre = 0,now = pos;

    for(i = 2;i < n; ++i)
    {
        ans[i] = now;
        tmp = next[i][pre][now];
        pre = now;
        now = tmp;
    }

    for(i = 1;i <= n; ++i)
        while(ans[i]--)
            printf("%d ",i);

    return 0;
}


#include <algorithm>
#include <iostream>
#include <cstring>
#include <cstdlib>
#include <cstdio>
#include <queue>
#include <cmath>
#include <stack>
#include <map>
#include <ctime>
#include <iomanip>

#pragma comment(linker, "/STACK:1024000000,1024000000")
#define EPS (1e-6)
#define LL long long
#define ULL unsigned long long
#define _LL __int64
#define INF 0x3f3f3f3f
#define Mod 676

using namespace std;

int h[20],w[20];
int anw[20] = {0},t[20] = {0};

int Min = 10000;

int n,a,b;

void dfs(int site,int hit,int ans)
{
    if(w[site-1] - hit*b >= 0 || ans >= Min)
        return ;

    t[site] = hit;

    w[site] = h[site] - a*hit;

    if(site == n-1)
    {
        if(h[n] - hit*b >= 0)
            return ;
        Min = ans;

        for(int i = 1;i <= n; ++i)
            anw[i] = t[i];
    }

    for(int i = 0;i <= 8; ++i)
        dfs(site+1,i,ans+i);
}

int main()
{
    int i;
    scanf("%d %d %d",&n,&a,&b);
    for(i = 1;i <= n; ++i)
        scanf("%d",&h[i]);

    for(i = 0;i <= 8; ++i)
    {
        w[1] = h[1];
        dfs(2,i,i);
    }

    printf("%d\n",Min);

    for(i = 1;i <= n; ++i)
        while(anw[i]--)
            printf("%d ",i);
    return 0;
}


// =========================================================
//
//       Filename:  prob6D.cpp
//
//    Description:
//
//        Version:  1.0
//        Created:  07/18/2011 09:15:04 AM
//       Revision:  none
//       Compiler:  g++
//
//         Author:  LI YAN (lyan), lyan@cs.ucr.edu
//        Company:  U of California Riverside
//      Copyright:  Copyright (c) 07/18/2011, LI YAN
//
// =========================================================

#include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <iomanip>
#include <map>
#include <queue>
#include <sstream>
#include <string>
#include <vector>
#include <set>
using namespace std;

typedef long long LL;
typedef vector<int> VI;
typedef vector<string> VS;
typedef pair<int,int> PII;

#define INF (1<<29)
#define fort(i,a) for(typeof a.begin() i=a.begin(); i!=a.end(); ++i)
#define ALL(x) x.begin(), x.end()
#define PB push_back
#define MP make_pair
#define sz(x) int(x.size())

template<class T>
void chmax(T &a, T b) { a = a>=b ? a:b; }

template<class T>
void chmin(T &a, T b) { a = a<=b ? a:b; }

void solve()
{
    int n, a, b; cin >> n >> a >> b;
    VI h(n); for(int i=0; i<n; ++i) cin >> h[i];

    VI cnt(n,0);
    // kill 0th
    int spell = h[0]/b+1;
    cnt[1]+=spell; h[0]-=b*spell; h[1]-=a*spell; h[2]-=b*spell;
    // kill n-1th
    if (h[n-1]>=0) {
        spell = h[n-1]/b+1;
        cnt[n-2]+=spell; h[n-1]-=b*spell; h[n-2]-=a*spell; h[n-3]-=b*spell;
    }

    VI upper(n,0), curr(n,0);
    for(int i=0; i<n; ++i) if (h[i]>=0) upper[i] = h[i]/a+1;

    VI ans(n,0);
    int maxsp=100;
    while(true) {
        int carry=1;
        for(int i=1; i<n-1; ++i) {
            curr[i]+=carry;
            if (curr[i]<=upper[i]) { carry=0; break; }
            else { curr[i]=0; carry=1; }
        }
        if (carry) break;
        VI archers = h;
        int total=0;
        for(int i=1; i<n-1; ++i)
        { archers[i]-=curr[i]*a; archers[i-1]-=curr[i]*b; archers[i+1]-=curr[i]*b;
            total += curr[i];
        }
        bool dead = true;
        for(int i=1; i<n-1; ++i) if (archers[i]>=0) { dead=false; break; }
        if (dead && total < maxsp) {
            ans = curr; maxsp = total;
        }
    }
    int kans=0;
    for(int i=0; i<n; ++i) { ans[i] += cnt[i]; kans+=ans[i]; }
    cout << kans << endl;
    for(int i=1; i<n-1; ++i) for(int j=0; j<ans[i]; ++j) cout << (i+1) << ' ';
    cout << endl;
}

int main()
{
    solve();
}


// =========================================================
//
//       Filename:  prob6D.cpp
//
//    Description:
//
//        Version:  1.0
//        Created:  07/18/2011 09:15:04 AM
//       Revision:  none
//       Compiler:  g++
//
//         Author:  LI YAN (lyan), lyan@cs.ucr.edu
//        Company:  U of California Riverside
//      Copyright:  Copyright (c) 07/18/2011, LI YAN
//
// =========================================================

#include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <iomanip>
#include <map>
#include <queue>
#include <sstream>
#include <string>
#include <vector>
#include <set>
using namespace std;

typedef long long LL;
typedef vector<int> VI;
typedef vector<string> VS;
typedef pair<int,int> PII;

#define INF (1<<29)
#define fort(i,a) for(typeof a.begin() i=a.begin(); i!=a.end(); ++i)
#define ALL(x) x.begin(), x.end()
#define PB push_back
#define MP make_pair
#define sz(x) int(x.size())

template<class T>
void chmax(T &a, T b) { a = a>=b ? a:b; }

template<class T>
void chmin(T &a, T b) { a = a<=b ? a:b; }

int n,a,b;
map<VI,int> memo;
map<VI,int> prev;

int calc(VI conf)
{
//cout << "calc: ";
//for(int i=0; i<sz(conf); ++i) cout << conf[i] << ' '; cout << endl;
    bool dead=true;
    for(int i=0; i<sz(conf); ++i) if (conf[i]>=0)
    { dead=false; break; }

    if (dead) return 0;
    if (memo.count(conf)) return memo[conf];
    int ans=100;
    VI oldconf=conf;
    for(int i=1; i<sz(conf)-1; ++i) if (conf[i]>=0 || conf[i-1]>=0 || conf[i+1]>=0)
    {
        conf[i]-=a; conf[i-1]-=b; conf[i+1]-=b;
        int curr = 1+calc(conf);
        if (curr<ans) { ans=curr; prev[oldconf]=i; }
        conf[i]+=a; conf[i-1]+=b; conf[i+1]+=b;
    }
    return memo[conf]=ans;
}

void solve()
{
    cin >> n >> a >> b;
    VI h(n); for(int i=0; i<n; ++i) cin >> h[i];

    int kans=0;
    VI cnt(n,0);
    // kill 0th
    int spell = h[0]/b+1;
    cnt[1]+=spell; h[0]-=b*spell; h[1]-=a*spell; h[2]-=b*spell;
    kans+=spell;
    // kill n-1th
    if (h[n-1]>=0) {
        spell = h[n-1]/b+1;
        cnt[n-2]+=spell; h[n-1]-=b*spell; h[n-2]-=a*spell; h[n-3]-=b*spell;
        kans+=spell;
    }

    kans+=calc(h); cout << kans << endl;
    VI ans;
    for(int i=0; i<cnt[1]; ++i) ans.PB(i+1);
    if (n-2!=1) for(int i=0; i<cnt[n-2]; ++i) ans.PB(n-2+1);
    /* *********
    while(1) {
        bool dead=true;
        for(int i=0; i<n; ++i) if (h[i]>=0) { dead=false; break; }
        if (dead) break;
        for(int i=0; i<n; ++i) cout << h[i] << ' '; cout << endl;
        for(int i=1; i<n-1; ++i) if (h[i]>=0||h[i-1]>=0||h[i+1]>=0){
            VI newh = h;
            newh[i]-=a; newh[i-1]-=b; newh[i+1]-=b;
            if (memo.count(newh) && memo[newh]==memo[h]-1)
            { ans.PB(i+1); h=newh; break; }
        }
    }***8 */
    while(prev.count(h)) {
        int spell = prev[h]; ans.PB(spell+1);
        h[spell]-=a; h[spell-1]-=b; h[spell+1]-=b;
    }
    for(int i=0; i<sz(ans); ++i) {
        if (i) cout << ' ';
        cout << ans[i];
    }
    cout << endl;
}

int main()
{
    solve();
}


// =========================================================
//
//       Filename:  prob6D.cpp
//
//    Description:
//
//        Version:  1.0
//        Created:  07/18/2011 09:15:04 AM
//       Revision:  none
//       Compiler:  g++
//
//         Author:  LI YAN (lyan), lyan@cs.ucr.edu
//        Company:  U of California Riverside
//      Copyright:  Copyright (c) 07/18/2011, LI YAN
//
// =========================================================

#include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <iomanip>
#include <map>
#include <queue>
#include <sstream>
#include <string>
#include <vector>
#include <set>
using namespace std;

typedef long long LL;
typedef vector<int> VI;
typedef vector<string> VS;
typedef pair<int,int> PII;

#define INF (1<<29)
#define fort(i,a) for(typeof a.begin() i=a.begin(); i!=a.end(); ++i)
#define ALL(x) x.begin(), x.end()
#define PB push_back
#define MP make_pair
#define sz(x) int(x.size())

template<class T>
void chmax(T &a, T b) { a = a>=b ? a:b; }

template<class T>
void chmin(T &a, T b) { a = a<=b ? a:b; }

int n,a,b;
map<VI,int> memo;
map<VI,int> prev;

int calc(VI conf)
{
//cout << "calc: ";
//for(int i=0; i<sz(conf); ++i) cout << conf[i] << ' '; cout << endl;
    bool dead=true;
    for(int i=0; i<sz(conf); ++i) if (conf[i]>=0)
    { dead=false; break; }

    if (dead) return 0;
    if (memo.count(conf)) return memo[conf];
    int ans=100;
    VI oldconf=conf;
    for(int i=1; i<sz(conf)-1; ++i) if (conf[i]>=0 || conf[i-1]>=0 || conf[i+1]>=0)
    {
        conf[i]-=a; conf[i-1]-=b; conf[i+1]-=b;
        int curr = 1+calc(conf);
        if (curr<ans) { ans=curr; prev[oldconf]=i; }
        conf[i]+=a; conf[i-1]+=b; conf[i+1]+=b;
    }
    return memo[conf]=ans;
}

void solve()
{
    cin >> n >> a >> b;
    VI h(n); for(int i=0; i<n; ++i) cin >> h[i];

    int kans=0;
    VI cnt(n,0);
    // kill 0th
    int spell = h[0]/b+1;
    cnt[1]+=spell; h[0]-=b*spell; h[1]-=a*spell; h[2]-=b*spell;
    kans+=spell;
    // kill n-1th
    if (h[n-1]>=0) {
        spell = h[n-1]/b+1;
        cnt[n-2]+=spell; h[n-1]-=b*spell; h[n-2]-=a*spell; h[n-3]-=b*spell;
        kans+=spell;
    }

    kans+=calc(h); cout << kans << endl;
    VI ans;
    for(int i=0; i<cnt[1]; ++i) ans.PB(2);
    if (n-2!=1) for(int i=0; i<cnt[n-2]; ++i) ans.PB(n-2+1);

    //for(int i=0; i<sz(ans); ++i) cout << ans[i] << ' '; cout << endl;
    /* *********
    while(1) {
        bool dead=true;
        for(int i=0; i<n; ++i) if (h[i]>=0) { dead=false; break; }
        if (dead) break;
        for(int i=0; i<n; ++i) cout << h[i] << ' '; cout << endl;
        for(int i=1; i<n-1; ++i) if (h[i]>=0||h[i-1]>=0||h[i+1]>=0){
            VI newh = h;
            newh[i]-=a; newh[i-1]-=b; newh[i+1]-=b;
            if (memo.count(newh) && memo[newh]==memo[h]-1)
            { ans.PB(i+1); h=newh; break; }
        }
    }***8 */
    while(prev.count(h)) {
        int spell = prev[h]; ans.PB(spell+1);
        h[spell]-=a; h[spell-1]-=b; h[spell+1]-=b;
    }
    for(int i=0; i<sz(ans); ++i) {
        if (i) cout << ' ';
        cout << ans[i];
    }
    cout << endl;
}

int main()
{
    solve();
}


// =========================================================
//
//       Filename:  prob6D.cpp
//
//    Description:
//
//        Version:  1.0
//        Created:  07/18/2011 09:15:04 AM
//       Revision:  none
//       Compiler:  g++
//
//         Author:  LI YAN (lyan), lyan@cs.ucr.edu
//        Company:  U of California Riverside
//      Copyright:  Copyright (c) 07/18/2011, LI YAN
//
// =========================================================

#include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <iomanip>
#include <map>
#include <queue>
#include <sstream>
#include <string>
#include <vector>
#include <set>
using namespace std;

typedef long long LL;
typedef vector<int> VI;
typedef vector<string> VS;
typedef pair<int,int> PII;

#define INF (1<<29)
#define fort(i,a) for(typeof a.begin() i=a.begin(); i!=a.end(); ++i)
#define ALL(x) x.begin(), x.end()
#define PB push_back
#define MP make_pair
#define sz(x) int(x.size())

template<class T>
void chmax(T &a, T b) { a = a>=b ? a:b; }

template<class T>
void chmin(T &a, T b) { a = a<=b ? a:b; }

int n,a,b;
int memo[20][20][20]; // h[p-1], h[p], p
int best[20][20][20];

int calc(VI conf, int p)
{
//cout << p << ' ' << conf[p] << ' ' << conf[p-1] << endl;

    if (p>=sz(conf)-1) {
        if (conf[sz(conf)-2]<=0 && conf[sz(conf)-1]<=0) return 0;
        else return 100;
    }

    if (memo[conf[p-1]][conf[p]][p]>=0)
        return memo[conf[p-1]][conf[p]][p];

    int ans=100;
    {
        int kmax=0,kmin=0;
        if (conf[p-1]>0) kmin=(conf[p-1]+b-1)/b;
        if (conf[p]>0) kmax=(conf[p]+a-1)/a;
        if (conf[p-1]>0) chmax(kmax, (conf[p-1]+b-1)/b);
        if (conf[p+1]>0) chmax(kmax, (conf[p+1]+b-1)/b);
        assert(kmin<=kmax); //cout << p << ' ' << kmin << ' ' << kmax << endl;

        for(int j=kmin; j<=kmax; ++j) {
            int a1 = conf[p-1], a2=conf[p], a3=conf[p+1];
            conf[p] = max(0,conf[p]-a*j);
            conf[p-1] = max(0,conf[p-1]-b*j);
            conf[p+1] = max(0,conf[p+1]-b*j);
            int curr = j+calc(conf,p+1);
            if (curr<ans) { ans=curr; best[a1][a2][p]=j; }
            conf[p-1]=a1; conf[p]=a2; conf[p+1]=a3;
        }
    }
    return memo[conf[p-1]][conf[p]][p]=ans;
}

void solve()
{
    memset(memo,-1,sizeof memo);
    memset(best,-1,sizeof best);
    cin >> n >> a >> b;
    VI h(n); for(int i=0; i<n; ++i) { cin >> h[i]; ++h[i]; }

    int kans=calc(h,1); cout << kans << endl;
    VI ans;

    //for(int p1=0; p1<20; ++p1)
    //for(int p2=0; p2<20; ++p2)
    //    cout << best[p1][p2][1] << ' ' << memo[p1][p2][1] << endl;

    for(int i=1; i<n-1; ++i) {
        int k = best[h[i-1]][h[i]][i];
        h[i-1]=max(0,h[i-1]-b*k);
        h[i]=max(0,h[i]-a*k);
        h[i+1]=max(0,h[i+1]-b*k);
        for(int j=0; j<k; ++j) ans.PB(i+1);
    }
    for(int i=0; i<sz(ans); ++i) {
        if (i) cout << ' ';
        cout << ans[i];
    }
    cout << endl;
}

int main()
{
    solve();
}

// a state is fully determined by
// currpos, h[pos-1] and h[pos]
//
// for each pos in 1 to n-2
//   try all possible number of spells, min is to kill h[pos-1], max is to kill
//   h[pos+1]
//   recurse on pos+1 with new h[pos], h[pos+1]
//
/* ***************
 *550822    Jul 19, 2011 2:10:01 AM     lantimilan  D - Lizards and Basements 2     GNU C++     Accepted    50 ms   20200 KB
 550820     Jul 19, 2011 1:50:32 AM     lantimilan  D - Lizards and Basements 2     GNU C++     Wrong answer on test 28     30 ms   2600 KB
 550819     Jul 19, 2011 1:43:32 AM     lantimilan  D - Lizards and Basements 2     GNU C++     Wrong answer on test 21     30 ms   2600 KB
 550783     Jul 19, 2011 12:17:55 AM    lantimilan  D - Lizards and Basements 2     GNU C++     Runtime error on test 16    30 ms   1400 KB
 550758     Jul 18, 2011 11:33:54 PM    lantimilan  D - Lizards and Basements 2     GNU C++     Wrong answer on test 21     30 ms   1400 KB
 550752     Jul 18, 2011 11:18:39 PM    lantimilan  D - Lizards and Basements 2     GNU C++     Memory limit exceeded on test 42    1970 ms     65500 KB
 550741     Jul 18, 2011 11:07:48 PM    lantimilan  D - Lizards and Basements 2     GNU C++     Wrong answer on test 23     30 ms   1400 KB
 550692     Jul 18, 2011 10:12:28 PM    lantimilan  D - Lizards and Basements 2     GNU C++     Memory limit exceeded on test 23    1950 ms     65500 KB
 550690     Jul 18, 2011 10:07:58 PM    lantimilan  D - Lizards and Basements 2     GNU C++     Wrong answer on test 1  30 ms   1400 KB
 550641     Jul 18, 2011 8:40:24 PM     lantimilan  D - Lizards and Basements 2     GNU C++     Wrong answer on test 99     30 ms   1400 KB
 550636     Jul 18, 2011 8:38:57 PM     lantimilan  D - Lizards and Basements 2     GNU C++     Wrong answer on test 21     30 ms   1400 KB
 550634     Jul 18, 2011 8:37:36 PM     lantimilan  D - Lizards and Basements 2     GNU C++     Wrong answer on test 1  10 ms   1400 KB
 * */


// =========================================================
//
//       Filename:  prob6D.cpp
//
//    Description:
//
//        Version:  1.0
//        Created:  07/18/2011 09:15:04 AM
//       Revision:  none
//       Compiler:  g++
//
//         Author:  LI YAN (lyan), lyan@cs.ucr.edu
//        Company:  U of California Riverside
//      Copyright:  Copyright (c) 07/18/2011, LI YAN
//
// =========================================================

#include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <iomanip>
#include <map>
#include <queue>
#include <sstream>
#include <string>
#include <vector>
#include <set>
using namespace std;

typedef long long LL;
typedef vector<int> VI;
typedef vector<string> VS;
typedef pair<int,int> PII;

#define INF (1<<29)
#define fort(i,a) for(typeof a.begin() i=a.begin(); i!=a.end(); ++i)
#define ALL(x) x.begin(), x.end()
#define PB push_back
#define MP make_pair
#define sz(x) int(x.size())

template<class T>
void chmax(T &a, T b) { a = a>=b ? a:b; }

template<class T>
void chmin(T &a, T b) { a = a<=b ? a:b; }

void solve()
{
    int n, a, b; cin >> n >> a >> b;
    VI h(n); for(int i=0; i<n; ++i) cin >> h[i];

    VI cnt(n,0);
    // kill 0th
    int spell = h[0]/b+1;
    cnt[1]+=spell; h[0]-=b*spell; h[1]-=a*spell; h[2]-=b*spell;
    // kill n-1th
    if (h[n-1]>=0) {
        spell = h[n-1]/b+1;
        cnt[n-2]+=spell; h[n-1]-=b*spell; h[n-2]-=a*spell; h[n-3]-=b*spell;
    }

    VI upper(n,0), curr(n,0);
    for(int i=0; i<n; ++i) if (h[i]>=0) upper[i] = h[i]/a+1;

    VI ans(n,0);
    int maxsp=100;
    while(true) {
        int carry=1;
        for(int i=1; i<n-1; ++i) {
            curr[i]+=carry;
            if (curr[i]<=upper[i]) { carry=0; break; }
            else { curr[i]=upper[i]; carry=1; }
        }
        if (carry) break;
        VI archers = h;
        int total=0;
        for(int i=1; i<n-1; ++i)
        { archers[i]-=curr[i]*a; archers[i-1]-=curr[i]*b; archers[i+1]-=curr[i]*b;
            total += curr[i];
        }
        bool dead = true;
        for(int i=1; i<n-1; ++i) if (archers[i]>=0) { dead=false; break; }
        if (dead && total < maxsp) {
            ans = curr; maxsp = total;
        }
    }
    int kans=0;
    for(int i=0; i<n; ++i) { ans[i] += cnt[i]; kans+=ans[i]; }
    cout << kans << endl;
    for(int i=1; i<n-1; ++i) for(int j=0; j<ans[i]; ++j) cout << (i+1) << ' ';
    cout << endl;
}

int main()
{
    solve();
}


// =========================================================
//
//       Filename:  prob6D.cpp
//
//    Description:
//
//        Version:  1.0
//        Created:  07/18/2011 09:15:04 AM
//       Revision:  none
//       Compiler:  g++
//
//         Author:  LI YAN (lyan), lyan@cs.ucr.edu
//        Company:  U of California Riverside
//      Copyright:  Copyright (c) 07/18/2011, LI YAN
//
// =========================================================

#include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <iomanip>
#include <map>
#include <queue>
#include <sstream>
#include <string>
#include <vector>
#include <set>
using namespace std;

typedef long long LL;
typedef vector<int> VI;
typedef vector<string> VS;
typedef pair<int,int> PII;

#define INF (1<<29)
#define fort(i,a) for(typeof a.begin() i=a.begin(); i!=a.end(); ++i)
#define ALL(x) x.begin(), x.end()
#define PB push_back
#define MP make_pair
#define sz(x) int(x.size())

template<class T>
void chmax(T &a, T b) { a = a>=b ? a:b; }

template<class T>
void chmin(T &a, T b) { a = a<=b ? a:b; }

int n,a,b;
//map<VI,int> memo;
//map<VI,PII> prev;
#define LAST 200
#define DIM 2*LAST+1
int memo[DIM][DIM][15]; // h[p-1], p
int best[DIM][DIM][15];

int calc(VI conf, int p)
{
    if (p>=sz(conf)-1) {
        if (conf[sz(conf)-2]<0 && conf[sz(conf)-1]<0) return 0;
        else return 100;
    }

    if (memo[conf[p-1]+LAST][conf[p]+LAST][p]>=0)
        return memo[conf[p-1]+LAST][conf[p]+LAST][p];

    int ans=100;
    {
        int kmax=0,kmin=0;
        if (conf[p-1]>=0) kmin=conf[p-1]/b+1;
        if (conf[p]>=0) kmax=conf[p]/a+1;
        if (conf[p-1]>=0) chmax(kmax, conf[p-1]/b+1);
        if (conf[p+1]>=0) chmax(kmax, conf[p+1]/b+1);
        assert(kmin<=kmax); //cout << p << ' ' << kmin << ' ' << kmax << endl;

        for(int j=kmin; j<=kmax; ++j) {
            int p1=conf[p-1], p2=conf[p];
        conf[p]-=a*j; conf[p-1]-=b*j; conf[p+1]-=b*j;
        int curr = j+calc(conf,p+1);
        if (curr<ans) { ans=curr; best[p1+LAST][p2+LAST][p]=j; }
        conf[p]+=a*j; conf[p-1]+=b*j; conf[p+1]+=b*j;
        }
    }
    return memo[conf[p-1]+LAST][conf[p]+LAST][p]=ans;
}

void solve()
{
    memset(memo,-1,sizeof memo);
    memset(best,0,sizeof best);
    cin >> n >> a >> b;
    VI h(n); for(int i=0; i<n; ++i) cin >> h[i];

    int kans=calc(h,1); cout << kans << endl;
    VI ans;

    int p1,p2;
    for(p1=0; p1<2*LAST; ++p1) for(p2=0; p2<2*LAST; ++p2)
    if (memo[p1][p2][1]==kans) goto done;
    done:
    int k=best[p1][p2][1];
    for(int i=0; i<k; ++i) ans.PB(2);
    h[0]-=b*k; h[1]-=a*k; h[2]-=b*k;

    for(int i=2; i<n-1; ++i) {
        k = best[h[i-1]+LAST][h[i]+LAST][i]; h[i-1]-=b*k; h[i]-=a*k; h[i+1]-=b*k;
        for(int j=0; j<k; ++j) ans.PB(i+1);
        kans -= k;
    }
    for(int i=0; i<sz(ans); ++i) {
        if (i) cout << ' ';
        cout << ans[i];
    }
    cout << endl;
}

int main()
{
    solve();
}


// =========================================================
//
//       Filename:  prob6D.cpp
//
//    Description:
//
//        Version:  1.0
//        Created:  07/18/2011 09:15:04 AM
//       Revision:  none
//       Compiler:  g++
//
//         Author:  LI YAN (lyan), lyan@cs.ucr.edu
//        Company:  U of California Riverside
//      Copyright:  Copyright (c) 07/18/2011, LI YAN
//
// =========================================================

#include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <iomanip>
#include <map>
#include <queue>
#include <sstream>
#include <string>
#include <vector>
#include <set>
using namespace std;

typedef long long LL;
typedef vector<int> VI;
typedef vector<string> VS;
typedef pair<int,int> PII;

#define INF (1<<29)
#define fort(i,a) for(typeof a.begin() i=a.begin(); i!=a.end(); ++i)
#define ALL(x) x.begin(), x.end()
#define PB push_back
#define MP make_pair
#define sz(x) int(x.size())

template<class T>
void chmax(T &a, T b) { a = a>=b ? a:b; }

template<class T>
void chmin(T &a, T b) { a = a<=b ? a:b; }

int n,a,b;
//map<VI,int> memo;
//map<VI,PII> prev;
#define LAST 200
int memo[2*LAST+1][2*LAST+1]; // h[p-1], p
int best[2*LAST+1][2*LAST+1];

int calc(VI conf, int p)
{
    if (p>=sz(conf)-1) {
        if (conf[sz(conf)-2]<0 && conf[sz(conf)-1]<0) return 0;
        else return 100;
    }

    if (memo[conf[p-1]+LAST][p]>=0) return memo[conf[p-1]+LAST][p];

    int ans=100;
    {
        int kmax=0,kmin=0;
        if (conf[p-1]>=0) kmin=conf[p-1]/b+1;
        if (conf[p]>=0) kmax=conf[p]/a+1;
        if (conf[p-1]>=0) chmax(kmax, conf[p-1]/b+1);
        if (conf[p+1]>=0) chmax(kmax, conf[p+1]/b+1);
        assert(kmin<=kmax);

        for(int j=kmin; j<=kmax; ++j) {
            int old = conf[p-1];
        conf[p]-=a*j; conf[p-1]-=b*j; conf[p+1]-=b*j;
        int curr = j+calc(conf,p+1);
        if (curr<ans) { ans=curr; best[old+LAST][p]=j; }
        conf[p]+=a*j; conf[p-1]+=b*j; conf[p+1]+=b*j;
        }
    }
    return memo[conf[p-1]+LAST][p]=ans;
}

void solve()
{
    memset(memo,-1,sizeof memo);
    memset(best,0,sizeof best);
    cin >> n >> a >> b;
    VI h(n); for(int i=0; i<n; ++i) cin >> h[i];

    int kans=calc(h,1); cout << kans << endl;
    VI ans;

    for(int i=1; i<n-1; ++i) {
        int p;
        for(p=0; p<2*LAST; ++p) if (memo[p][i]==kans) break;
        assert(p<2*LAST);
        int k = best[p][i]; h[i-1]-=b*k; h[i]-=a*k; h[i+1]-=b*k;
        for(int j=0; j<k; ++j) ans.PB(i+1);
        kans -= k;
    }
    for(int i=0; i<sz(ans); ++i) {
        if (i) cout << ' ';
        cout << ans[i];
    }
    cout << endl;
}

int main()
{
    solve();
}


// =========================================================
//
//       Filename:  prob6D.cpp
//
//    Description:
//
//        Version:  1.0
//        Created:  07/18/2011 09:15:04 AM
//       Revision:  none
//       Compiler:  g++
//
//         Author:  LI YAN (lyan), lyan@cs.ucr.edu
//        Company:  U of California Riverside
//      Copyright:  Copyright (c) 07/18/2011, LI YAN
//
// =========================================================

#include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <iomanip>
#include <map>
#include <queue>
#include <sstream>
#include <string>
#include <vector>
#include <set>
using namespace std;

typedef long long LL;
typedef vector<int> VI;
typedef vector<string> VS;
typedef pair<int,int> PII;

#define INF (1<<29)
#define fort(i,a) for(typeof a.begin() i=a.begin(); i!=a.end(); ++i)
#define ALL(x) x.begin(), x.end()
#define PB push_back
#define MP make_pair
#define sz(x) int(x.size())

template<class T>
void chmax(T &a, T b) { a = a>=b ? a:b; }

template<class T>
void chmin(T &a, T b) { a = a<=b ? a:b; }

int n,a,b;
map<VI,int> memo;
map<VI,PII> prev;

int calc(VI conf, int p)
{
//cout << "calc: ";
//for(int i=0; i<sz(conf); ++i) cout << conf[i] << ' '; cout << endl;

    if (p>=sz(conf)-1) {
        bool dead=true;
        for(int i=0; i<sz(conf); ++i) if (conf[i]>=0) { dead=false; break; }
        if (dead) return 0; else return 100;
    }

    if (memo.count(conf)) return memo[conf];

    if (conf[p]<0 && conf[p-1]<0 && conf[p+1]<0) return calc(conf,p+1);

    int ans=100;
    VI oldconf=conf;
    {
        int kmax=100,kmin=0;
        if (conf[p-1]>=0) kmin=conf[p-1]/b+1;
        if (conf[p]>=0) kmax=conf[p]/a+1;
        if (conf[p-1]>=0) chmin(kmax, conf[p-1]/b+1);
        if (conf[p+1]>=0) chmin(kmax, conf[p+1]/b+1);
        assert(kmax<100);
        for(int j=kmin; j<=kmax; ++j) {
        conf[p]-=a*j; conf[p-1]-=b*j; conf[p+1]-=b*j;
        int curr = j+calc(conf,p+1);
        if (curr<ans) { ans=curr; if (j) prev[oldconf]=PII(p,j); }
        conf=oldconf;
        }
    }
    return memo[conf]=ans;
}

void solve()
{
    cin >> n >> a >> b;
    VI h(n); for(int i=0; i<n; ++i) cin >> h[i];

    int kans=0;
    VI cnt(n,0);
    // kill 0th
    int spell = h[0]/b+1;
    cnt[1]+=spell; h[0]-=b*spell; h[1]-=a*spell; h[2]-=b*spell;
    kans+=spell;
    // kill n-1th
    if (h[n-1]>=0) {
        spell = h[n-1]/b+1;
        cnt[n-2]+=spell; h[n-1]-=b*spell; h[n-2]-=a*spell; h[n-3]-=b*spell;
        kans+=spell;
    }

    kans+=calc(h,1); cout << kans << endl;
    VI ans;
    for(int i=0; i<cnt[1]; ++i) ans.PB(2);
    if (n-2!=1) for(int i=0; i<cnt[n-2]; ++i) ans.PB(n-2+1);

    while(prev.count(h)) {
        int spell = prev[h].first;
        int k = prev[h].second;
    //cout << spell << ' ' << k << endl;
        for(int i=0; i<k; ++i) ans.PB(spell+1);
        h[spell]-=a*k; h[spell-1]-=b*k; h[spell+1]-=b*k;
    }
    for(int i=0; i<sz(ans); ++i) {
        if (i) cout << ' ';
        cout << ans[i];
    }
    cout << endl;
}

int main()
{
    solve();
}


// =========================================================
//
//       Filename:  prob6D.cpp
//
//    Description:
//
//        Version:  1.0
//        Created:  07/18/2011 09:15:04 AM
//       Revision:  none
//       Compiler:  g++
//
//         Author:  LI YAN (lyan), lyan@cs.ucr.edu
//        Company:  U of California Riverside
//      Copyright:  Copyright (c) 07/18/2011, LI YAN
//
// =========================================================

#include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <iomanip>
#include <map>
#include <queue>
#include <sstream>
#include <string>
#include <vector>
#include <set>
using namespace std;

typedef long long LL;
typedef vector<int> VI;
typedef vector<string> VS;
typedef pair<int,int> PII;

#define INF (1<<29)
#define fort(i,a) for(typeof a.begin() i=a.begin(); i!=a.end(); ++i)
#define ALL(x) x.begin(), x.end()
#define PB push_back
#define MP make_pair
#define sz(x) int(x.size())

template<class T>
void chmax(T &a, T b) { a = a>=b ? a:b; }

template<class T>
void chmin(T &a, T b) { a = a<=b ? a:b; }

int n,a,b;
//map<VI,int> memo;
//map<VI,PII> prev;
#define LAST 200
int memo[2*LAST+1][2*LAST+1]; // h[p-1], p
int best[2*LAST+1][2*LAST+1];

int calc(VI conf, int p)
{
    if (p>=sz(conf)-1) {
        if (conf[sz(conf)-2]<0 && conf[sz(conf)-1]<0) return 0;
        else return 100;
    }

    if (memo[conf[p-1]+LAST][p]>=0) return memo[conf[p-1]+LAST][p];

    int ans=100;
    {
        int kmax=0,kmin=0;
        if (conf[p-1]>=0) kmin=conf[p-1]/b+1;
        if (conf[p]>=0) kmax=conf[p]/a+1;
        if (conf[p-1]>=0) chmax(kmax, conf[p-1]/b+1);
        if (conf[p+1]>=0) chmax(kmax, conf[p+1]/b+1);
        assert(kmin<=kmax);

        for(int j=kmin; j<=kmax; ++j) {
            int old = conf[p-1];
        conf[p]-=a*j; conf[p-1]-=b*j; conf[p+1]-=b*j;
        int curr = j+calc(conf,p+1);
        if (curr<ans) { ans=curr; best[old+LAST][p]=j; }
        conf[p]+=a*j; conf[p-1]+=b*j; conf[p+1]+=b*j;
        }
    }
    return memo[conf[p-1]+LAST][p]=ans;
}

void solve()
{
    memset(memo,-1,sizeof memo);
    memset(best,0,sizeof best);
    cin >> n >> a >> b;
    VI h(n); for(int i=0; i<n; ++i) cin >> h[i];

    int kans=calc(h,1); cout << kans << endl;
    VI ans;

    int p;
    for(p=0; p<2*LAST; ++p) if (memo[p][1]==kans) break;
    int k=best[p][1];
    for(int i=0; i<k; ++i) ans.PB(2);
    h[0]-=b*k; h[1]-=a*k; h[2]-=b*k;

    for(int i=2; i<n-1; ++i) {
        k = best[h[i-1]+LAST][i]; h[i-1]-=b*k; h[i]-=a*k; h[i+1]-=b*k;
        for(int j=0; j<k; ++j) ans.PB(i+1);
        kans -= k;
    }
    for(int i=0; i<sz(ans); ++i) {
        if (i) cout << ' ';
        cout << ans[i];
    }
    cout << endl;
}

int main()
{
    solve();
}


// =========================================================
//
//       Filename:  prob6D.cpp
//
//    Description:
//
//        Version:  1.0
//        Created:  07/18/2011 09:15:04 AM
//       Revision:  none
//       Compiler:  g++
//
//         Author:  LI YAN (lyan), lyan@cs.ucr.edu
//        Company:  U of California Riverside
//      Copyright:  Copyright (c) 07/18/2011, LI YAN
//
// =========================================================

#include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <iomanip>
#include <map>
#include <queue>
#include <sstream>
#include <string>
#include <vector>
#include <set>
using namespace std;

typedef long long LL;
typedef vector<int> VI;
typedef vector<string> VS;
typedef pair<int,int> PII;

#define INF (1<<29)
#define fort(i,a) for(typeof a.begin() i=a.begin(); i!=a.end(); ++i)
#define ALL(x) x.begin(), x.end()
#define PB push_back
#define MP make_pair
#define sz(x) int(x.size())

template<class T>
void chmax(T &a, T b) { a = a>=b ? a:b; }

template<class T>
void chmin(T &a, T b) { a = a<=b ? a:b; }

void solve()
{
    int n, a, b; cin >> n >> a >> b;
    VI h(n); for(int i=0; i<n; ++i) cin >> h[i];

    VI cnt(n,0);
    // kill 0th
    int spell = h[0]/b+1;
    cnt[1]+=spell; h[0]-=b*spell; h[1]-=a*spell; h[2]-=b*spell;
    // kill n-1th
    if (h[n-1]>=0) {
        spell = h[n-1]/b+1;
        cnt[n-2]+=spell; h[n-1]-=b*spell; h[n-2]-=a*spell; h[n-3]-=b*spell;
    }

    VI upper(n,0), curr(n,0);
    for(int i=0; i<n; ++i) if (h[i]>=0) upper[i] = h[i]/a+1;

    VI ans(n,0);
    int maxsp=100;
    while(true) {
        int carry=1;
        for(int i=1; i<n-1; ++i) {
            curr[i]+=carry;
            if (curr[i]<=upper[i]) { carry=0; break; }
            else { curr[i]=upper[i]; carry=1; }
        }
        if (carry) break;
        VI archers = h;
        int total=0;
        for(int i=1; i<n-1; ++i)
        { archers[i]-=curr[i]*a; archers[i-1]-=curr[i]*b; archers[i+1]-=curr[i]*b;
            total += curr[i];
        }
        bool dead = true;
        for(int i=1; i<n-1; ++i) if (archers[i]>=0) { dead=false; break; }
        if (dead && total < maxsp) {
            ans = curr; maxsp = total;
        }
    }
    for(int i=0; i<n; ++i) ans[i] += cnt[i];
    for(int i=1; i<n-1; ++i) for(int j=0; j<ans[i]; ++j) cout << (i+1) << ' ';
    cout << endl;
}

int main()
{
    solve();
}


// =========================================================
//
//       Filename:  prob6D.cpp
//
//    Description:
//
//        Version:  1.0
//        Created:  07/18/2011 09:15:04 AM
//       Revision:  none
//       Compiler:  g++
//
//         Author:  LI YAN (lyan), lyan@cs.ucr.edu
//        Company:  U of California Riverside
//      Copyright:  Copyright (c) 07/18/2011, LI YAN
//
// =========================================================

#include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <iomanip>
#include <map>
#include <queue>
#include <sstream>
#include <string>
#include <vector>
#include <set>
using namespace std;

typedef long long LL;
typedef vector<int> VI;
typedef vector<string> VS;
typedef pair<int,int> PII;

#define INF (1<<29)
#define fort(i,a) for(typeof a.begin() i=a.begin(); i!=a.end(); ++i)
#define ALL(x) x.begin(), x.end()
#define PB push_back
#define MP make_pair
#define sz(x) int(x.size())

template<class T>
void chmax(T &a, T b) { a = a>=b ? a:b; }

template<class T>
void chmin(T &a, T b) { a = a<=b ? a:b; }

int n,a,b;
//map<VI,int> memo;
//map<VI,PII> prev;
#define LAST 30
int memo[2*LAST+1][2*LAST+1]; // h[p-1], p
int best[2*LAST+1][2*LAST+1];

int calc(VI conf, int p)
{
    if (p>=sz(conf)-1) {
        if (conf[sz(conf)-2]<0 && conf[sz(conf)-1]<0) return 0;
        else return 100;
    }

    if (memo[conf[p-1]+LAST][p]>=0) return memo[conf[p-1]+LAST][p];

    if (conf[p]<0 && conf[p-1]<0 && conf[p+1]<0) return calc(conf,p+1);

    int ans=100;
    {
        int kmax=0,kmin=0;
        if (conf[p-1]>=0) kmin=conf[p-1]/b+1;
        if (conf[p]>=0) kmax=conf[p]/a+1;
        if (conf[p-1]>=0) chmax(kmax, conf[p-1]/b+1);
        if (conf[p+1]>=0) chmax(kmax, conf[p+1]/b+1);
        assert(kmin<=kmax);

        for(int j=kmin; j<=kmax; ++j) {
            int old = conf[p-1];
        conf[p]-=a*j; conf[p-1]-=b*j; conf[p+1]-=b*j;
        int curr = j+calc(conf,p+1);
        if (curr<ans) { ans=curr; best[old+LAST][p]=j; }
        conf[p]+=a*j; conf[p-1]+=b*j; conf[p+1]+=b*j;
        }
    }
    return memo[conf[p-1]+LAST][p]=ans;
}

void solve()
{
    memset(memo,-1,sizeof memo);
    memset(best,0,sizeof best);
    cin >> n >> a >> b;
    VI h(n); for(int i=0; i<n; ++i) cin >> h[i];

    int kans=calc(h,1); cout << kans << endl;
    VI ans;

    for(int i=1; i<n-1; ++i) {
        int p;
        for(p=0; p<2*LAST; ++p) if (memo[p][i]==kans) break;
        assert(p<2*LAST);
        int k = best[p][i]; h[i-1]-=b*k; h[i]-=a*k; h[i+1]-=b*k;
        for(int j=0; j<k; ++j) ans.PB(i+1);
        kans -= k;
    }
    for(int i=0; i<sz(ans); ++i) {
        if (i) cout << ' ';
        cout << ans[i];
    }
    cout << endl;
}

int main()
{
    solve();
}


// =========================================================
//
//       Filename:  prob6D.cpp
//
//    Description:
//
//        Version:  1.0
//        Created:  07/18/2011 09:15:04 AM
//       Revision:  none
//       Compiler:  g++
//
//         Author:  LI YAN (lyan), lyan@cs.ucr.edu
//        Company:  U of California Riverside
//      Copyright:  Copyright (c) 07/18/2011, LI YAN
//
// =========================================================

#include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <iomanip>
#include <map>
#include <queue>
#include <sstream>
#include <string>
#include <vector>
#include <set>
using namespace std;

typedef long long LL;
typedef vector<int> VI;
typedef vector<string> VS;
typedef pair<int,int> PII;

#define INF (1<<29)
#define fort(i,a) for(typeof a.begin() i=a.begin(); i!=a.end(); ++i)
#define ALL(x) x.begin(), x.end()
#define PB push_back
#define MP make_pair
#define sz(x) int(x.size())

template<class T>
void chmax(T &a, T b) { a = a>=b ? a:b; }

template<class T>
void chmin(T &a, T b) { a = a<=b ? a:b; }

int n,a,b;
//map<VI,int> memo;
//map<VI,PII> prev;
#define LAST 20
int memo[LAST+1][LAST+1]; // h[p-1], p
int best[LAST+1];

int calc(VI conf, int p)
{
    if (p>=sz(conf)-1) {
        if (conf[sz(conf)-2]<0) return 0;
        else return 100;
    }

    if (conf[p-1]<0) { if (memo[LAST][p]>=0) return memo[LAST][p]; }
    else if (memo[conf[p-1]][p]>=0) return memo[conf[p-1]][p];

    if (conf[p]<0 && conf[p-1]<0 && conf[p+1]<0) return calc(conf,p+1);

    int ans=100;
    VI oldconf=conf;
    {
        int kmax=0,kmin=0;
        if (conf[p-1]>=0) kmin=conf[p-1]/b+1;
        if (conf[p]>=0) kmax=conf[p]/a+1;
        if (conf[p-1]>=0) chmax(kmax, conf[p-1]/b+1);
        if (conf[p+1]>=0) chmax(kmax, conf[p+1]/b+1);
        assert(kmin<=kmax);
        for(int j=kmin; j<=kmax; ++j) {
        conf[p]-=a*j; conf[p-1]-=b*j; conf[p+1]-=b*j;
        int curr = j+calc(conf,p+1);
        if (curr<ans) { ans=curr; best[p]=j; }
        conf=oldconf;
        }
    }
    if (conf[p-1]<0) return memo[LAST][p] = ans;
    else return memo[conf[p-1]][p]=ans;
}

void solve()
{
    memset(memo,-1,sizeof memo);
    memset(best,0,sizeof best);
    cin >> n >> a >> b;
    VI h(n); for(int i=0; i<n; ++i) cin >> h[i];

    int kans=0;
    VI cnt(n,0);
    // kill 0th
    int spell = h[0]/b+1;
    cnt[1]+=spell; h[0]-=b*spell; h[1]-=a*spell; h[2]-=b*spell;
    kans+=spell;
    // kill n-1th
    if (h[n-1]>=0) {
        spell = h[n-1]/b+1;
        cnt[n-2]+=spell; h[n-1]-=b*spell; h[n-2]-=a*spell; h[n-3]-=b*spell;
        kans+=spell;
    }

    kans+=calc(h,1); cout << kans << endl;
    VI ans;
    for(int i=0; i<cnt[1]; ++i) ans.PB(2);
    if (n-2!=1) for(int i=0; i<cnt[n-2]; ++i) ans.PB(n-2+1);

    for(int i=1; i<n-1; ++i) {
        for(int j=0; j<best[i]; ++j) ans.PB(i+1);
    }
    for(int i=0; i<sz(ans); ++i) {
        if (i) cout << ' ';
        cout << ans[i];
    }
    cout << endl;
}

int main()
{
    solve();
}


// =========================================================
//
//       Filename:  prob6D.cpp
//
//    Description:
//
//        Version:  1.0
//        Created:  07/18/2011 09:15:04 AM
//       Revision:  none
//       Compiler:  g++
//
//         Author:  LI YAN (lyan), lyan@cs.ucr.edu
//        Company:  U of California Riverside
//      Copyright:  Copyright (c) 07/18/2011, LI YAN
//
// =========================================================

#include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <iomanip>
#include <map>
#include <queue>
#include <sstream>
#include <string>
#include <vector>
#include <set>
using namespace std;

typedef long long LL;
typedef vector<int> VI;
typedef vector<string> VS;
typedef pair<int,int> PII;

#define INF (1<<29)
#define fort(i,a) for(typeof a.begin() i=a.begin(); i!=a.end(); ++i)
#define ALL(x) x.begin(), x.end()
#define PB push_back
#define MP make_pair
#define sz(x) int(x.size())

template<class T>
void chmax(T &a, T b) { a = a>=b ? a:b; }

template<class T>
void chmin(T &a, T b) { a = a<=b ? a:b; }

int n,a,b;
map<VI,int> memo;
map<VI,PII> prev;

int calc(VI conf, int p)
{
//cout << "calc: ";
//for(int i=0; i<sz(conf); ++i) cout << conf[i] << ' '; cout << endl;

    if (p>=sz(conf)-1) {
        bool dead=true;
        for(int i=0; i<sz(conf); ++i) if (conf[i]>=0) { dead=false; break; }
        if (dead) return 0; else return 100;
    }

    if (memo.count(conf)) return memo[conf];

    if (conf[p]<0 && conf[p-1]<0 && conf[p+1]<0) return calc(conf,p+1);

    int ans=100;
    VI oldconf=conf;
    {
        int kmax=0,kmin=0;
        if (conf[p-1]>=0) kmin=conf[p-1]/b+1;
        if (conf[p]>=0) kmax=conf[p]/a+1;
        if (conf[p-1]>=0) chmax(kmax, conf[p-1]/b+1);
        if (conf[p+1]>=0) chmax(kmax, conf[p+1]/b+1);
        assert(kmin<=kmax);
        for(int j=kmin; j<=kmax; ++j) {
        conf[p]-=a*j; conf[p-1]-=b*j; conf[p+1]-=b*j;
        int curr = j+calc(conf,p+1);
        if (curr<ans) { ans=curr; if (j) prev[oldconf]=PII(p,j); }
        conf=oldconf;
        }
    }
    return memo[conf]=ans;
}

void solve()
{
    cin >> n >> a >> b;
    VI h(n); for(int i=0; i<n; ++i) cin >> h[i];

    int kans=0;
    VI cnt(n,0);
    // kill 0th
    int spell = h[0]/b+1;
    cnt[1]+=spell; h[0]-=b*spell; h[1]-=a*spell; h[2]-=b*spell;
    kans+=spell;
    // kill n-1th
    if (h[n-1]>=0) {
        spell = h[n-1]/b+1;
        cnt[n-2]+=spell; h[n-1]-=b*spell; h[n-2]-=a*spell; h[n-3]-=b*spell;
        kans+=spell;
    }

    kans+=calc(h,1); cout << kans << endl;
    VI ans;
    for(int i=0; i<cnt[1]; ++i) ans.PB(2);
    if (n-2!=1) for(int i=0; i<cnt[n-2]; ++i) ans.PB(n-2+1);

    while(prev.count(h)) {
        int spell = prev[h].first;
        int k = prev[h].second;
    //cout << spell << ' ' << k << endl;
        for(int i=0; i<k; ++i) ans.PB(spell+1);
        h[spell]-=a*k; h[spell-1]-=b*k; h[spell+1]-=b*k;
    }
    for(int i=0; i<sz(ans); ++i) {
        if (i) cout << ' ';
        cout << ans[i];
    }
    cout << endl;
}

int main()
{
    solve();
}


#include <cstring>
#include <cstdio>
#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <map>
#include <cmath>
#include <stack>

using namespace std;

#define PQ priority_queue
typedef long long LL;
typedef pair<LL,LL> pll;

LL N,archer[20],a,b;

LL ans[15][20][20];
pll next[15][20][20];
pll hit[15][20][20];

// SHIFT ALL HP BY ONE, all health < 0 becomes 0, otherwise +1
// start with pos, with archer[pos] = rem1, archer[pos+1] = rem2;
LL dp(LL pos, LL rem1, LL rem2) {
	if (pos==N) return 0;
	// Since a>b, it's always less useful to shoot any of the dead archers on the left
	if (rem1==0) {
		next[pos][rem1][rem2] = pll(rem2,archer[pos+2]);
		hit[pos][rem1][rem2] = pll(0,0);
		return dp(pos+1,rem2,archer[pos+2]);
	}
	if (pos==N-1) {
		hit[pos][rem1][rem2] = pll((rem1-1)/a+1,0);
		return (rem1-1)/a+1;
	}

	//pos<=N-2, we can't shoot on pos=N
	LL &t1 = ans[pos][rem1][rem2],t2,i,j;
	if (t1!=-1) return t1;
	for (i=1;i<=(rem1-1)/a+1;i++) {
		t2 = rem1 - a*i; // remaining hp after shooting i times to pos
		// how many shots to pos+1 needed to decimate pos
		if (t2<=0) j = 0;
		else j = (t2-1)/b + 1;

		LL hp1,hp2,tmp;
		hp1 = rem2-b*i-a*j;
		if (hp1<=0) hp1 = 0;
		hp2 = archer[pos+2]-b*j;
		if (hp2<=0) hp2 = 0;

		tmp = dp(pos+1,hp1,hp2);
		if (t1==-1 || i+j+tmp<t1) {
			t1 = i+j+tmp;
			next[pos][rem1][rem2] = pll(hp1,hp2);
			hit[pos][rem1][rem2] = pll(i,j);
		}
	}
	return t1;
}

int main() {
	LL i,tmp;
	cin >> N >> a >> b;
	for (i=1;i<=N;i++)
		cin >> archer[i];

	vector<LL> shot; shot.clear();

	tmp = archer[1]/b +1;
	for (i=1;i<=tmp;i++)
		shot.push_back(2);
	archer[2] -= tmp*a;
	archer[3] -= tmp*b;

	if (archer[N]>=0) {
		tmp = archer[N]/b +1;
		for (i=1;i<=tmp;i++)
			shot.push_back(N-1);
		archer[N-1] -= tmp*a;
		archer[N-2] -= tmp*b;
	}
	memset(ans,-1,sizeof(ans));

	// SHIFT ALL HP BY ONE, all health < 0 becomes 0, otherwise +1, for dp index
	archer[1] = 0; archer[N] = 0;
	for (i=2;i<=N-1;i++) {
		if (archer[i]<0) archer[i]=0;
		else archer[i]++;
	}

	dp(2,archer[2],archer[3]);
	LL p1=2;
	pll pnext = pll(archer[2],archer[3]),phit;
	while(p1<N) {
		phit = hit[p1][pnext.first][pnext.second];
		for (i=1;i<=phit.first;i++)
			shot.push_back(p1);
		for (i=1;i<=phit.second;i++)
			shot.push_back(p1++);
		pnext = next[p1][pnext.first][pnext.second];
		p1++;
	}
	cout << shot.size() << endl;
	for (i=0;i<shot.size();i++)
		cout << shot[i] << " ";
	cout << endl;
	return 0;
}


#include <cstring>
#include <cstdio>
#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <map>
#include <cmath>
#include <stack>

using namespace std;

#define PQ priority_queue
typedef long long LL;
typedef pair<LL,LL> pll;

LL N,archer[20],a,b;

LL ans[15][20][20];
pll next[15][20][20];
pll hit[15][20][20];

// SHIFT ALL HP BY ONE, all health < 0 becomes 0, otherwise +1
// start with pos, with archer[pos] = rem1, archer[pos+1] = rem2;
LL dp(LL pos, LL rem1, LL rem2) {
	if (pos==N) return 0;
	// Since a>b, it's always less useful to shoot any of the dead archers on the left
	if (rem1==0) {
		next[pos][rem1][rem2] = pll(rem2,archer[pos+2]);
		hit[pos][rem1][rem2] = pll(0,0);
		return dp(pos+1,rem2,archer[pos+2]);
	}
	if (pos==N-1) {
		hit[pos][rem1][rem2] = pll((rem1-1)/a+1,0);
		return (rem1-1)/a+1;
	}

	//pos<=N-2, we can't shoot on pos=N
	LL &t1 = ans[pos][rem1][rem2],t2,i,j;
	if (t1!=-1) return t1;
	for (i=0;i<=(rem1-1)/a+1;i++) {
		t2 = rem1 - a*i; // remaining hp after shooting i times to pos
		// how many shots to pos+1 needed to decimate pos
		if (t2<=0) j = 0;
		else j = (t2-1)/b + 1;

		LL hp1,hp2,tmp;
		hp1 = rem2-b*i-a*j;
		if (hp1<=0) hp1 = 0;
		hp2 = archer[pos+2]-b*j;
		if (hp2<=0) hp2 = 0;

		tmp = dp(pos+1,hp1,hp2);
		if (t1==-1 || i+j+tmp<t1) {
			t1 = i+j+tmp;
			next[pos][rem1][rem2] = pll(hp1,hp2);
			hit[pos][rem1][rem2] = pll(i,j);
		}
	}
	return t1;
}

int main() {
	LL i,tmp;
	cin >> N >> a >> b;
	for (i=1;i<=N;i++)
		cin >> archer[i];

	vector<LL> shot; shot.clear();

	tmp = archer[1]/b +1;
	for (i=1;i<=tmp;i++)
		shot.push_back(2);
	archer[2] -= tmp*a;
	archer[3] -= tmp*b;

	if (archer[N]>=0) {
		tmp = archer[N]/b +1;
		for (i=1;i<=tmp;i++)
			shot.push_back(N-1);
		archer[N-1] -= tmp*a;
		archer[N-2] -= tmp*b;
	}
	memset(ans,-1,sizeof(ans));

	// SHIFT ALL HP BY ONE, all health < 0 becomes 0, otherwise +1, for dp index
	archer[1] = 0; archer[N] = 0;
	for (i=2;i<=N-1;i++) {
		if (archer[i]<0) archer[i]=0;
		else archer[i]++;
	}
	/*for (i=1;i<=N;i++)
		cout << archer[i] << " ";
	cout << endl;*/

	dp(2,archer[2],archer[3]);
	LL p1=2;
	pll pnext = pll(archer[2],archer[3]),phit;
	while(p1<N) {
		phit = hit[p1][pnext.first][pnext.second];
		for (i=1;i<=phit.first;i++)
			shot.push_back(p1);
		for (i=1;i<=phit.second;i++)
			shot.push_back(p1+1);
		pnext = next[p1][pnext.first][pnext.second];
		p1++;
	}
	cout << shot.size() << endl;
	for (i=0;i<shot.size();i++)
		cout << shot[i] << " ";
	cout << endl;
	return 0;
}


#include <cstring>
#include <cstdio>
#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <map>
#include <cmath>
#include <stack>

using namespace std;

#define PQ priority_queue
typedef long long LL;
typedef pair<LL,LL> pll;

LL N,archer[20],a,b;

LL ans[11][20][20];
pll next[11][20][20];
pll hit[11][20][20];

// SHIFT ALL HP BY ONE, all health < 0 becomes 0, otherwise +1
// start with pos, with archer[pos] = rem1, archer[pos+1] = rem2;
LL dp(LL pos, LL rem1, LL rem2) {
	if (pos==N) return 0;
	// Since a>b, it's always less useful to shoot any of the dead archers on the left
	if (rem1==0) {
		next[pos][rem1][rem2] = pll(rem2,archer[pos+2]);
		hit[pos][rem1][rem2] = pll(0,0);
		return dp(pos+1,rem2,archer[pos+2]);
	}
	if (pos==N-1) {
		hit[pos][rem1][rem2] = pll((rem1-1)/a+1,0);
		return (rem1-1)/a+1;
	}

	//pos<=N-2, we can't shoot on pos=N
	LL &t1 = ans[pos][rem1][rem2],t2,i,j;
	if (t1!=-1) return t1;
	for (i=1;i<=(rem1-1)/a+1;i++) {
		t2 = rem1 - a*i; // remaining hp after shooting i times to pos
		// how many shots to pos+1 needed to decimate pos
		if (t2<=0) j = 0;
		else j = (t2-1)/b + 1;

		LL hp1,hp2,tmp;
		hp1 = rem2-b*i-a*j;
		if (hp1<=0) hp1 = 0;
		hp2 = archer[pos+2]-b*j;
		if (hp2<=0) hp2 = 0;

		tmp = dp(pos+1,hp1,hp2);
		if (t1==-1 || i+j+tmp<t1) {
			t1 = i+j+tmp;
			next[pos][rem1][rem2] = pll(hp1,hp2);
			hit[pos][rem1][rem2] = pll(i,j);
		}
	}
	return t1;
}

int main() {
	LL i,tmp;
	cin >> N >> a >> b;
	for (i=1;i<=N;i++)
		cin >> archer[i];

	vector<LL> shot; shot.clear();

	tmp = archer[1]/b +1;
	for (i=1;i<=tmp;i++)
		shot.push_back(2);
	archer[2] -= tmp*a;
	archer[3] -= tmp*b;

	if (archer[N]>=0) {
		tmp = archer[N]/b +1;
		for (i=1;i<=tmp;i++)
			shot.push_back(N-1);
		archer[N-1] -= tmp*a;
		archer[N-2] -= tmp*b;
	}
	memset(ans,-1,sizeof(ans));

	// SHIFT ALL HP BY ONE, all health < 0 becomes 0, otherwise +1, for dp index
	archer[1] = 0; archer[N] = 0;
	for (i=2;i<=N-1;i++) {
		if (archer[i]<0) archer[i]=0;
		else archer[i]++;
	}

	dp(2,archer[2],archer[3]);
	LL p1=2;
	pll pnext = pll(archer[2],archer[3]),phit;
	while(p1<N) {
		phit = hit[p1][pnext.first][pnext.second];
		for (i=1;i<=phit.first;i++)
			shot.push_back(p1);
		for (i=1;i<=phit.second;i++)
			shot.push_back(p1++);
		pnext = next[p1][pnext.first][pnext.second];
		p1++;
	}
	cout << shot.size() << endl;
	for (i=0;i<shot.size();i++)
		cout << shot[i] << " ";
	cout << endl;
	return 0;
}


#include <cstring>
#include <cstdio>
#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <map>
#include <cmath>
#include <stack>

using namespace std;

#define PQ priority_queue
typedef long long LL;
typedef pair<LL,LL> pll;

LL N,archer[20],a,b;

LL ans[11][20][20];
pll next[11][20][20];

// SHIFT ALL HP BY ONE, all health < 0 becomes 0, otherwise +1
// start with pos, with archer[pos] = rem1, archer[pos+1] = rem2;
LL dp(LL pos, LL rem1, LL rem2) {
	if (pos==N) return 0;
	if (pos==N-1) {
		if (rem1==0) return 0;
		else return (rem1-1)/a+1;
	}

	//pos<=N-2, we can't shoot on pos=N
	LL &t1 = ans[pos][rem1][rem2],t2,i,j;
	// Since a>b, it's always less useful to shoot any of the dead archers on the left
	if (rem1==0) return dp(pos+1,rem2,archer[pos+2]);

	if (t1!=-1) return t1;
	for (i=1;i<=(rem1-1)/a+1;i++) {
		t2 = (rem1-1) - a*i; // remaining hp after shooting i times to pos
		// how many shots to pos+1 needed to decimate pos
		if (t2<0) j = 0;
		else j = t2/b + 1;

		LL hp1,hp2,tmp;
		hp1 = rem2-b*i-a*j;
		if (hp1<=0) hp1 = 0;
		hp2 = archer[pos+2]-b*j;
		if (hp2<=0) hp2 = 0;
		tmp = dp(pos+1,hp1,hp2);
		if (t1==-1 || i+j+tmp<t1) {
			t1 = i+j+tmp;
			next[pos][rem1][rem2] = pll(i,j);
		}
	}
	return t1;
}

int main() {
	LL i,tmp;
	cin >> N >> a >> b;
	for (i=1;i<=N;i++)
		cin >> archer[i];

	vector<LL> shot;

	tmp = archer[1]/b +1;
	for (i=1;i<=tmp;i++)
		shot.push_back(2);
	archer[2] -= tmp*a;
	archer[3] -= tmp*b;
	if (archer[N]>=0) {
		tmp = archer[N]/b +1;
		for (i=1;i<=tmp;i++)
			shot.push_back(N-1);
		archer[N-1] -= tmp*a;
		archer[N-2] -= tmp*b;
	}
	memset(ans,-1,sizeof(ans));

	// SHIFT ALL HP BY ONE, all health < 0 becomes 0, otherwise +1, for dp index
	archer[1] = 0; archer[N] = 0;
	for (i=2;i<=N-1;i++) {
		if (archer[i]<0) archer[i]=0;
		else archer[i]++;
	}

	dp(2,archer[2],archer[3]);
	LL p1=2;
	pll P;
	while(p1<N-1) {
		P = next[p1][archer[p1]][archer[p1+1]];
		for (i=1;i<=P.first;i++)
			shot.push_back(p1);
		for (i=1;i<=P.second;i++)
			shot.push_back(p1+1);
		archer[p1] = 0;

		archer[p1+1] -= P.first*b + P.second*a;
		if (archer[p1+1]<=0) archer[p1+1] = 0;
		archer[p1+2] -= P.second*b;
		if (archer[p1+2]<=0) archer[p1+2] = 0;
		p1++;
		/*for (i=1;i<=N;i++)
			cout << archer[i] << " ";
		cout << endl;*/
	}

	if (p1==N-1 && archer[N-1]>0) {
		for (i=1;i<=(archer[N-1]-1)/a+1;i++)
			shot.push_back(N-1);
	}

	cout << shot.size() << endl;
	for (i=0;i<shot.size();i++)
		cout << shot[i] << " ";
	cout << endl;
	return 0;
}


/*
 Greedy approach on number of damage cause to enemy.
*/
#include <cstdio>
#include <algorithm>

int n,a,b,h[11];

int t,sol[200];

bool complete () {for (int i=1;i<=n;i++) if (h[i]!=0) return 0; return 1;}
int find ()
{
    int idx=-1, dam=-1;
    for (int i=2;i<=n-1;i++)
    {
        int tmp = std::min(a, h[i]) + std::min(b, h[i-1]) + std::min(b, h[i+1]);
        if (tmp>dam)
        {
            dam = tmp; idx = i;
        }
    }
    return idx;
}

int main()
{
    scanf("%d%d%d",&n,&a,&b); for (int i=1;i<=n;i++) {scanf("%d",&h[i]); h[i]++;}
    while (!complete())
    {
        int u = find(); sol[t]=u; t++;
        h[u] = std::max(0,h[u]-a);
        h[u-1] = std::max(0, h[u-1]-b); h[u+1] = std::max(0, h[u+1]-b);
    }
    printf("%d\n",t);
    for (int i=0;i<t;i++) printf("%d ",sol[i]);
    return 0;
}


/*
 DP on the number of hits necessary.
 Lzd is killed when LESS THAN 0, so +1 for each lizard: they'll be killed when HP=0.
*/
#include <cstdio>
#include <algorithm>
#include <vector>

const int inf=1e9;
int n,a,b,h[10];
bool ready[10][17][17]; //16 cause WA (bonus 1 HP 4 each lzd)
int memo[10][17][17];
std::vector <int> v;
void zz() {}
//Id of current lizard, hp left of lizard "id-1" and hp left of lizard "id".
int FireBall (int id, int hp_id_1, int hp_id) {
    //Lizard id is in [0..n-1]
    if (id==7) zz();

    if (id==n-1) return (hp_id_1==0 && hp_id==0) ? 0 : inf;
    if (ready[id][hp_id_1][hp_id]) return memo[id][hp_id_1][hp_id];

    int ans = inf;
    //Hit "id" with num_fb fireball.
    //It must kill lizard "id-1" otherwise throw fb lizard "id+1" wouldn't help.
    for (int num_fb = 0; num_fb <= 16; num_fb++)
    if (hp_id_1 <= num_fb * b) {
        ans = std::min (ans, FireBall(id+1, std::max(hp_id-num_fb*a, 0), std::max(h[id+1]-num_fb*b, 0)) + num_fb);
    }
    ready[id][hp_id_1][hp_id] = 1;
    return memo[id][hp_id_1][hp_id] = ans;
}
void Trace (int ans, int id, int hp_id_1, int hp_id) {
    if (id==n-1) return;

    for (int num_fb = 0; num_fb <= 16; num_fb++)
    if (hp_id_1 <= num_fb * b) {
        if (ans == FireBall(id+1, std::max(hp_id-num_fb*a, 0), std::max(h[id+1]-num_fb*b, 0)) + num_fb) {
            ans -= num_fb;
            for (int i=1;i<=num_fb;i++) v.push_back(id);
            Trace (ans, id+1, std::max(hp_id-num_fb*a, 0), std::max(h[id+1]-num_fb*b, 0));
            break;
        }
    }
}

int main() {/*
    freopen("6D.inp","r",stdin); freopen("6D.out","w",stdout); //*/
    //Input.
    scanf("%d%d%d",&n,&a,&b); for (int i=0;i<n;i++) {scanf("%d",&h[i]); h[i]++;}

    int ans = FireBall(1, h[0], h[1]);
    printf("%d\n",ans);
    Trace (ans, 1, h[0], h[1]);
    //printf("%d\n",(int)v.size());
    for (int i=0;i<ans;i++) printf("%d ",v[i]+1);
    return 0;
}


/*
 DP on the number of hits necessary.
 Lzd is killed when LESS THAN 0, so +1 for each lizard: they'll be killed when HP=0.
*/
#include <cstdio>
#include <algorithm>
#include <vector>

const int inf=1e9;
int n,a,b,h[10];
bool ready[10][17][17]; //16 cause WA (bonus 1 HP 4 each lzd)
int memo[10][17][17];
std::vector <int> v;
void zz() {}
//Id of current lizard, hp left of lizard "id-1" and hp left of lizard "id".
int FireBall (int id, int hp_id_1, int hp_id) {
    //Lizard id is in [0..n-1]
    if (id==7) zz();

    if (id==n-1) return (hp_id_1==0 && hp_id==0) ? 0 : inf;
    if (ready[id][hp_id_1][hp_id]) return memo[id][hp_id_1][hp_id];

    int ans = inf;
    //Hit "id" with num_fb fireball.
    //It must kill lizard "id-1" otherwise throw fb lizard "id+1" wouldn't help.
    for (int num_fb = 0; num_fb <= 15; num_fb++)
    if (hp_id_1 <= num_fb * b) {
        ans = std::min (ans, FireBall(id+1, std::max(hp_id-num_fb*a, 0), std::max(h[id+1]-num_fb*b, 0)) + num_fb);
    }
    ready[id][hp_id_1][hp_id] = 1;
    return memo[id][hp_id_1][hp_id] = ans;
}
void Trace (int ans, int id, int hp_id_1, int hp_id) {
    if (id==n-1) return;

    for (int num_fb = 0; num_fb <= 15; num_fb++)
    if (hp_id_1 <= num_fb * b) {
        if (ans == FireBall(id+1, std::max(hp_id-num_fb*a, 0), std::max(h[id+1]-num_fb*b, 0)) + num_fb) {
            ans -= num_fb;
            for (int i=1;i<=num_fb;i++) v.push_back(id);
            Trace (ans, id+1, std::max(hp_id-num_fb*a, 0), std::max(h[id+1]-num_fb*b, 0));
            break;
        }
    }
}

int main() {/*
    freopen("6D.inp","r",stdin); freopen("6D.out","w",stdout); //*/
    //Input.
    scanf("%d%d%d",&n,&a,&b); for (int i=0;i<n;i++) {scanf("%d",&h[i]); h[i]++;}

    int ans = FireBall(1, h[0], h[1]);
    printf("%d\n",ans);
    Trace (ans, 1, h[0], h[1]);
    //printf("%d\n",(int)v.size());
    for (int i=0;i<ans;i++) printf("%d ",v[i]+1);
    return 0;
}


/*
 DP on the number of hits necessary.
 Lzd is killed when LESS THAN 0, so +1 for each lizard: they'll be killed when HP=0.
*/
#include <cstdio>
#include <algorithm>
#include <vector>

const int inf=1e9;
int n,a,b,h[10];
bool ready[10][16][16];
int memo[10][16][16];
std::vector <int> v;

//Id of current lizard, hp left of lizard "id-1" and hp left of lizard "id".
int FireBall (int id, int hp_id_1, int hp_id) {
    //Lizard id is in [0..n-1]
    if (id==n-1) return (hp_id_1==0 && hp_id==0) ? 0 : inf;
    if (ready[id][hp_id_1][hp_id]) return memo[id][hp_id_1][hp_id];

    int ans = inf;
    //Hit "id" with num_fb fireball.
    //It must kill lizard "id-1" otherwise throw fb lizard "id+1" wouldn't help.
    for (int num_fb = 0; num_fb <= 15; num_fb++)
    if (hp_id_1 <= num_fb * b) {
        ans = std::min (ans, FireBall(id+1, std::max(hp_id-num_fb*a, 0), std::max(h[id+1]-num_fb*b, 0)) + num_fb);
    }
    ready[id][hp_id_1][hp_id] = 1;
    return memo[id][hp_id_1][hp_id] = ans;
}
void Trace (int ans, int id, int hp_id_1, int hp_id) {
    if (id==n-1) return;

    for (int num_fb = 0; num_fb <= 15; num_fb++)
    if (hp_id_1 <= num_fb * b) {
        if (ans == FireBall(id+1, std::max(hp_id-num_fb*a, 0), std::max(h[id+1]-num_fb*b, 0)) + num_fb) {
            ans -= num_fb;
            for (int i=1;i<=num_fb;i++) v.push_back(id);
            Trace (ans, id+1, std::max(hp_id-num_fb*a, 0), std::max(h[id+1]-num_fb*b, 0));
            break;
        }
    }
}

int main() {/*
    freopen("6D.inp","r",stdin); freopen("6D.out","w",stdout); //*/
    //Input.
    scanf("%d%d%d",&n,&a,&b); for (int i=0;i<n;i++) {scanf("%d",&h[i]); h[i]++;}

    int ans = FireBall(1, h[0], h[1]);
    printf("%d\n",ans);
    Trace (ans, 1, h[0], h[1]);
    for (int i=0;i<ans;i++) printf("%d ",v[i]+1);
    return 0;
}


/*
 DP on the number of hits necessary.
 Lzd is killed when LESS THAN 0, so +1 for each lizard: they'll be killed when HP=0.
*/
#include <cstdio>
#include <algorithm>
#include <vector>

const int inf=1e9;
int n,a,b,h[10];
bool ready[10][17][17]; //16 cause WA (bonus 1 HP 4 each lzd)
int memo[10][17][17];
std::vector <int> v;
void zz() {}
//Id of current lizard, hp left of lizard "id-1" and hp left of lizard "id".
int FireBall (int id, int hp_id_1, int hp_id) {
    //Lizard id is in [0..n-1]
    if (id==7) zz();

    if (id==n-1) return (hp_id_1==0 && hp_id==0) ? 0 : inf;
    if (ready[id][hp_id_1][hp_id]) return memo[id][hp_id_1][hp_id];

    int ans = inf;
    //Hit "id" with num_fb fireball.
    //It must kill lizard "id-1" otherwise throw fb lizard "id+1" wouldn't help.
    for (int num_fb = 0; num_fb <= 15; num_fb++)
    if (hp_id_1 <= num_fb * b) {
        ans = std::min (ans, FireBall(id+1, std::max(hp_id-num_fb*a, 0), std::max(h[id+1]-num_fb*b, 0)) + num_fb);
    }
    ready[id][hp_id_1][hp_id] = 1;
    return memo[id][hp_id_1][hp_id] = ans;
}
void Trace (int ans, int id, int hp_id_1, int hp_id) {
    if (id==n-1) return;

    for (int num_fb = 0; num_fb <= 15; num_fb++)
    if (hp_id_1 <= num_fb * b) {
        if (ans == FireBall(id+1, std::max(hp_id-num_fb*a, 0), std::max(h[id+1]-num_fb*b, 0)) + num_fb) {
            ans -= num_fb;
            for (int i=1;i<=num_fb;i++) v.push_back(id);
            Trace (ans, id+1, std::max(hp_id-num_fb*a, 0), std::max(h[id+1]-num_fb*b, 0));
            break;
        }
    }
}

int main() {/*
    freopen("6D.inp","r",stdin); freopen("6D.out","w",stdout); //*/
    //Input.
    scanf("%d%d%d",&n,&a,&b); for (int i=0;i<n;i++) {scanf("%d",&h[i]); h[i]++;}

    int ans = FireBall(1, h[0], h[1]);
    printf("%d\n",ans);
    Trace (ans, 1, h[0], h[1]);
    printf("%d\n",(int)v.size());
    for (int i=0;i<ans;i++) printf("%d ",v[i]+1);
    return 0;
}


#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>
using namespace std;

typedef long long ll;
typedef long long LL;

const int maxn = (1e5)+9;
//dfs
int h[20];
int an[160];
int n,a,b;

bool dfs(int ans,int x,int l){
	if(ans==0){
		for(int i=1;i<=n;i++){
			if(h[i]>=0) return false;
		}
		return true;
	}
	if(h[x]<0) return dfs(ans,x+1,l);
	if(x==n){
		h[n]-=b;an[ans]=n-1;
		if(dfs(ans-1,x,l)) return true;
		h[n]+=b;//recall
	}else{
		for(int i=max(x,l);i<=x+1;i++){
			if((1<i)&&(i<n)){
				an[ans]=i;
				h[i]-=a;h[i-1]-=b;h[i+1]-=b;//recall
				if (dfs(ans-1,x,i)) return true;
				h[i]+=a;h[i-1]+=b;h[i+1]+=b;//recall
			}
		}
	}
	return false;
}
int main()
{
	//freopen("1.txt","r",stdin);
	scanf("%d%d%d",&n,&a,&b);
	int i,j;
	for(i=1;i<=n;i++){
		scanf("%d",h+i);
	}
	int ans=1;
	while(true){
		if(dfs(ans,1,2)){
			printf("%d\n",ans);
			i=ans;
			while(i){
				printf("%d ",an[i]);
				i--;
			}
			printf("\n");
			return 0;
		}
		ans++;
	}
	return 0;
}


#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>
using namespace std;

typedef long long ll;
typedef long long LL;

const int maxn = (1e5)+9;

int h[20];
int an[160];
int n,a,b;
bool judge(int &i){
	bool flag = false;
	i = 2;
	for(int j=2;j<=n-1;j++){
		if(h[j]>=0) flag = true;
		if(h[j]>h[i]) j=i;
	}
	return flag;
}
int main()
{
	//freopen("1.txt","r",stdin);
	scanf("%d%d%d",&n,&a,&b);
	int i,j;
	for(i=1;i<=n;i++){
		scanf("%d",h+i);
	}
	int ans=0;
	if(h[1]>=0){
		i = h[1]/b +1;
		for(j=0;j<i;j++){an[j+ans] =2;}
		ans += i;
		h[2] -= i*a;
		h[3] -= i*b;
	}
	if(h[n]>=0){
		i = h[n]/b + 1;
		for(j=0;j<i;j++){an[j+ans] =n-1;}
		ans += i;
		h[n-1] -= i*a;
		h[n-2] -= i*b;
	}
	while(judge(i)){
		h[i] -= a;
		h[i+1] -= b;
		h[i-1] -= b;
		an[ans] = i;
		ans ++;
	}
	printf("%d\n",ans);
	for(i=0;i<ans;i++){
		printf("%d ",an[i]);
	}
	printf("\n");
	return 0;
}


#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>
using namespace std;

typedef long long ll;
typedef long long LL;

const int maxn = (1e5)+9;

int h[20];
int an[160];
int n,a,b;
bool judge(int &i){
	bool flag = false;
	i = 2;
	for(int j=2;j<=n-1;j++){
		if(h[j]>=0) flag = true;
		if(h[j]>h[i]) j=i;
	}
	return flag;
}
int main()
{
	freopen("1.txt","r",stdin);
	scanf("%d%d%d",&n,&a,&b);
	int i,j;
	for(i=1;i<=n;i++){
		scanf("%d",h+i);
	}
	int ans=0;
	if(h[1]>=0){
		i = h[1]/b + 2 - (h[1]%b==0);
		for(j=0;j<i;j++){an[j+ans] =2;}
		ans += i;
		h[2] -= i*a;
		h[3] -= i*b;
	}
	if(h[n]>=0){
		i = h[n]/b + 2 - (h[n]%b==0);
		for(j=0;j<i;j++){an[j+ans] =n-1;}
		ans += i;
		h[n-1] -= i*a;
		h[n-2] -= i*b;
	}
	while(judge(i)){
		h[i] -= a;
		h[i+1] -= b;
		h[i-1] -= b;
		an[ans] = i;
		ans ++;
	}
	printf("%d\n",ans);
	for(i=0;i<ans;i++){
		printf("%d ",an[i]);
	}
	printf("\n");
	return 0;
}


#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>
using namespace std;

typedef long long ll;
typedef long long LL;

const int maxn = (1e5)+9;

int h[20];
int an[160];
int n,a,b;
bool judge(int &i){
	bool flag = false;
	i = 2;
	for(int j=2;j<=n-1;j++){
		if(h[j]>=0) flag = true;
		if(h[j]>h[i]) j=i;
	}
	return flag;
}
int main()
{
	//freopen("1.txt","r",stdin);
	scanf("%d%d%d",&n,&a,&b);
	int i,j;
	for(i=1;i<=n;i++){
		scanf("%d",h+i);
	}
	int ans=0;
	if(h[1]>=0){
		i = h[1]/b + 2 - (h[1]%b==0);
		for(j=0;j<i;j++){an[j+ans] =2;}
		ans += i;
		h[2] -= i*a;
		h[3] -= i*b;
	}
	if(h[n]>=0){
		i = h[n]/b + 2 - (h[n]%b==0);
		for(j=0;j<i;j++){an[j+ans] =n-1;}
		ans += i;
		h[n-1] -= i*a;
		h[n-2] -= i*b;
	}
	while(judge(i)){
		h[i] -= a;
		h[i+1] -= b;
		h[i-1] -= b;
		an[ans] = i;
		ans ++;
	}
	printf("%d\n",ans);
	for(i=0;i<ans;i++){
		printf("%d ",an[i]);
	}
	printf("\n");
	return 0;
}


#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>
using namespace std;

typedef long long ll;
typedef long long LL;

const int maxn = (1e5)+9;

int h[20];
int an[160];
int n,a,b;
bool judge(int &i){
	bool flag = false;
	i = 2;
	for(int j=2;j<=n-1;j++){
		if(h[j]>=0) flag = true;
		if(h[j]>h[i]) i=j;;
	}
	return flag;
}
int main()
{
	//freopen("1.txt","r",stdin);
	scanf("%d%d%d",&n,&a,&b);
	int i,j;
	for(i=1;i<=n;i++){
		scanf("%d",h+i);
	}
	int ans=0;
	if(h[1]>=0){
		i = h[1]/b +1;
		for(j=0;j<i;j++){an[j+ans] =2;}
		ans += i;
		h[2] -= i*a;
		h[3] -= i*b;
	}
	if(h[n]>=0){
		i = h[n]/b + 1;
		for(j=0;j<i;j++){an[j+ans] =n-1;}
		ans += i;
		h[n-1] -= i*a;
		h[n-2] -= i*b;
	}
	while(judge(i)){
		h[i] -= a;
		h[i+1] -= b;
		h[i-1] -= b;
		an[ans] = i;
		ans ++;
	}
	printf("%d\n",ans);
	for(i=0;i<ans;i++){
		printf("%d ",an[i]);
	}
	printf("\n");
	return 0;
}


#include <cstdio>
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <queue>
#include <map>
#include <set>
#include <cmath>
#include <sstream>
#include <stack>
#include <cassert>

#define pb push_back
#define mp make_pair
#define PI 3.1415926535897932384626433832795
#define sqr(x) (x)*(x)
#define forn(i, n) for(int i = 0; i < n; ++i)
#define ALL(x) x.begin(), x.end()
#define F first
#define S second
#define m0(x) memset(x,0,sizeof(x))
#define CC(x) cout << (x) << "\n"
#define pw(x) (1ull<<(x)).

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int,int> pii;
const int INF = 2147483647;
const ll LLINF = 9223372036854775807LL;

int n,a,b;
int h[15];
int mi=INF;
int now[15], ans[15];

void dfs(int pos, int moves) {
   if (pos==n-1) {
     int to =max((int)((double)(h[pos-1]+1)/b+0.99), max( (int)((double)(h[pos]+1)/a+0.99), (int)((double)(h[pos+1]+1)/b+0.99)) );
     now[pos] = to;
dfs(n, moves+to);
   }
   if (pos==n) {
      if (moves<mi) {
        mi=moves;
        for(int i=1;i<=n;i++) ans[i]=now[i];
      }
      return;
   }
   int sum=0;
   for(int i=1;i<=n;i++) sum+=max(0, h[i]+1);
   int count = moves + (int)(sum/(double)(a+2*b)+0.5);
   if (count>=mi) return;

   for(int co=0;;co++){
     h[pos-1]-=b*co;
     h[pos]-=a*co;
     h[pos+1]-=b*co;

     if (h[pos-1]<0) {
       now[pos]=co;
       dfs(pos+1, moves+co);
     }
     bool br= h[pos-1]<0 && h[pos]<0;
     h[pos-1]+=b*co;
     h[pos]+=a*co;
     h[pos+1]+=b*co;
     if (br) break;
   }
}

int main() {
  scanf("%d %d %d", &n, &a, &b);
  for(int i=1; i<=n; i++) scanf("%d", &h[i]);
  dfs(2,0);
  CC(mi);
  for(int i=1;i<=n; i++) for(int k=1; k<=ans[i]; k++) printf("%d ", i);
  return 0;
}


#include <cstdio>
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <queue>
#include <map>
#include <set>
#include <cmath>
#include <sstream>
#include <stack>
#include <cassert>

#define pb push_back
#define mp make_pair
#define PI 3.1415926535897932384626433832795
#define sqr(x) (x)*(x)
#define forn(i, n) for(int i = 0; i < n; ++i)
#define ALL(x) x.begin(), x.end()
#define F first
#define S second
#define m0(x) memset(x,0,sizeof(x))
#define CC(x) cout << (x) << "\n"
#define pw(x) (1ull<<(x)).

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int,int> pii;
const int INF = 2147483647;
const ll LLINF = 9223372036854775807LL;

int n,a,b;
int h[15];
int mi=INF;
int now[15], ans[15];

void dfs(int pos, int moves) {
   if (pos==n) {
      if (h[pos]>=0 || h[pos-1]>=0) return;
      if (moves<mi) {
        mi=moves;
        for(int i=1;i<=n;i++) ans[i]=now[i];
      }
      return;
   }
   int sum=0;
   for(int i=1;i<=n;i++) sum+=max(0, h[i]+1);
   int count = moves + (int)(sum/(double)(a+2*b)+0.5);
   if (count>=mi) return;

   for(int co=0;;co++){
     h[pos-1]-=b*co;
     h[pos]-=a*co;
     h[pos+1]-=b*co;

     if (h[pos-1]<0) {
       now[pos]=co;
       dfs(pos+1, moves+co);
     }
     bool br= h[pos-1]<0 && h[pos]<0 && h[pos+1]<0;
     h[pos-1]+=b*co;
     h[pos]+=a*co;
     h[pos+1]+=b*co;
     if (br) break;
   }
}

int main() {
  cin >> n >> a >> b;
  for(int i=1; i<=n; i++) cin >> h[i];
  dfs(2,0);
  CC(mi);
  for(int i=1;i<=n; i++) for(int k=1; k<=ans[i]; k++) cout << i << " ";
  return 0;
}


#include <cstdio>
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <queue>
#include <map>
#include <set>
#include <cmath>
#include <sstream>
#include <stack>
#include <cassert>

#define pb push_back
#define mp make_pair
#define PI 3.1415926535897932384626433832795
#define sqr(x) (x)*(x)
#define forn(i, n) for(int i = 0; i < n; ++i)
#define ALL(x) x.begin(), x.end()
#define F first
#define S second
#define m0(x) memset(x,0,sizeof(x))
#define CC(x) cout << (x) << "\n"
#define pw(x) (1ull<<(x)).

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int,int> pii;
const int INF = 2147483647;
const ll LLINF = 9223372036854775807LL;

int n,a,b;
int h[15];
int mi=INF;
int now[15], ans[15];

void dfs(int pos, int moves) {
   if (pos==n-1) {
     moves+=max((int)((double)h[pos-1]/b+0.5), max( (int)((double)h[pos]/a+0.5), (int)((double)h[pos+1]/b+0.5) );
     dfs(n, moves);
     return;
   }
   if (pos==n) {
      if (h[pos]>=0 || h[pos-1]>=0) return;
      if (moves<mi) {
        mi=moves;
        for(int i=1;i<=n;i++) ans[i]=now[i];
      }
      return;
   }
   int sum=0;
   for(int i=1;i<=n;i++) sum+=max(0, h[i]+1);
   int count = moves + (int)(sum/(double)(a+2*b)+0.5);
   if (count>=mi) return;

   for(int co=0;;co++){
     h[pos-1]-=b*co;
     h[pos]-=a*co;
     h[pos+1]-=b*co;

     if (h[pos-1]<0) {
       now[pos]=co;
       dfs(pos+1, moves+co);
     }
     bool br= h[pos-1]<0 && h[pos]<0 && h[pos+1]<0;
     h[pos-1]+=b*co;
     h[pos]+=a*co;
     h[pos+1]+=b*co;
     if (br) break;
   }
}

int main() {
  scanf("%d %d %d", &n, &a, &b);
  for(int i=1; i<=n; i++) scanf("%d", &h[i]);
  dfs(2,0);
  CC(mi);
  for(int i=1;i<=n; i++) for(int k=1; k<=ans[i]; k++) printf("%d ", i);
  return 0;
}


#include <cstdio>
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <queue>
#include <map>
#include <set>
#include <cmath>
#include <sstream>
#include <stack>
#include <cassert>

#define pb push_back
#define mp make_pair
#define PI 3.1415926535897932384626433832795
#define sqr(x) (x)*(x)
#define forn(i, n) for(int i = 0; i < n; ++i)
#define ALL(x) x.begin(), x.end()
#define F first
#define S second
#define m0(x) memset(x,0,sizeof(x))
#define CC(x) cout << (x) << "\n"
#define pw(x) (1ull<<(x)).

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int,int> pii;
const int INF = 2147483647;
const ll LLINF = 9223372036854775807LL;

int n,a,b;
int h[15];
int mi=INF;
int now[15], ans[15];

void dfs(int pos, int moves) {
   if (pos==n-1) {
     int to =max((int)((double)(h[pos-1]+1)/b+0.5), max( (int)((double)(h[pos]+1)/a+0.5), (int)((double)(h[pos+1]+1)/b+0.5)) );
     now[pos] = to;
dfs(n, moves+to);
   return;
   }
   if (pos==n) {
      if (moves<mi) {
        mi=moves;
        for(int i=1;i<=n;i++) ans[i]=now[i];
      }
      return;
   }
   int sum=0;
   for(int i=1;i<=n;i++) sum+=max(0, h[i]+1);
   int count = moves + (int)(sum/(double)(a+2*b)+0.5);
   if (count>=mi) return;

   for(int co=0;;co++){
     h[pos-1]-=b*co;
     h[pos]-=a*co;
     h[pos+1]-=b*co;

     if (h[pos-1]<0) {
       now[pos]=co;
       dfs(pos+1, moves+co);
     }
     bool br= h[pos-1]<0 && h[pos]<0;
     h[pos-1]+=b*co;
     h[pos]+=a*co;
     h[pos+1]+=b*co;
     if (br) break;
   }
}

int main() {
  scanf("%d %d %d", &n, &a, &b);
  for(int i=1; i<=n; i++) scanf("%d", &h[i]);
  dfs(2,0);
  CC(mi);
  for(int i=1;i<=n; i++) for(int k=1; k<=ans[i]; k++) printf("%d ", i);
  return 0;
}


#include <cstdio>
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <queue>
#include <map>
#include <set>
#include <cmath>
#include <sstream>
#include <stack>
#include <cassert>

#define pb push_back
#define mp make_pair
#define PI 3.1415926535897932384626433832795
#define sqr(x) (x)*(x)
#define forn(i, n) for(int i = 0; i < n; ++i)
#define ALL(x) x.begin(), x.end()
#define F first
#define S second
#define m0(x) memset(x,0,sizeof(x))
#define CC(x) cout << (x) << "\n"
#define pw(x) (1ull<<(x)).

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int,int> pii;
const int INF = 2147483647;
const ll LLINF = 9223372036854775807LL;

int n,a,b;
int h[15];
int mi=INF;
vector<int> ans;
vector<int> now;

void dfs(int k) {
  int sum=0;
  int c=0;
  for(int i=1; i<=n;i++) {
    sum+=h[i];
    if (h[i]>=0) c++;
  }

  if (c==0) {
    if (mi>k) {
      mi=k;
      ans=now;
    }
    return;
  }
  if (k+sum/(a+2*b)>mi) return;
  for(int i=2; i<=n-1; i++) {
    int h1 = h[i-1], h2=h[i], h3=h[i+1];
    if (h1<0 && h2<0 && h3<0) continue;
    h[i-1]-=b;
    h[i]-=a;
    h[i+1]-=b;
    now.push_back(i);
    dfs(k+1);
    now.pop_back();
    h[i-1]=h1; h[i]=h2; h[i+1]=h3;
  }
}

int main() {
  cin >> n >> a >> b;
  for(int i=1; i<=n; i++) cin >> h[i];
  dfs(0);
  CC(mi);
  forn(i,ans.size()) cout << ans[i] << " ";
  return 0;
}


#include <cstdio>
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <queue>
#include <map>
#include <set>
#include <cmath>
#include <sstream>
#include <stack>
#include <cassert>

#define pb push_back
#define mp make_pair
#define PI 3.1415926535897932384626433832795
#define sqr(x) (x)*(x)
#define forn(i, n) for(int i = 0; i < n; ++i)
#define ALL(x) x.begin(), x.end()
#define F first
#define S second
#define m0(x) memset(x,0,sizeof(x))
#define CC(x) cout << (x) << "\n"
#define pw(x) (1ull<<(x)).

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int,int> pii;
const int INF = 2147483647;
const ll LLINF = 9223372036854775807LL;

int n,a,b;
int h[15];
int mi=INF;
int now[15], ans[15];

void dfs(int pos, int moves) {
   if (pos==n-1) {
     int to =max((int)((double)(h[pos-1]+1)/b+0.5), max( (int)((double)(h[pos]+1)/a+0.5), (int)((double)(h[pos+1]+1)/b+0.5)) );
     now[pos] = to;
dfs(n, moves+to);
   }
   if (pos==n) {
      if (moves<mi) {
        mi=moves;
        for(int i=1;i<=n;i++) ans[i]=now[i];
      }
      return;
   }
   int sum=0;
   for(int i=1;i<=n;i++) sum+=max(0, h[i]+1);
   int count = moves + (int)(sum/(double)(a+2*b)+0.5);
   if (count>=mi) return;

   for(int co=0;;co++){
     h[pos-1]-=b*co;
     h[pos]-=a*co;
     h[pos+1]-=b*co;

     if (h[pos-1]<0) {
       now[pos]=co;
       dfs(pos+1, moves+co);
     }
     bool br= h[pos-1]<0 && h[pos]<0;
     h[pos-1]+=b*co;
     h[pos]+=a*co;
     h[pos+1]+=b*co;
     if (br) break;
   }
}

int main() {
  scanf("%d %d %d", &n, &a, &b);
  for(int i=1; i<=n; i++) scanf("%d", &h[i]);
  dfs(2,0);
  CC(mi);
  for(int i=1;i<=n; i++) for(int k=1; k<=ans[i]; k++) printf("%d ", i);
  return 0;
}


#include <cstdio>
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <queue>
#include <map>
#include <set>
#include <cmath>
#include <sstream>
#include <stack>
#include <cassert>

#define pb push_back
#define mp make_pair
#define PI 3.1415926535897932384626433832795
#define sqr(x) (x)*(x)
#define forn(i, n) for(int i = 0; i < n; ++i)
#define ALL(x) x.begin(), x.end()
#define F first
#define S second
#define m0(x) memset(x,0,sizeof(x))
#define CC(x) cout << (x) << "\n"
#define pw(x) (1ull<<(x)).

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int,int> pii;
const int INF = 2147483647;
const ll LLINF = 9223372036854775807LL;

int n,a,b;
int h[15];
int mi=INF;
int now[15], ans[15];

void dfs(int pos, int moves) {
   if (pos==n-1) {
     moves+=max((int)((double)h[pos-1]/b+0.5), max( (int)((double)h[pos]/a+0.5), (int)((double)h[pos+1]/b+0.5)) );
     dfs(n, moves);
   }
   if (pos==n) {
      if (h[pos]>=0 || h[pos-1]>=0) return;
      if (moves<mi) {
        mi=moves;
        for(int i=1;i<=n;i++) ans[i]=now[i];
      }
      return;
   }
   int sum=0;
   for(int i=1;i<=n;i++) sum+=max(0, h[i]+1);
   int count = moves + (int)(sum/(double)(a+2*b)+0.5);
   if (count>=mi) return;

   for(int co=0;;co++){
     h[pos-1]-=b*co;
     h[pos]-=a*co;
     h[pos+1]-=b*co;

     if (h[pos-1]<0) {
       now[pos]=co;
       dfs(pos+1, moves+co);
     }
     bool br= h[pos-1]<0 && h[pos]<0;
     h[pos-1]+=b*co;
     h[pos]+=a*co;
     h[pos+1]+=b*co;
     if (br) break;
   }
}

int main() {
  scanf("%d %d %d", &n, &a, &b);
  for(int i=1; i<=n; i++) scanf("%d", &h[i]);
  dfs(2,0);
  CC(mi);
  for(int i=1;i<=n; i++) for(int k=1; k<=ans[i]; k++) printf("%d ", i);
  return 0;
}


#include <cstdio>
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <queue>
#include <map>
#include <set>
#include <cmath>
#include <sstream>
#include <stack>
#include <cassert>

#define pb push_back
#define mp make_pair
#define PI 3.1415926535897932384626433832795
#define sqr(x) (x)*(x)
#define forn(i, n) for(int i = 0; i < n; ++i)
#define ALL(x) x.begin(), x.end()
#define F first
#define S second
#define m0(x) memset(x,0,sizeof(x))
#define CC(x) cout << (x) << "\n"
#define pw(x) (1ull<<(x)).

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int,int> pii;
const int INF = 2147483647;
const ll LLINF = 9223372036854775807LL;

int n,a,b;
int h[15];
int mi=INF;
int now[15], ans[15];

void dfs(int pos, int moves) {
   if (pos==n-1) {
     int to =max((int)((double)(h[pos-1]+1)/b+0.99), max( (int)((double)(h[pos]+1)/a+0.99), (int)((double)(h[pos+1]+1)/b+0.99)) );
     now[pos] = to;
dfs(n, moves+to);
  return;
   }
   if (pos==n) {
      if (moves<mi) {
        mi=moves;
        for(int i=1;i<=n;i++) ans[i]=now[i];
      }
      return;
   }
   int sum=0;
   for(int i=1;i<=n;i++) sum+=max(0, h[i]+1);
   int count = moves + (int)(sum/(double)(a+2*b)+0.5);
   if (count>=mi) return;

   for(int co=0;;co++){
     h[pos-1]-=b*co;
     h[pos]-=a*co;
     h[pos+1]-=b*co;

     if (h[pos-1]<0) {
       now[pos]=co;
       dfs(pos+1, moves+co);
     }
     bool br= h[pos-1]<0 && h[pos]<0;
     h[pos-1]+=b*co;
     h[pos]+=a*co;
     h[pos+1]+=b*co;
     if (br) break;
   }
}

int main() {
  scanf("%d %d %d", &n, &a, &b);
  for(int i=1; i<=n; i++) scanf("%d", &h[i]);
  dfs(2,0);
  CC(mi);
  for(int i=1;i<=n; i++) for(int k=1; k<=ans[i]; k++) printf("%d ", i);
  return 0;
}


#include <cstdio>
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <queue>
#include <map>
#include <set>
#include <cmath>
#include <sstream>
#include <stack>
#include <cassert>

#define pb push_back
#define mp make_pair
#define PI 3.1415926535897932384626433832795
#define sqr(x) (x)*(x)
#define forn(i, n) for(int i = 0; i < n; ++i)
#define ALL(x) x.begin(), x.end()
#define F first
#define S second
#define m0(x) memset(x,0,sizeof(x))
#define CC(x) cout << (x) << "\n"
#define pw(x) (1ull<<(x)).

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int,int> pii;
const int INF = 2147483647;
const ll LLINF = 9223372036854775807LL;

int n,a,b;
int h[15];
int mi=INF;
int now[15], ans[15];

void dfs(int pos, int moves) {
   if (pos==n-1) {
     moves+=max((int)((double)h[pos-1]/b+0.5), max( (int)((double)h[pos]/a+0.5), (int)((double)h[pos+1]/b+0.5)) );
     dfs(n, moves);
   }
   if (pos==n) {
      if (h[pos]>=0 || h[pos-1]>=0) return;
      if (moves<mi) {
        mi=moves;
        for(int i=1;i<=n;i++) ans[i]=now[i];
      }
      return;
   }
   int sum=0;
   for(int i=1;i<=n;i++) sum+=max(0, h[i]+1);
   int count = moves + (int)(sum/(double)(a+2*b)+0.5);
   if (count>=mi) return;

   for(int co=0;;co++){
     h[pos-1]-=b*co;
     h[pos]-=a*co;
     h[pos+1]-=b*co;

     if (h[pos-1]<0) {
       now[pos]=co;
       dfs(pos+1, moves+co);
     }
     bool br= h[pos-1]<0 && h[pos]<0 && h[pos+1]<0;
     h[pos-1]+=b*co;
     h[pos]+=a*co;
     h[pos+1]+=b*co;
     if (br) break;
   }
}

int main() {
  scanf("%d %d %d", &n, &a, &b);
  for(int i=1; i<=n; i++) scanf("%d", &h[i]);
  dfs(2,0);
  CC(mi);
  for(int i=1;i<=n; i++) for(int k=1; k<=ans[i]; k++) printf("%d ", i);
  return 0;
}


#include <cstdio>
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <queue>
#include <map>
#include <set>
#include <cmath>
#include <sstream>
#include <stack>
#include <cassert>

#define pb push_back
#define mp make_pair
#define PI 3.1415926535897932384626433832795
#define sqr(x) (x)*(x)
#define forn(i, n) for(int i = 0; i < n; ++i)
#define ALL(x) x.begin(), x.end()
#define F first
#define S second
#define m0(x) memset(x,0,sizeof(x))
#define CC(x) cout << (x) << "\n"
#define pw(x) (1ull<<(x)).

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int,int> pii;
const int INF = 2147483647;
const ll LLINF = 9223372036854775807LL;

int n,a,b;
int h[15];
int mi=INF;
int now[15], ans[15];

void dfs(int pos, int moves) {
   if (pos==n-1) {
     moves+=max((int)((double)h[pos-1]/b+0.5), max( (int)((double)h[pos]/a+0.5), (int)((double)h[pos+1]/b+0.5) );
     dfs(n, moves);
   }
   if (pos==n) {
      if (h[pos]>=0 || h[pos-1]>=0) return;
      if (moves<mi) {
        mi=moves;
        for(int i=1;i<=n;i++) ans[i]=now[i];
      }
      return;
   }
   int sum=0;
   for(int i=1;i<=n;i++) sum+=max(0, h[i]+1);
   int count = moves + (int)(sum/(double)(a+2*b)+0.5);
   if (count>=mi) return;

   for(int co=0;;co++){
     h[pos-1]-=b*co;
     h[pos]-=a*co;
     h[pos+1]-=b*co;

     if (h[pos-1]<0) {
       now[pos]=co;
       dfs(pos+1, moves+co);
     }
     bool br= h[pos-1]<0 && h[pos]<0 && h[pos+1]<0;
     h[pos-1]+=b*co;
     h[pos]+=a*co;
     h[pos+1]+=b*co;
     if (br) break;
   }
}

int main() {
  scanf("%d %d %d", &n, &a, &b);
  for(int i=1; i<=n; i++) scanf("%d", &h[i]);
  dfs(2,0);
  CC(mi);
  for(int i=1;i<=n; i++) for(int k=1; k<=ans[i]; k++) printf("%d ", i);
  return 0;
}


#include <cstdio>
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <queue>
#include <map>
#include <set>
#include <cmath>
#include <sstream>
#include <stack>
#include <cassert>

#define pb push_back
#define mp make_pair
#define PI 3.1415926535897932384626433832795
#define sqr(x) (x)*(x)
#define forn(i, n) for(int i = 0; i < n; ++i)
#define ALL(x) x.begin(), x.end()
#define F first
#define S second
#define m0(x) memset(x,0,sizeof(x))
#define CC(x) cout << (x) << "\n"
#define pw(x) (1ull<<(x)).

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int,int> pii;
const int INF = 2147483647;
const ll LLINF = 9223372036854775807LL;

int n,a,b;
int h[15];
int mi=INF;
int now[15], ans[15];

void dfs(int pos, int moves) {
   if (pos==n) {
      if (h[pos]>=0 || h[pos-1]>=0) return;
      if (moves<mi) {
        mi=moves;
        for(int i=1;i<=n;i++) ans[i]=now[i];
      }
      return;
   }
   int sum=0;
   for(int i=1;i<=n;i++) sum+=max(0, h[i]+1);
   int count = moves + (int)(sum/(double)(a+2*b)+0.5);
   if (count>=mi) return;

   for(int co=0;;co++){
     h[pos-1]-=b*co;
     h[pos]-=a*co;
     h[pos+1]-=b*co;

     if (h[pos-1]<0) {
       now[pos]=co;
       dfs(pos+1, moves+co);
     }
     bool br= h[pos-1]<0 && h[pos]<0 && h[pos+1]<0;
     h[pos-1]+=b*co;
     h[pos]+=a*co;
     h[pos+1]+=b*co;
     if (br) break;
   }
}

int main() {
  scanf("%d %d %d", &n, &a, &b);
  for(int i=1; i<=n; i++) scanf("%d", &h[i]);
  dfs(2,0);
  CC(mi);
  for(int i=1;i<=n; i++) for(int k=1; k<=ans[i]; k++) printf("%d ", i);
  return 0;
}


#include <cstdio>
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <queue>
#include <map>
#include <set>
#include <cmath>
#include <sstream>
#include <stack>
#include <cassert>

#define pb push_back
#define mp make_pair
#define PI 3.1415926535897932384626433832795
#define sqr(x) (x)*(x)
#define forn(i, n) for(int i = 0; i < n; ++i)
#define ALL(x) x.begin(), x.end()
#define F first
#define S second
#define m0(x) memset(x,0,sizeof(x))
#define CC(x) cout << (x) << "\n"
#define pw(x) (1ull<<(x)).

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int,int> pii;
const int INF = 2147483647;
const ll LLINF = 9223372036854775807LL;

int n,a,b;
int h[15];
int mi=INF;
int now[15], ans[15];

void dfs(int pos, int moves) {
   if (pos==n) {
      if (h[pos]>=0 || h[pos-1]>=0) return;
      if (moves<mi) {
        mi=moves;
        for(int i=1;i<=n;i++) ans[i]=now[i];
      }
      return;
   }
   int sum=0;
   for(int i=1;i<=n;i++) sum+=max(0, h[i]+1);
   int count = moves + sum/(a+2*b);
   if (count>=mi) return;

   for(int co=0;;co++){
     h[pos-1]-=b*co;
     h[pos]-=a*co;
     h[pos+1]-=b*co;

     if (h[pos-1]<0) {
       now[pos]=co;
       dfs(pos+1, moves+co);
     }
     bool br= h[pos-1]<0 && h[pos]<0 && h[pos+1]<0;
     h[pos-1]+=b*co;
     h[pos]+=a*co;
     h[pos+1]+=b*co;
     if (br) break;
   }
}

int main() {
  cin >> n >> a >> b;
  for(int i=1; i<=n; i++) cin >> h[i];
  dfs(2,0);
  CC(mi);
  for(int i=1;i<=n; i++) for(int k=1; k<=ans[i]; k++) cout << i << " ";
  return 0;
}


#include <cstdio>
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <queue>
#include <map>
#include <set>
#include <cmath>
#include <sstream>
#include <stack>
#include <cassert>

#define pb push_back
#define mp make_pair
#define PI 3.1415926535897932384626433832795
#define sqr(x) (x)*(x)
#define forn(i, n) for(int i = 0; i < n; ++i)
#define ALL(x) x.begin(), x.end()
#define F first
#define S second
#define m0(x) memset(x,0,sizeof(x))
#define CC(x) cout << (x) << "\n"
#define pw(x) (1ull<<(x)).

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int,int> pii;
const int INF = 2147483647;
const ll LLINF = 9223372036854775807LL;

int n,a,b;
int h[15];
int mi=INF;
int now[15], ans[15];

void dfs(int pos, int moves) {
   if (pos==n) {
      if (h[pos]>=0 || h[pos-1]>=0) return;
      if (moves<mi) {
        mi=moves;
        for(int i=1;i<=n;i++) ans[i]=now[i];
      }
      return;
   }
   int sum=0;
   for(int i=1;i<=n;i++) sum+=max(0, h[i]+1);
   int count = moves + (int)(sum/(double)(a+2*b)+0.5);
   if (count>=mi) return;

   for(int co=0;;co++){
     h[pos-1]-=b*co;
     h[pos]-=a*co;
     h[pos+1]-=b*co;

     if (h[pos-1]<0) {
       now[pos]=co;
       dfs(pos+1, moves+co);
     }
     bool br= h[pos-1]<0 && h[pos]<0 && h[pos+1]<0;
     h[pos-1]+=b*co;
     h[pos]+=a*co;
     h[pos+1]+=b*co;
     if (br) break;
   }
}

int main() {
  scanf("%d %d %d", &n, &a, &b;
  for(int i=1; i<=n; i++) scanf("%d", &h[i]);
  dfs(2,0);
  CC(mi);
  for(int i=1;i<=n; i++) for(int k=1; k<=ans[i]; k++) printf("%d ", i);
  return 0;
}