#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]+=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<vector>
#include<list>
#include<map>
#include<set>
#include<deque>
#include<queue>
#include<stack>
#include<bitset>
#include<algorithm>
#include<functional>
#include<numeric>
#include<utility>
#include<iostream>
#include<sstream>
#include<iomanip>
#include<cmath>
#include<cstdlib>
#include<cctype>
#include<string>
#include<cstring>
#include<cstdio>
#include<ctime>
#include<climits>
#include<complex>
#include<cassert>
#define mp make_pair
#define pb push_back
#define sz(x) (int)((x).size())
#define all(x) x.begin(),x.end()
#define clr(x) memset((x),0,sizeof(x))
#define cdp(x) memset((x),-1,sizeof(x))
#define rep(i,n) for (i=0;i<n;i++)
#define Rep(i,a,b) for (i=a;i<=b;i++)
#define ff(i,x) for (i=start[x];i!=-1;i=a[i].next)
#define foreach(e,x) for(__typeof(x.begin()) e=x.begin();e!=x.end();++e)
using namespace std;
const double eps=1e-8;
const double pi=acos(-1.0);
int dblcmp(double d){if (fabs(d)<eps)return 0;return d>eps?1:-1;}
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<string> vs;
typedef pair<int,int> pii;
typedef vector<pii> vpi;
map<vi,int>dp[16],cs[16];
int n,h[16],x,y;
int getdp(int now,vi hp)
{
    if (dp[now].find(hp)!=dp[now].end())return dp[now][hp];
    if (now==n-1)
    {
        //puts("--");
        return 0;
    }
    int ans=111111111;
    //printf("%d\n",now);
    for (int i=0;i<=16;i++)
    {
        vi tmp=hp;
        hp[now]-=i*x;//hp[now]=max(hp[now],0);
        hp[now-1]-=i*y;//hp[now-1]=max(hp[now-1],0);
        hp[now+1]-=i*y;//hp[now+1]=max(hp[now+1],0);
        int f=1,o=0;
        if (hp[now-1]>=0)f=0;
        if (now==n-2&&hp[now]>=0)f=0;
        if (now==n-2&&hp[now+1]>=0)f=0;
        if (hp[now]<0&&hp[now+1]<0&&hp[now-1]<0)o=1;
        if (f)ans=min(ans,i+getdp(now+1,hp));
        hp=tmp;
        if (o)break;
    }
    for (int i=0;i<=16;i++)
    {
        vi tmp=hp;
        hp[now]-=i*x;//hp[now]=max(hp[now],0);
        hp[now-1]-=i*y;//hp[now-1]=max(hp[now-1],0);
        hp[now+1]-=i*y;//hp[now+1]=max(hp[now+1],0);
        int f=1,o=0;
        if (hp[now-1]>=0)f=0;
        if (now==n-2&&hp[now]>=0)f=0;
        if (now==n-2&&hp[now+1]>=0)f=0;
        if (hp[now]<0&&hp[now+1]<0&&hp[now-1]<0)o=1;
        if (f)
        {
            if (ans==i+getdp(now+1,hp))
            {
                cs[now][tmp]=i;
            }
        }
        hp=tmp;
        if (o)break;
    }
    return dp[now][hp]=ans;
}
void pt(int now,vi hp)
{
    if (now==n-1)return;
    int i=cs[now][hp];
    vi tmp=hp;
    hp[now]-=i*x;//hp[now]=max(hp[now],0);
    hp[now-1]-=i*y;//hp[now-1]=max(hp[now-1],0);
    hp[now+1]-=i*y;//hp[now+1]=max(hp[now+1],0);
    while (i--)printf("%d\n",now+1);
    pt(now+1,hp);
}
int main()
{
    int i,j,k;
    scanf("%d%d%d",&n,&x,&y);
    for (i=0;i<n;i++)scanf("%d",h+i);
    vi hh(h,h+n);
    int ans=getdp(1,hh);
    printf("%d\n",ans);
    pt(1,hh);
    return 0;
}


#include<vector>
#include<list>
#include<map>
#include<set>
#include<deque>
#include<queue>
#include<stack>
#include<bitset>
#include<algorithm>
#include<functional>
#include<numeric>
#include<utility>
#include<iostream>
#include<sstream>
#include<iomanip>
#include<cmath>
#include<cstdlib>
#include<cctype>
#include<string>
#include<cstring>
#include<cstdio>
#include<ctime>
#include<climits>
#include<complex>
#include<cassert>
#define mp make_pair
#define pb push_back
#define sz(x) (int)((x).size())
#define all(x) x.begin(),x.end()
#define clr(x) memset((x),0,sizeof(x))
#define cdp(x) memset((x),-1,sizeof(x))
#define rep(i,n) for (i=0;i<n;i++)
#define Rep(i,a,b) for (i=a;i<=b;i++)
#define ff(i,x) for (i=start[x];i!=-1;i=a[i].next)
#define foreach(e,x) for(__typeof(x.begin()) e=x.begin();e!=x.end();++e)
using namespace std;
const double eps=1e-8;
const double pi=acos(-1.0);
int dblcmp(double d){if (fabs(d)<eps)return 0;return d>eps?1:-1;}
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<string> vs;
typedef pair<int,int> pii;
typedef vector<pii> vpi;
int dp[16][27][27],cs[16][27][27];
int n,h[16],x,y;
int getdp(int now,int p1,int p2)//now,l,r
{
    if (dp[now][p1][p2]!=-1)return dp[now][p1][p2];
    if (now==n-1)return 0;
    int ans=111111111;
    int p3=h[now+1];
    int t1=p1,t2=p2,t3=p3;
    for (int i=0;i<=16;i++)
    {
        p1-=i*x;//p1=max(p1,0);
        p2-=i*y;//p2=max(p2,0);
        p3-=i*y;//p3=max(p3,0);
        int f=1;
        if (p2>0)f=0;
        if (now==n-2&&p1>0)f=0;
        if (now==n-2&&p3>0)f=0;
        p1=max(p1,0);p2=max(p2,0);p3=max(p3,0);
        //if (now==1)printf("%d %d\n",i,f);
        if (f)ans=min(ans,i+getdp(now+1,p3,p1));
        p1=t1;p2=t2;p3=t3;
    }
    for (int i=0;i<=16;i++)
    {
        p1-=i*x;//p1=max(p1,0);
        p2-=i*y;//p2=max(p2,0);
        p3-=i*y;//p3=max(p3,0);
        int f=1;
        if (p2>0)f=0;
        if (now==n-2&&p1>0)f=0;
        if (now==n-2&&p3>0)f=0;
        p1=max(p1,0);p2=max(p2,0);p3=max(p3,0);
        if (f)
        {
            if (ans==i+getdp(now+1,p3,p1))
            {
                cs[now][t1][t2]=i;
            }
        }
        p1=t1;p2=t2;p3=t3;
    }
    return dp[now][p1][p2]=ans;
}
void pt(int now,int p1,int p2)
{
    if (now==n-1)return;
    int i=cs[now][p1][p2];
    int p3=h[now+1];
    p1-=i*x;p1=max(p1,0);
    p2-=i*y;p2=max(p2,0);
    p3-=i*y;p3=max(p3,0);
    while (i--)printf("%d\n",now+1);
    pt(now+1,p3,p1);
}
int main()
{
    int i,j,k;
    scanf("%d%d%d",&n,&x,&y);
    for (i=0;i<n;i++)
    {
        scanf("%d",h+i);h[i]++;
    }
    cdp(dp);
    int ans=getdp(1,h[1],h[0]);
    printf("%d\n",ans);
    pt(1,h[1],h[0]);
    return 0;
}


#include<vector>
#include<list>
#include<map>
#include<set>
#include<deque>
#include<queue>
#include<stack>
#include<bitset>
#include<algorithm>
#include<functional>
#include<numeric>
#include<utility>
#include<iostream>
#include<sstream>
#include<iomanip>
#include<cmath>
#include<cstdlib>
#include<cctype>
#include<string>
#include<cstring>
#include<cstdio>
#include<ctime>
#include<climits>
#include<complex>
#include<cassert>
#define mp make_pair
#define pb push_back
#define sz(x) (int)((x).size())
#define all(x) x.begin(),x.end()
#define clr(x) memset((x),0,sizeof(x))
#define cdp(x) memset((x),-1,sizeof(x))
#define rep(i,n) for (i=0;i<n;i++)
#define Rep(i,a,b) for (i=a;i<=b;i++)
#define ff(i,x) for (i=start[x];i!=-1;i=a[i].next)
#define foreach(e,x) for(__typeof(x.begin()) e=x.begin();e!=x.end();++e)
using namespace std;
const double eps=1e-8;
const double pi=acos(-1.0);
int dblcmp(double d){if (fabs(d)<eps)return 0;return d>eps?1:-1;}
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<string> vs;
typedef pair<int,int> pii;
typedef vector<pii> vpi;
map<vi,int>dp[16],cs[16];
int n,h[16],x,y;
int getdp(int now,vi hp)
{
    if (dp[now].find(hp)!=dp[now].end())return dp[now][hp];
    if (now==n-1)return 0;
    int ans=111111111;
    for (int i=0;i<=16;i++)
    {
        vi tmp=hp;
        hp[now]-=i*x;//hp[now]=max(hp[now],0);
        hp[now-1]-=i*y;//hp[now-1]=max(hp[now-1],0);
        hp[now+1]-=i*y;//hp[now+1]=max(hp[now+1],0);
        int f=1;
        if (hp[now-1]>=0)f=0;
        if (now==n-2&&hp[now]>=0)f=0;
        if (now==n-2&&hp[now+1]>=0)f=0;
        if (f)ans=min(ans,i+getdp(now+1,hp));
        hp=tmp;
    }
    for (int i=0;i<=16;i++)
    {
        vi tmp=hp;
        hp[now]-=i*x;//hp[now]=max(hp[now],0);
        hp[now-1]-=i*y;//hp[now-1]=max(hp[now-1],0);
        hp[now+1]-=i*y;//hp[now+1]=max(hp[now+1],0);
        int f=1;
        if (hp[now-1]>=0)f=0;
        if (now==n-2&&hp[now]>=0)f=0;
        if (now==n-2&&hp[now+1]>=0)f=0;
        if (f)
        {
            if (ans==i+getdp(now+1,hp))
            {
                cs[now][tmp]=i;
            }
        }
        hp=tmp;
    }
    return dp[now][hp]=ans;
}
void pt(int now,vi hp)
{
    if (now==n-1)return;
    int i=cs[now][hp];
    vi tmp=hp;
    hp[now]-=i*x;//hp[now]=max(hp[now],0);
    hp[now-1]-=i*y;//hp[now-1]=max(hp[now-1],0);
    hp[now+1]-=i*y;//hp[now+1]=max(hp[now+1],0);
    while (i--)printf("%d\n",now+1);
    pt(now+1,hp);
}
int main()
{
    int i,j,k;
    scanf("%d%d%d",&n,&x,&y);
    for (i=0;i<n;i++)scanf("%d",h+i);
    vi hh(h,h+n);
    int ans=getdp(1,hh);
    printf("%d\n",ans);
    pt(1,hh);
    return 0;
}


#include<vector>
#include<list>
#include<map>
#include<set>
#include<deque>
#include<queue>
#include<stack>
#include<bitset>
#include<algorithm>
#include<functional>
#include<numeric>
#include<utility>
#include<iostream>
#include<sstream>
#include<iomanip>
#include<cmath>
#include<cstdlib>
#include<cctype>
#include<string>
#include<cstring>
#include<cstdio>
#include<ctime>
#include<climits>
#include<complex>
#include<cassert>
#define mp make_pair
#define pb push_back
#define sz(x) (int)((x).size())
#define all(x) x.begin(),x.end()
#define clr(x) memset((x),0,sizeof(x))
#define cdp(x) memset((x),-1,sizeof(x))
#define rep(i,n) for (i=0;i<n;i++)
#define Rep(i,a,b) for (i=a;i<=b;i++)
#define ff(i,x) for (i=start[x];i!=-1;i=a[i].next)
#define foreach(e,x) for(__typeof(x.begin()) e=x.begin();e!=x.end();++e)
using namespace std;
const double eps=1e-8;
const double pi=acos(-1.0);
int dblcmp(double d){if (fabs(d)<eps)return 0;return d>eps?1:-1;}
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<string> vs;
typedef pair<int,int> pii;
typedef vector<pii> vpi;
map<vi,int>dp[16],cs[16];
int n,h[16],x,y;
int getdp(int now,vi hp)
{
    if (dp[now].find(hp)!=dp[now].end())return dp[now][hp];
    if (now==n-1)return 0;
    int ans=111111111;
    for (int i=0;i<=16;i++)
    {
        vi tmp=hp;
        hp[now]-=i*x;hp[now]=max(hp[now],-1);
        hp[now-1]-=i*y;hp[now-1]=max(hp[now-1],-1);
        hp[now+1]-=i*y;hp[now+1]=max(hp[now+1],-1);
        int f=1;
        if (hp[now-1]>=0)f=0;
        if (now==n-2&&hp[now]>=0)f=0;
        if (now==n-2&&hp[now+1]>=0)f=0;
        if (f)ans=min(ans,i+getdp(now+1,hp));
        hp=tmp;
    }
    for (int i=0;i<=16;i++)
    {
        vi tmp=hp;
        hp[now]-=i*x;hp[now]=max(hp[now],-1);
        hp[now-1]-=i*y;hp[now-1]=max(hp[now-1],-1);
        hp[now+1]-=i*y;hp[now+1]=max(hp[now+1],-1);
        int f=1;
        if (hp[now-1]>=0)f=0;
        if (now==n-2&&hp[now]>=0)f=0;
        if (now==n-2&&hp[now+1]>=0)f=0;
        if (f)
        {
            if (ans==i+getdp(now+1,hp))
            {
                cs[now][tmp]=i;
            }
        }
        hp=tmp;
    }
    return dp[now][hp]=ans;
}
void pt(int now,vi hp)
{
    if (now==n-1)return;
    int i=cs[now][hp];
    vi tmp=hp;
    hp[now]-=i*x;hp[now]=max(hp[now],-1);
    hp[now-1]-=i*y;hp[now-1]=max(hp[now-1],-1);
    hp[now+1]-=i*y;hp[now+1]=max(hp[now+1],-1);
    while (i--)printf("%d\n",now+1);
    pt(now+1,hp);
}
int main()
{
    int i,j,k;
    scanf("%d%d%d",&n,&x,&y);
    for (i=0;i<n;i++)scanf("%d",h+i);
    vi hh(h,h+n);
    int ans=getdp(1,hh);
    printf("%d\n",ans);
    pt(1,hh);
    return 0;
}


#include<vector>
#include<list>
#include<map>
#include<set>
#include<deque>
#include<queue>
#include<stack>
#include<bitset>
#include<algorithm>
#include<functional>
#include<numeric>
#include<utility>
#include<iostream>
#include<sstream>
#include<iomanip>
#include<cmath>
#include<cstdlib>
#include<cctype>
#include<string>
#include<cstring>
#include<cstdio>
#include<ctime>
#include<climits>
#include<complex>
#include<cassert>
#define mp make_pair
#define pb push_back
#define sz(x) (int)((x).size())
#define all(x) x.begin(),x.end()
#define clr(x) memset((x),0,sizeof(x))
#define cdp(x) memset((x),-1,sizeof(x))
#define rep(i,n) for (i=0;i<n;i++)
#define Rep(i,a,b) for (i=a;i<=b;i++)
#define ff(i,x) for (i=start[x];i!=-1;i=a[i].next)
#define foreach(e,x) for(__typeof(x.begin()) e=x.begin();e!=x.end();++e)
using namespace std;
const double eps=1e-8;
const double pi=acos(-1.0);
int dblcmp(double d){if (fabs(d)<eps)return 0;return d>eps?1:-1;}
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<string> vs;
typedef pair<int,int> pii;
typedef vector<pii> vpi;
map<vi,int>dp[16],cs[16];
int n,h[16],x,y;
int getdp(int now,vi hp)
{
    if (dp[now].find(hp)!=dp[now].end())return dp[now][hp];
    if (now==n-1)return 0;
    int rem=(hp[now-1]+(y-1))/y+1;
    if (now==n-2)
    {
        rem=max(rem,(hp[now]+x-1)/x+1);
        rem=max(rem,(hp[now+1]+y-1)/y+1);
    }
    //if (now==1)printf("rem=%d\n",rem);
    int ans=111111111;
    for (int i=rem;i<=16;i++)
    {
        vi tmp=hp;
        hp[now]-=i*x;hp[now]=max(hp[now],0);
        hp[now-1]-=i*y;hp[now-1]=max(hp[now-1],0);
        hp[now+1]-=i*y;hp[now+1]=max(hp[now+1],0);
        ans=min(ans,i+getdp(now+1,hp));
        hp=tmp;
    }
    for (int i=rem;i<=16;i++)
    {
        vi tmp=hp;
        hp[now]-=i*x;hp[now]=max(hp[now],0);
        hp[now-1]-=i*y;hp[now-1]=max(hp[now-1],0);
        hp[now+1]-=i*y;hp[now+1]=max(hp[now+1],0);
        if (ans==i+getdp(now+1,hp))
        {
            cs[now][tmp]=i;
        }
        hp=tmp;
    }
    return dp[now][hp]=ans;
}
void pt(int now,vi hp)
{
    if (now==n-1)return;
    int i=cs[now][hp];
    vi tmp=hp;
    hp[now]-=i*x;hp[now]=max(hp[now],0);
    hp[now-1]-=i*y;hp[now-1]=max(hp[now-1],0);
    hp[now+1]-=i*y;hp[now+1]=max(hp[now+1],0);
    while (i--)printf("%d\n",now+1);
    pt(now+1,hp);
}
int main()
{
    int i,j,k;
    scanf("%d%d%d",&n,&x,&y);
    for (i=0;i<n;i++)scanf("%d",h+i);
    vi hh(h,h+n);
    int ans=getdp(1,hh);
    printf("%d\n",ans);
    pt(1,hh);
    return 0;
}


#include<vector>
#include<list>
#include<map>
#include<set>
#include<deque>
#include<queue>
#include<stack>
#include<bitset>
#include<algorithm>
#include<functional>
#include<numeric>
#include<utility>
#include<iostream>
#include<sstream>
#include<iomanip>
#include<cmath>
#include<cstdlib>
#include<cctype>
#include<string>
#include<cstring>
#include<cstdio>
#include<ctime>
#include<climits>
#include<complex>
#include<cassert>
#define mp make_pair
#define pb push_back
#define sz(x) (int)((x).size())
#define all(x) x.begin(),x.end()
#define clr(x) memset((x),0,sizeof(x))
#define cdp(x) memset((x),-1,sizeof(x))
#define rep(i,n) for (i=0;i<n;i++)
#define Rep(i,a,b) for (i=a;i<=b;i++)
#define ff(i,x) for (i=start[x];i!=-1;i=a[i].next)
#define foreach(e,x) for(__typeof(x.begin()) e=x.begin();e!=x.end();++e)
using namespace std;
const double eps=1e-8;
const double pi=acos(-1.0);
int dblcmp(double d){if (fabs(d)<eps)return 0;return d>eps?1:-1;}
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<string> vs;
typedef pair<int,int> pii;
typedef vector<pii> vpi;
int dp[16][27][27][27],cs[16][27][27][27];
int n,h[16],x,y;
int getdp(int now,int p1,int p2,int p3)//now,l,r
{
    if (dp[now][p1][p2][p3]!=-1)return dp[now][p1][p2][p3];
    if (now==n-1)return 0;
    int ans=111111111;
    int t1=p1,t2=p2,t3=p3;
    for (int i=0;i<=16;i++)
    {
        p1-=i*x;//p1=max(p1,0);
        p2-=i*y;//p2=max(p2,0);
        p3-=i*y;//p3=max(p3,0);
        int f=1;
        if (p2>0)f=0;
        if (now==n-2&&p1>0)f=0;
        if (now==n-2&&p3>0)f=0;
        p1=max(p1,0);p2=max(p2,0);p3=max(p3,0);
        //if (now==1)printf("%d %d\n",i,f);
        if (f)ans=min(ans,i+getdp(now+1,p3,p1,h[now+2]));
        p1=t1;p2=t2;p3=t3;
    }
    for (int i=0;i<=16;i++)
    {
        p1-=i*x;//p1=max(p1,0);
        p2-=i*y;//p2=max(p2,0);
        p3-=i*y;//p3=max(p3,0);
        int f=1;
        if (p2>0)f=0;
        if (now==n-2&&p1>0)f=0;
        if (now==n-2&&p3>0)f=0;
        p1=max(p1,0);p2=max(p2,0);p3=max(p3,0);
        if (f)
        {
            if (ans==i+getdp(now+1,p3,p1,h[now+2]))
            {
                cs[now][t1][t2][t3]=i;
            }
        }
        p1=t1;p2=t2;p3=t3;
    }
    return dp[now][p1][p2][p3]=ans;
}
void pt(int now,int p1,int p2,int p3)
{
    if (now==n-1)return;
    int i=cs[now][p1][p2][p3];
    p1-=i*x;p1=max(p1,0);
    p2-=i*y;p2=max(p2,0);
    p3-=i*y;p3=max(p3,0);
    while (i--)printf("%d\n",now+1);
    pt(now+1,p3,p1,h[now+2]);
}
int main()
{
    int i,j,k;
    scanf("%d%d%d",&n,&x,&y);
    for (i=0;i<n;i++)
    {
        scanf("%d",h+i);h[i]++;
    }
    cdp(dp);
    int ans=getdp(1,h[1],h[0],h[2]);
    printf("%d\n",ans);
    pt(1,h[1],h[0],h[2]);
    return 0;
}


#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>

using namespace std;

#define MAXN 21

int h[MAXN];

int n,a,b;

int ans=200;

int re[MAXN];
int rec[MAXN];

void dfs(int res[],int deep,int tot)
{
    int i,j;
    if(deep>2)
        if(res[deep-2]>=0)
            return ;
    if(deep==n)
    {
        if(res[deep]>=0 || res[deep-1]>=0)
            return;
        for(i=2;i<n;i++)
            rec[i]=re[i];
        ans=tot;
        return;
    }
    for(i=0;i<=15;i++)
    {
        if(tot+i>=ans) return;
        re[deep]=i;
        res[deep]-=i*a;
        res[deep-1]-=i*b;
        res[deep+1]-=i*b;
        dfs(res,deep+1,tot+i);
        res[deep]+=i*a;
        res[deep-1]+=i*b;
        res[deep+1]+=i*b;
    }
}
int main()
{
    scanf("%d%d%d",&n,&a,&b);
    int i,j;
    memset(re,0,sizeof(re));
    for(i=1;i<=n;i++)
        scanf("%d",&h[i]);
    int t1,t2;
    t1=(h[1]+b)/b;
    t2=(h[n]+b)/b;
    h[1]=-1;
    h[n]=-1;
    if(n==3)
    {
        h[2]-=a*max(t1,t2);
    }
    else
    {
        h[2]-=t1*a;
        h[n-1]-=t2*b;
    }
    dfs(h,2,0);
    if(n==3)
    {
        ans+=max(t1,t2);
        rec[2]+=max(t1,t2);
    }
    else
    {
        ans+=t1+t2;
        rec[2]+=t1;
        rec[n-1]+=t2;
    }
    printf("%d\n",ans);
    for(i=2;i<n;i++)
    {
        for(j=0;j<rec[i];j++)
            printf("%d ",i);
    }
    printf("\n");
    return 0;
}


#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>

using namespace std;

#define MAXN 21

int h[MAXN];

int n,a,b;

int ans=200;

int re[MAXN];
int rec[MAXN];

void dfs(int res[],int deep,int tot)
{
    int i,j;
    if(deep>2)
        if(res[deep-2]>=0)
            return ;
    if(deep==n)
    {
        if(res[deep]>=0 || res[deep-1]>=0)
            return;
        for(i=2;i<n;i++)
            rec[i]=re[i];
        ans=tot;
        return;
    }
    for(i=0;i<=15;i++)
    {
        if(tot+i>=ans) return;
        re[deep]=i;
        res[deep]-=i*a;
        res[deep-1]-=i*b;
        res[deep+1]-=i*b;
        dfs(res,deep+1,tot+i);
        res[deep]+=i*a;
        res[deep-1]+=i*b;
        res[deep+1]+=i*b;
    }
}
int main()
{
    scanf("%d%d%d",&n,&a,&b);
    int i,j;
    memset(re,0,sizeof(re));
    for(i=1;i<=n;i++)
        scanf("%d",&h[i]);
    /*int t1,t2;
    t1=(h[1]+b)/b;
    t2=(h[n]+b)/b;
    h[1]=-1;
    h[n]=-1;
    if(n==3)
    {
        h[2]-=a*max(t1,t2);
    }
    else
    {
        h[2]-=t1*a;
        h[n-1]-=t2*b;
    }

    if(n==3)
    {
        ans+=max(t1,t2);
        rec[2]+=max(t1,t2);
    }
    else
    {
        ans+=t1+t2;
        rec[2]+=t1;
        rec[n-1]+=t2;
    }*/
    dfs(h,2,0);
    printf("%d\n",ans);
    for(i=2;i<n;i++)
    {
        for(j=0;j<rec[i];j++)
            printf("%d ",i);
    }
    printf("\n");
    return 0;
}


#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>

using namespace std;

#define MAXN 21

int h[MAXN];

int n,a,b;

int ans=200;

int re[MAXN];
int rec[MAXN];

void dfs(int res[],int deep,int tot)
{
    int i,j;
    if(ans<tot)
        return ;
    for(i=1;i<deep-1;i++)
            if(res[i]>=0)
                return;
    if(deep==n)
    {
        for(i=1;i<=n;i++)
            if(res[i]>=0)
                return;
        for(i=1;i<=n;i++)
            rec[i]=re[i];
        ans=tot;
        return;
    }
    for(i=0;i<=15;i++)
    {
        re[deep]=i;
        res[deep]-=i*a;
        res[deep-1]-=i*b;
        res[deep+1]-=i*b;
        dfs(res,deep+1,tot+i);
        res[deep]+=i*a;
        res[deep-1]+=i*b;
        res[deep+1]+=i*b;
    }
}
int main()
{
    scanf("%d%d%d",&n,&a,&b);
    int i,j;
    memset(re,0,sizeof(re));
    for(i=1;i<=n;i++)
        scanf("%d",&h[i]);
    dfs(h,2,0);
    printf("%d\n",ans);
    for(i=2;i<n;i++)
    {
        for(j=0;j<rec[i];j++)
            printf("%d ",i);
    }
    printf("\n");
    return 0;
}


#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>

using namespace std;

#define MAXN 21

int h[MAXN];

int n,a,b;

int ans=200;

int re[MAXN];
int rec[MAXN];

void dfs(int res[],int deep,int tot)
{
    int i,j;
    if(ans<=tot)
        return ;
    if(deep>2)
        if(res[deep-2]>=0)
            return ;
    if(deep==n)
    {
        if(res[deep]>=0 || res[deep-1]>=0)
            return;
        for(i=2;i<n;i++)
            rec[i]=re[i];
        ans=tot;
        return;
    }
    for(i=0;i<=15;i++)
    {
        re[deep]=i;
        res[deep]-=i*a;
        res[deep-1]-=i*b;
        res[deep+1]-=i*b;
        dfs(res,deep+1,tot+i);
        res[deep]+=i*a;
        res[deep-1]+=i*b;
        res[deep+1]+=i*b;
    }
}
int main()
{
    scanf("%d%d%d",&n,&a,&b);
    int i,j;
    memset(re,0,sizeof(re));
    for(i=1;i<=n;i++)
        scanf("%d",&h[i]);
    int t1,t2;
    t1=(h[1]+b)/b;
    t2=(h[n]+b)/b;
    h[1]=-1;
    h[n]=-1;
    if(n==3)
    {
        h[2]-=a*max(t1,t2);
    }
    else
    {
        h[2]-=t1*a;
        h[n-1]-=t2*a;
    }
    dfs(h,2,0);
    if(n==3)
    {
        ans+=max(t1,t2);
        rec[2]+=max(t1,t2);
    }
    else
    {
        ans+=t1+t2;
        rec[2]+=t1;
        rec[n-1]+=t2;
    }
    printf("%d\n",ans);
    for(i=2;i<n;i++)
    {
        for(j=0;j<rec[i];j++)
            printf("%d ",i);
    }
    printf("\n");
    return 0;
}


#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>

using namespace std;

#define MAXN 21

int h[MAXN];

int n,a,b;

int ans=200;

int re[MAXN];
int rec[MAXN];

void dfs(int res[],int deep,int tot)
{
    int i,j;
    if(deep>2)
        if(res[deep-2]>=0)
            return ;
    if(deep==n)
    {
        if(res[deep]>=0 || res[deep-1]>=0)
            return;
        for(i=2;i<n;i++)
            rec[i]=re[i];
        ans=tot;
        return;
    }
    for(i=0;i<=15;i++)
    {
        if(tot+i>=ans) return;
        re[deep]=i;
        res[deep]-=i*a;
        res[deep-1]-=i*b;
        res[deep+1]-=i*b;
        dfs(res,deep+1,tot+i);
        res[deep]+=i*a;
        res[deep-1]+=i*b;
        res[deep+1]+=i*b;
    }
}
int main()
{
    scanf("%d%d%d",&n,&a,&b);
    int i,j;
    memset(re,0,sizeof(re));
    for(i=1;i<=n;i++)
        scanf("%d",&h[i]);
    int t1,t2;
    t1=(h[1]+b)/b;
    t2=(h[n]+b)/b;
    h[1]=-1;
    h[n]=-1;
    if(n==3)
    {
        h[2]-=a*max(t1,t2);
    }
    else
    {
        h[2]-=t1*a;
        h[n-1]-=t2*b;
    }
    dfs(h,2,0);
    if(n==3)
        ans+=max(t1,t2);
    else
        ans+=t1+t2;
    printf("%d\n",ans);
    for(i=2;i<n;i++)
    {
        if(i==2)
            rec[2]+=t1;
        else
            rec[n-1]+=t2;
        for(j=0;j<rec[i];j++)
            printf("%d ",i);
    }
    printf("\n");
    return 0;
}


#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>

using namespace std;

#define MAXN 21

int h[MAXN];

int n,a,b;

int ans=200;

int re[MAXN];
int rec[MAXN];

void dfs(int res[],int deep,int tot)
{
    int i,j;
    if(deep>2)
        if(res[deep-2]>=0)
            return ;
    if(deep==n)
    {
        if(res[deep]>=0 || res[deep-1]>=0)
            return;
        for(i=2;i<n;i++)
            rec[i]=re[i];
        ans=tot;
        return;
    }
    for(i=0;i<=15;i++)
    {
        if(tot+i>=ans) return;
        re[deep]=i;
        res[deep]-=i*a;
        res[deep-1]-=i*b;
        res[deep+1]-=i*b;
        dfs(res,deep+1,tot+i);
        res[deep]+=i*a;
        res[deep-1]+=i*b;
        res[deep+1]+=i*b;
    }
}
int main()
{
    scanf("%d%d%d",&n,&a,&b);
    int i,j;
    memset(re,0,sizeof(re));
    for(i=1;i<=n;i++)
        scanf("%d",&h[i]);
    int t1,t2;
    t1=(h[1]+b)/b;
    t2=(h[n]+b)/b;
    h[1]=-1;
    h[n]=-1;
    if(n==3)
    {
        h[2]-=a*max(t1,t2);
    }
    else
    {
        h[2]-=t1*a;
        h[n-1]-=t2*a;
    }
    dfs(h,2,0);
    if(n==3)
    {
        ans+=max(t1,t2);
        rec[2]+=max(t1,t2);
    }
    else
    {
        ans+=t1+t2;
        rec[2]+=t1;
        rec[n-1]+=t2;
    }
    dfs(h,2,0);
    printf("%d\n",ans);
    for(i=2;i<n;i++)
    {
        for(j=0;j<rec[i];j++)
            printf("%d ",i);
    }
    printf("\n");
    return 0;
}


#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>

using namespace std;

#define MAXN 21

int h[MAXN];

int n,a,b;

int ans=200;

int re[MAXN];
int rec[MAXN];

void dfs(int res[],int deep,int tot)
{
    int i,j;
    if(ans<tot)
        return ;
    if(deep>2)
        if(res[deep-2]>=0)
            return ;
    if(deep==n)
    {
        if(res[deep]>=0 || res[deep-1]>=0)
            return;
        for(i=2;i<n;i++)
            rec[i]=re[i];
        ans=tot;
        return;
    }
    for(i=0;i<=15;i++)
    {
        re[deep]=i;
        res[deep]-=i*a;
        res[deep-1]-=i*b;
        res[deep+1]-=i*b;
        dfs(res,deep+1,tot+i);
        res[deep]+=i*a;
        res[deep-1]+=i*b;
        res[deep+1]+=i*b;
    }
}
int main()
{
    scanf("%d%d%d",&n,&a,&b);
    int i,j;
    memset(re,0,sizeof(re));
    for(i=1;i<=n;i++)
        scanf("%d",&h[i]);
    dfs(h,2,0);
    printf("%d\n",ans);
    for(i=2;i<n;i++)
    {
        for(j=0;j<rec[i];j++)
            printf("%d ",i);
    }
    printf("\n");
    return 0;
}


#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>

using namespace std;

#define MAXN 21

int h[MAXN];

int n,a,b;

int ans=200;

int re[MAXN];
int rec[MAXN];

void dfs(int res[],int deep,int tot)
{
    int i,j;
    if(deep>2)
        if(res[deep-2]>=0)
            return ;
    if(deep==n)
    {
        if(res[deep]>=0 || res[deep-1]>=0)
            return;
        for(i=2;i<n;i++)
            rec[i]=re[i];
        ans=tot;
        return;
    }
    for(i=0;i<=15;i++)
    {
        if(tot+i>=ans) return;
        re[deep]=i;
        res[deep]-=i*a;
        res[deep-1]-=i*b;
        res[deep+1]-=i*b;
        dfs(res,deep+1,tot+i);
        res[deep]+=i*a;
        res[deep-1]+=i*b;
        res[deep+1]+=i*b;
    }
}
int main()
{
    scanf("%d%d%d",&n,&a,&b);
    int i,j;
    memset(re,0,sizeof(re));
    for(i=1;i<=n;i++)
        scanf("%d",&h[i]);
    int t1,t2;
    t1=(h[1]+b)/b;
    t2=(h[n]+b)/b;
    h[1]=-1;
    h[n]=-1;
    if(n==3)
    {
        h[2]-=a*max(t1,t2);
    }
    else
    {
        h[2]-=t1*a;
        h[n-1]-=t2*b;
    }
    dfs(h,2,0);
    printf("%d\n",ans+t1+t2);
    for(i=2;i<n;i++)
    {
        if(i==2)
            rec[2]+=t1;
        else
            rec[n-1]+=t2;
        for(j=0;j<rec[i];j++)
            printf("%d ",i);
    }
    printf("\n");
    return 0;
}


#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>

using namespace std;

#define MAXN 21

int h[MAXN];

int n,a,b;

int ans=200;

int re[MAXN];
int rec[MAXN];

void dfs(int res[],int deep,int tot)
{
    int i,j;
    if(ans<=tot)
        return ;
    if(deep>2)
        if(res[deep-2]>=0)
            return ;
    if(deep==n)
    {
        if(res[deep]>=0 || res[deep-1]>=0)
            return;
        for(i=2;i<n;i++)
            rec[i]=re[i];
        ans=tot;
        return;
    }
    for(i=0;i<=15;i++)
    {
        re[deep]=i;
        res[deep]-=i*a;
        res[deep-1]-=i*b;
        res[deep+1]-=i*b;
        dfs(res,deep+1,tot+i);
        res[deep]+=i*a;
        res[deep-1]+=i*b;
        res[deep+1]+=i*b;
    }
}
int main()
{
    scanf("%d%d%d",&n,&a,&b);
    int i,j;
    memset(re,0,sizeof(re));
    for(i=1;i<=n;i++)
        scanf("%d",&h[i]);
    int t1,t2;
    t1=(h[1]+b)/b;
    t2=(h[n]+b)/b;
    h[1]=-1;
    h[n]=-1;
    if(n==3)
    {
        h[2]-=a*max(t1,t2);
    }
    else
    {
        h[2]-=t1*a;
        h[3]-=t1*b;
        h[n-2]-=t2*b;
        h[n-1]-=t2*a;
    }
    dfs(h,2,0);
    if(n==3)
    {
        ans+=max(t1,t2);
        rec[2]+=max(t1,t2);
    }
    else
    {
        ans+=t1+t2;
        rec[2]+=t1;
        rec[n-1]+=t2;
    }
    printf("%d\n",ans);
    for(i=2;i<n;i++)
    {
        for(j=0;j<rec[i];j++)
            printf("%d ",i);
    }
    printf("\n");
    return 0;
}


#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>

using namespace std;

#define MAXN 21

int h[MAXN];

int n,a,b;

int ans=200;

int re[MAXN];
int rec[MAXN];

void dfs(int res[],int deep,int tot)
{
    int i,j;
    if(deep>2)
        if(res[deep-2]>=0)
            return ;
    if(deep==n)
    {
        if(res[deep]>=0 || res[deep-1]>=0)
            return;
        for(i=2;i<n;i++)
            rec[i]=re[i];
        ans=tot;
        return;
    }
    for(i=0;i<=15;i++)
    {
        if(tot+i>=ans) return;
        re[deep]=i;
        res[deep]-=i*a;
        res[deep-1]-=i*b;
        res[deep+1]-=i*b;
        dfs(res,deep+1,tot+i);
        res[deep]+=i*a;
        res[deep-1]+=i*b;
        res[deep+1]+=i*b;
    }
}
int main()
{
    scanf("%d%d%d",&n,&a,&b);
    int i,j;
    memset(re,0,sizeof(re));
    for(i=1;i<=n;i++)
        scanf("%d",&h[i]);
    dfs(h,2,0);
    printf("%d\n",ans);
    for(i=2;i<n;i++)
    {
        for(j=0;j<rec[i];j++)
            printf("%d ",i);
    }
    printf("\n");
    return 0;
}


#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>

using namespace std;

#define MAXN 21

int h[MAXN];

int n,a,b;

int ans=200;

int re[MAXN];
int rec[MAXN];

void dfs(int res[],int deep,int tot)
{
	int i,j;
	if(ans<tot)
		return ;
	if(deep==n)
	{
		for(i=1;i<=n;i++)
			if(res[i]>=0)
				return;
		for(i=1;i<=n;i++)
			rec[i]=re[i];
		ans=tot;
		return;
	}
	for(i=0;i<=15;i++)
	{
	 	re[deep]=i;
		res[deep]-=i*a;
		res[deep-1]-=i*b;
		res[deep+1]-=i*b;
		dfs(res,deep+1,tot+i);
		res[deep]+=i*a;
		res[deep-1]+=i*b;
		res[deep+1]+=i*b;
	}
}
int main()
{
	scanf("%d%d%d",&n,&a,&b);
	int i,j;
	memset(re,0,sizeof(re));
	for(i=1;i<=n;i++)
		scanf("%d",&h[i]);
	dfs(h,2,0);
	printf("%d\n",ans);
	for(i=2;i<n;i++)
	{
		for(j=0;j<rec[i];j++)
			printf("%d ",i);
	}
	printf("\n");
	return 0;
}


#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>

using namespace std;

#define MAXN 21

int h[MAXN];

int n,a,b;

int ans=200;

int re[MAXN];
int rec[MAXN];

void dfs(int res[],int deep,int tot)
{
    int i,j;
    if(deep>2)
        if(res[deep-2]>=0)
            return ;
    if(deep==n)
    {
        if(res[deep]>=0 || res[deep-1]>=0)
            return;
        for(i=2;i<n;i++)
            rec[i]=re[i];
        ans=tot;
        return;
    }
    for(i=0;i<=15;i++)
    {
        if(tot+i>=ans) return;
        re[deep]=i;
        res[deep]-=i*a;
        res[deep-1]-=i*b;
        res[deep+1]-=i*b;
        dfs(res,deep+1,tot+i);
        res[deep]+=i*a;
        res[deep-1]+=i*b;
        res[deep+1]+=i*b;
    }
}
int main()
{
    scanf("%d%d%d",&n,&a,&b);
    int i,j;
    memset(re,0,sizeof(re));
    for(i=1;i<=n;i++)
        scanf("%d",&h[i]);
    /*int t1,t2;
    t1=(h[1]+b)/b;
    t2=(h[n]+b)/b;
    h[1]=-1;
    h[n]=-1;
    if(n==3)
    {
        h[2]-=a*max(t1,t2);
    }
    else
    {
        h[2]-=t1*a;
        h[n-1]-=t2*b;
    }
    dfs(h,2,0);
    if(n==3)
    {
        ans+=max(t1,t2);
        rec[2]+=max(t1,t2);
    }
    else
    {
        ans+=t1+t2;
        rec[2]+=t1;
        rec[n-1]+=t2;
    }*/
    printf("%d\n",ans);
    for(i=2;i<n;i++)
    {
        for(j=0;j<rec[i];j++)
            printf("%d ",i);
    }
    printf("\n");
    return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <cstring>
#include <fstream>
#include <list>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <cmath>
#include <sstream>
#include <deque>
#include <utility>
#include <bitset>
#include <ext/hash_map>

using namespace std;
using namespace __gnu_cxx;

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REV(i,a,b) for(int i=(a);i>=(b);i--)
#define mp make_pair
#define pb push_back
#define oo 2e9
#define MAX 1001
#define sz(v) (int)v.size()
#define all(c) (c).begin(),(c).end()
#define rall(c) (c).rbegin(),(c).rend()
#define iter(it,s) for(it=s.begin();it!=s.end();it++)
#define show(x) cerr<<#x<<" = "<<x<<endl;
#define mem(s,v) memset(s,v,sizeof(s))

typedef long long ll;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<string> vs;
typedef pair<int, int> pi;
typedef vector<pi> vpi;
int N,a,b;
int dp[14][14][14];
int arr[12];
int next[14][14][14];
int sol(int ind,int power,int hits)
{
	if(ind == N-1)
		return (hits * b > arr[N-1])?0:(1<<22);
	if(dp[ind][power+1][hits] != -1)
		return dp[ind][power+1][hits];
	int res = (1<<22);
	int cur = arr[ind] - (hits*b);
	for(int i = 0 ; i <= 11 ; i++ )
	{
		if(power < (i*b))
		{
			int x = sol(ind+1,max(-1,cur-(i*a)),i);
			if(res > i+x)
			{
				res = i+x;
				next[ind][power+1][hits] = i;
			}
		}

	}
	//cout<<ind<<" "<<power<<" "<<hits<<" "<<next[ind][power+1][hits]<<endl;
	return dp[ind][power+1][hits] = res;
}

int main() {
#ifndef ONLINE_JUDGE
	freopen("test.in", "rt", stdin);
	//	freopen("o.txt", "wt", stdout);
#endif
	memset(dp,-1,sizeof dp);
	cin>>N>>a>>b;
	for(int i = 0 ; i < N ; ++i)
		cin>>arr[i];
	cout<<sol(1,arr[0],0)<<endl;
	vector<int> ans;
	int ind = 1,power = arr[0],hits = 0;
	while(ind < N)
	{
		int cur = arr[ind] - (hits*b);
		int xx = next[ind][power+1][hits];
		for(int i = 0 ; i < xx ; i++)
			ans.push_back(ind+1);
		hits = xx;
		ind++;
		power = max(-1,cur-(xx*a));

	}
	string s = "";
	for(int i = 0 ; i < ans.size() ; i++,s = " ")
		cout<<s<<ans[i];
	cout<<endl;
	return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <cstring>
#include <fstream>
#include <list>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <cmath>
#include <sstream>
#include <deque>
#include <utility>
#include <bitset>
#include <ext/hash_map>

using namespace std;
using namespace __gnu_cxx;

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REV(i,a,b) for(int i=(a);i>=(b);i--)
#define mp make_pair
#define pb push_back
#define oo 2e9
#define MAX 1001
#define sz(v) (int)v.size()
#define all(c) (c).begin(),(c).end()
#define rall(c) (c).rbegin(),(c).rend()
#define iter(it,s) for(it=s.begin();it!=s.end();it++)
#define show(x) cerr<<#x<<" = "<<x<<endl;
#define mem(s,v) memset(s,v,sizeof(s))

typedef long long ll;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<string> vs;
typedef pair<int, int> pi;
typedef vector<pi> vpi;
int N,a,b;
int dp[12][12][12];
int arr[12];
int next[12][12][12];
int sol(int ind,int power,int hits)
{
	if(ind == N-1)
		return (hits * b > arr[N-1])?0:(1<<22);
	if(dp[ind][power+1][hits] != -1)
		return dp[ind][power+1][hits];
	int res = (1<<22);
	int cur = arr[ind] - (hits*b);
	for(int i = 0 ; i <= 11 ; i++ )
	{
		if(power < (i*b))
		{
			int x = sol(ind+1,max(-1,cur-(i*a)),i);
			if(res > i+x)
			{
				res = i+x;
				next[ind][power+1][hits] = i;
			}
		}

	}
	//cout<<ind<<" "<<power<<" "<<hits<<" "<<next[ind][power+1][hits]<<endl;
	return dp[ind][power+1][hits] = res;
}

int main() {
#ifndef ONLINE_JUDGE
	freopen("test.in", "rt", stdin);
	//	freopen("o.txt", "wt", stdout);
#endif
	memset(dp,-1,sizeof dp);
	cin>>N>>a>>b;
	for(int i = 0 ; i < N ; ++i)
		cin>>arr[i];
	cout<<sol(1,arr[0],0)<<endl;
	vector<int> ans;
	int ind = 1,power = arr[0],hits = 0;
	while(ind < N)
	{
		int cur = arr[ind] - (hits*b);
		int xx = next[ind][power+1][hits];
		for(int i = 0 ; i < xx ; i++)
			ans.push_back(ind+1);
		hits = xx;
		ind++;
		power = max(-1,cur-(xx*a));

	}
	string s = "";
	for(int i = 0 ; i < ans.size() ; i++,s = " ")
		cout<<s<<ans[i];
	cout<<endl;
	return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <cstring>
#include <fstream>
#include <list>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <cmath>
#include <sstream>
#include <deque>
#include <utility>
#include <bitset>
#include <ext/hash_map>

using namespace std;
using namespace __gnu_cxx;

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REV(i,a,b) for(int i=(a);i>=(b);i--)
#define mp make_pair
#define pb push_back
#define oo 2e9
#define MAX 1001
#define sz(v) (int)v.size()
#define all(c) (c).begin(),(c).end()
#define rall(c) (c).rbegin(),(c).rend()
#define iter(it,s) for(it=s.begin();it!=s.end();it++)
#define show(x) cerr<<#x<<" = "<<x<<endl;
#define mem(s,v) memset(s,v,sizeof(s))

typedef long long ll;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<string> vs;
typedef pair<int, int> pi;
typedef vector<pi> vpi;
int N,a,b;
int dp[12][12][12];
int arr[12];
int next[12][12][12];
int sol(int ind,int power,int hits)
{
	if(ind == N-1)
		return (hits * b > arr[N-1])?0:(1<<22);
	if(dp[ind][power+1][hits] != -1)
		return dp[ind][power+1][hits];
	int res = (1<<22);
	int cur = arr[ind] - (hits*b);
	for(int i = 0 ; i <= 10 ; i++ )
	{
		if(power < (i*b))
		{
			int x = sol(ind+1,max(-1,cur-(i*a)),i);
			if(res > i+x)
			{
				res = i+x;
				next[ind][power+1][hits] = i;
			}
		}

	}
	return dp[ind][power+1][hits] = res;
}

int main() {
#ifndef ONLINE_JUDGE
	freopen("test.in", "rt", stdin);
	//	freopen("o.txt", "wt", stdout);
#endif
	memset(dp,-1,sizeof dp);
	cin>>N>>a>>b;
	for(int i = 0 ; i < N ; ++i)
		cin>>arr[i];
	cout<<sol(1,arr[0],0)<<endl;
	vector<int> ans;
	int ind = 1,power = arr[0],hits = 0;
	while(ind < N)
	{
		int cur = arr[ind] - (hits*b);
		int xx = next[ind][power+1][hits];
		for(int i = 0 ; i < xx ; i++)
			ans.push_back(ind+1);
		hits = xx;
		ind++;
		power = max(-1,cur-(xx*a));

	}
	string s = "";
	for(int i = 0 ; i < ans.size() ; i++,s = " ")
		cout<<s<<ans[i];
	cout<<endl;
	return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <cstring>
#include <fstream>
#include <list>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <cmath>
#include <sstream>
#include <deque>
#include <utility>
#include <bitset>
#include <ext/hash_map>

using namespace std;
using namespace __gnu_cxx;

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REV(i,a,b) for(int i=(a);i>=(b);i--)
#define mp make_pair
#define pb push_back
#define oo 2e9
#define MAX 1001
#define sz(v) (int)v.size()
#define all(c) (c).begin(),(c).end()
#define rall(c) (c).rbegin(),(c).rend()
#define iter(it,s) for(it=s.begin();it!=s.end();it++)
#define show(x) cerr<<#x<<" = "<<x<<endl;
#define mem(s,v) memset(s,v,sizeof(s))

typedef long long ll;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<string> vs;
typedef pair<int, int> pi;
typedef vector<pi> vpi;
int N,a,b;
int dp[12][12][12];
int arr[12];
int next[12][12][12];
int sol(int ind,int power,int hits)
{
	if(ind == N-1)
		return (hits * b > arr[N-1])?0:(1<<22);
	if(dp[ind][power+1][hits] != -1)
		return dp[ind][power+1][hits];
	int res = (1<<22);
	int cur = arr[ind] - (hits*b);
	for(int i = 0 ; i <= 12 ; i++ )
	{
		if(power < (i*b))
		{
			int x = sol(ind+1,max(-1,cur-(i*a)),i);
			if(res > i+x)
			{
				res = i+x;
				next[ind][power+1][hits] = i;
			}
		}

	}
	return dp[ind][power+1][hits] = res;
}

int main() {
#ifndef ONLINE_JUDGE
	freopen("test.in", "rt", stdin);
	//	freopen("o.txt", "wt", stdout);
#endif
	memset(dp,-1,sizeof dp);
	cin>>N>>a>>b;
	for(int i = 0 ; i < N ; ++i)
		cin>>arr[i];
	cout<<sol(1,arr[0],0)<<endl;
	vector<int> ans;
	int ind = 1,power = arr[0],hits = 0;
	while(ind < N)
	{
		int cur = arr[ind] - (hits*b);
		int xx = next[ind][power+1][hits];
		for(int i = 0 ; i < xx ; i++)
			ans.push_back(ind+1);
		hits = xx;
		ind++;
		power = max(-1,cur-(xx*a));

	}
	string s = "";
	for(int i = 0 ; i < ans.size() ; i++,s = " ")
		cout<<s<<ans[i];
	cout<<endl;
	return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <cstring>
#include <fstream>
#include <list>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <cmath>
#include <sstream>
#include <deque>
#include <utility>
#include <bitset>
#include <ext/hash_map>

using namespace std;
using namespace __gnu_cxx;

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REV(i,a,b) for(int i=(a);i>=(b);i--)
#define mp make_pair
#define pb push_back
#define oo 2e9
#define MAX 1001
#define sz(v) (int)v.size()
#define all(c) (c).begin(),(c).end()
#define rall(c) (c).rbegin(),(c).rend()
#define iter(it,s) for(it=s.begin();it!=s.end();it++)
#define show(x) cerr<<#x<<" = "<<x<<endl;
#define mem(s,v) memset(s,v,sizeof(s))

typedef long long ll;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<string> vs;
typedef pair<int, int> pi;
typedef vector<pi> vpi;
int N,a,b;
int dp[22][22][22];
int arr[12];
int next[22][22][22];
int sol(int ind,int power,int hits)
{
	if(ind == N-1)
		return (hits * b > arr[N-1])?0:(1<<22);
	if(dp[ind][power+1][hits] != -1)
		return dp[ind][power+1][hits];
	int res = (1<<22);
	int cur = arr[ind] - (hits*b);
	for(int i = 0 ; i <= 16 ; i++ )
	{
		if(power < (i*b))
		{
			int x = sol(ind+1,max(-1,cur-(i*a)),i);
			if(res > i+x)
			{
				res = i+x;
				next[ind][power+1][hits] = i;
			}
		}

	}
	//cout<<ind<<" "<<power<<" "<<hits<<" "<<next[ind][power+1][hits]<<endl;
	return dp[ind][power+1][hits] = res;
}

int main() {
#ifndef ONLINE_JUDGE
	freopen("test.in", "rt", stdin);
	//	freopen("o.txt", "wt", stdout);
#endif
	memset(dp,-1,sizeof dp);
	cin>>N>>a>>b;
	for(int i = 0 ; i < N ; ++i)
		cin>>arr[i];
	cout<<sol(1,arr[0],0)<<endl;
	vector<int> ans;
	int ind = 1,power = arr[0],hits = 0;
	while(ind < N)
	{
		int cur = arr[ind] - (hits*b);
		int xx = next[ind][power+1][hits];
		for(int i = 0 ; i < xx ; i++)
			ans.push_back(ind+1);
		hits = xx;
		ind++;
		power = max(-1,cur-(xx*a));

	}
	string s = "";
	for(int i = 0 ; i < ans.size() ; i++,s = " ")
		cout<<s<<ans[i];
	cout<<endl;
	return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <cstring>
#include <fstream>
#include <list>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <cmath>
#include <sstream>
#include <deque>
#include <utility>
#include <bitset>
#include <ext/hash_map>

using namespace std;
using namespace __gnu_cxx;

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REV(i,a,b) for(int i=(a);i>=(b);i--)
#define mp make_pair
#define pb push_back
#define oo 2e9
#define MAX 1001
#define sz(v) (int)v.size()
#define all(c) (c).begin(),(c).end()
#define rall(c) (c).rbegin(),(c).rend()
#define iter(it,s) for(it=s.begin();it!=s.end();it++)
#define show(x) cerr<<#x<<" = "<<x<<endl;
#define mem(s,v) memset(s,v,sizeof(s))

typedef long long ll;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<string> vs;
typedef pair<int, int> pi;
typedef vector<pi> vpi;
int N,a,b;
int dp[22][22][22];
int arr[12];
int next[22][22][22];
int sol(int ind,int power,int hits)
{
	if(ind == N-1)
		return (hits * b > arr[N-1])?0:(1<<22);
	if(dp[ind][power+1][hits] != -1)
		return dp[ind][power+1][hits];
	int res = (1<<22);
	int cur = arr[ind] - (hits*b);
	for(int i = 0 ; i <= 15 ; i++ )
	{
		if(power < (i*b))
		{
			int x = sol(ind+1,max(-1,cur-(i*a)),i);
			if(res > i+x)
			{
				res = i+x;
				next[ind][power+1][hits] = i;
			}
		}

	}
	//cout<<ind<<" "<<power<<" "<<hits<<" "<<next[ind][power+1][hits]<<endl;
	return dp[ind][power+1][hits] = res;
}

int main() {
#ifndef ONLINE_JUDGE
	freopen("test.in", "rt", stdin);
	//	freopen("o.txt", "wt", stdout);
#endif
	memset(dp,-1,sizeof dp);
	cin>>N>>a>>b;
	for(int i = 0 ; i < N ; ++i)
		cin>>arr[i];
	cout<<sol(1,arr[0],0)<<endl;
	vector<int> ans;
	int ind = 1,power = arr[0],hits = 0;
	while(ind < N)
	{
		int cur = arr[ind] - (hits*b);
		int xx = next[ind][power+1][hits];
		for(int i = 0 ; i < xx ; i++)
			ans.push_back(ind+1);
		hits = xx;
		ind++;
		power = max(-1,cur-(xx*a));

	}
	string s = "";
	for(int i = 0 ; i < ans.size() ; i++,s = " ")
		cout<<s<<ans[i];
	cout<<endl;
	return 0;
}


#include<iostream>
#include<math.h>
#include<algorithm>
#include<stdio.h>
#include<map>
#include<vector>
#include<set>
#define F first
#define S second
#define P system("PAUSE");
#define H return 0;
#define pb push_back
using namespace std;
const long long A=100000000000000LL,N=10000;

vector<long long> te;
long long i,vo[N],j,n,m,r[2],a[N],o,ot=A;

void rec(long long p){
//	if(te.size()>=ot)return;
	if(a[n-1]<0){
		for(int i=0;i<n;i++)if(a[i]>=0)return;
		if(ot>te.size()){
			ot=te.size();
			for(int i=0;i<te.size();i++)vo[i]=te[i];
		}
		return;
	}
	if(p==n-1)return;
	long long i,j,pr,t[3]={0,0,0};
	if(a[p]>=0)t[0]=a[p]/r[0],t[0]++;
	if(a[p-1]>=0)t[1]=a[p-1]/r[1],t[1]++;
	if(a[p+1]>=0)t[2]=a[p+1]/r[1],t[2]++;
	for(i=t[1];i<=max(t[0],t[1]);i++){
		a[p]-=r[0]*i,a[p-1]-=r[1]*i,a[p+1]-=r[1]*i,pr=te.size();
		for(j=0;j<i;j++)te.pb(p+1);
		rec(p+1);
		te.resize(pr),a[p]+=r[0]*i,a[p-1]+=r[1]*i,a[p+1]+=r[1]*i;
	}
}

int main(){
	cin>>n>>r[0]>>r[1];
	for(i=0;i<n;i++)cin>>a[i];
	rec(1);
	cout<<ot<<"\n";
	for(i=0;i<ot;i++)cout<<vo[i]<<" ";
}

//2 2 2 4 4 5 7 7 9 9
//2 2 2 4 4 5 7 7 9 9


#include<iostream>
#include<math.h>
#include<algorithm>
#include<stdio.h>
#include<map>
#include<vector>
#include<set>
#define F first
#define S second
#define P system("PAUSE");
#define H return 0;
#define pb push_back
using namespace std;
const long long A=100000000000000LL,N=10000;

vector<long long> te;
long long i,vo[N],j,n,m,r[2],a[N],o,ot=A;

void rec(long long p){
	if(te.size()>=ot)return;
	if(a[n-1]<0){
		for(int i=0;i<n;i++)if(a[i]>=0)return;
		if(ot>te.size()){
			ot=te.size();
			for(int i=0;i<te.size();i++)vo[i]=te[i];
		}
		return;
	}
	if(p==n-1)return;
	long long k,i,j,pr,t[3]={0,0,0};
	if(a[p]>=0)t[0]=a[p]/r[0],t[0]++;
	if(a[p-1]>=0)t[1]=a[p-1]/r[1],t[1]++;
	if(a[p+1]>=0)t[2]=a[p+1]/r[1],t[2]++;
	k=max(t[0],t[1]);
	if(p==n-2)k=max(k,t[2]);
	for(i=t[1];i<=k;i++){
		a[p]-=r[0]*i,a[p-1]-=r[1]*i,a[p+1]-=r[1]*i,pr=te.size();
		for(j=0;j<i;j++)te.pb(p+1);
		rec(p+1);
		te.resize(pr),a[p]+=r[0]*i,a[p-1]+=r[1]*i,a[p+1]+=r[1]*i;
	}
}

int main(){
	cin>>n>>r[0]>>r[1];
	for(i=0;i<n;i++)cin>>a[i];
	rec(1);
	cout<<ot<<"\n";
	for(i=0;i<ot;i++)cout<<vo[i]<<" ";
}

//2 2 2 4 4 5 7 7 9 9
//2 2 2 4 4 5 7 7 9 9


#include<iostream>
#include<math.h>
#include<algorithm>
#include<stdio.h>
#include<map>
#include<vector>
#include<set>
#define F first
#define S second
#define P system("PAUSE");
#define H return 0;
#define pb push_back
using namespace std;
const long long A=100000000000000LL,N=10000;

vector<long long> te;
long long i,vo[N],j,n,m,r[2],a[N],o,ot=A;

void rec(long long p){
	if(te.size()>=ot)return;
	if(a[n-1]<0){
		for(int i=0;i<n;i++)if(a[i]>=0)return;
		if(ot>te.size()){
			ot=te.size();
			for(int i=0;i<te.size();i++)vo[i]=te[i];
		}
		return;
	}
	if(p==n-1)return;
	long long i,j,pr,t[3]={0,0,0};
	if(a[p]>=0)t[0]=a[p]/r[0],t[0]++;
	if(a[p-1]>=0)t[1]=a[p-1]/r[1],t[1]++;
	if(a[p+1]>=0)t[2]=a[p+1]/r[1],t[2]++;
	for(i=t[1];i<=max(t[0],max(t[1],t[2]));i++){
		a[p]-=r[0]*i,a[p-1]-=r[1]*i,a[p+1]-=r[1]*i,pr=te.size();
		for(j=0;j<i;j++)te.pb(p+1);
		rec(p+1);
		te.resize(pr),a[p]+=r[0]*i,a[p-1]+=r[1]*i,a[p+1]+=r[1]*i;
	}
}

int main(){
	cin>>n>>r[0]>>r[1];
	for(i=0;i<n;i++)cin>>a[i];
	rec(1);
	cout<<ot<<"\n";
	for(i=0;i<ot;i++)cout<<vo[i]<<" ";
}

//2 2 2 4 4 5 7 7 9 9
//2 2 2 4 4 5 7 7 9 9


#include<iostream>
#include<math.h>
#include<algorithm>
#include<stdio.h>
#include<map>
#include<vector>
#include<set>
#define F first
#define S second
#define P system("PAUSE");
#define H return 0;
#define pb push_back
using namespace std;
const long long A=100000000000000LL,N=10000;

vector<long long> te;
long long i,vo[N],dl,j,n,m,r[2],a[N],o,ot=A;

void rec(long long p){
	if(a[n-1]<0){
		if(ot>o){
			ot=o,dl=te.size();
			for(int i=0;i<te.size();i++)vo[i]=te[i];
		}
		return;
	}
	if(p==n-1)return;
	long long pr,t[3]={0,0,0};
	t[0]=a[p]/r[0];t[0]++;
	t[1]=a[p-1]/r[1];t[1]++;
	t[2]=a[p+1]/r[1];t[2]++;
	for(int i=t[1];i<=max(t[0],max(t[1],t[2]));i++){
		a[p]-=r[0]*i,o+=i;
		a[p-1]-=r[1]*i;
		a[p+1]-=r[1]*i;
		pr=te.size();
		for(int j=0;j<i;j++)te.pb(p+1);
		rec(p+1);
		te.resize(pr);
		a[p]+=r[0]*i,o-=i;
		a[p-1]+=r[1]*i;
		a[p+1]+=r[1]*i;
	}
}

int main(){
	cin>>n>>r[0]>>r[1];
	for(i=0;i<n;i++)cin>>a[i];
	rec(1);
	cout<<ot<<"\n";
	for(i=0;i<dl;i++)cout<<vo[i]<<" ";
}


#include<cstdio>
#include<string.h>
#include<algorithm>
#include<iostream>
using namespace std;
int N,a,b;
int A[20];
int D[20];
int mi;
int P[5010];
int sav;
void dfs(int s,int n)
{
    int i;
    if(n==N)
    {
        int sa=0,c=s;
        while(s)
        {
            sa+=s%10;s/=10;
        }
        //if(c<400) cout<<c<<"   "<<sa<<endl;
        if(mi>sa)
        {
            mi=sa;sav=c;
        }
    }
    else if(n==N-1)
    {
        int k,l;k=s%10;l=(s/10)%10;
        for(i=0;i<=8;i++)
        {
            if(A[n-1]<b*l+a*k+i*b&&A[n]<b*k+a*i) dfs(s*10+i,n+1);
        }
    }
    else
    {
        int k,l;k=s%10;l=(s/10)%10;
        for(i=0;i<=8;i++)
        {
            if(A[n-1]<b*l+a*k+i*b) dfs(s*10+i,n+1);
            //if(A[n]<b*k+a*i) break;
        }
    }
}
int main()
{
    int i,j,k;
    int s;
    mi=0x7ffffff;
    D[0]=1;for(i=1;i<10;i++) D[i]=D[i-1]*9;
    scanf("%d%d%d",&N,&a,&b);
    for(i=N-1;i>=0;i--) scanf("%d",A+i);
    dfs(0,1);
    printf("%d\n",mi);
    k=0;
    for(i=1;i<N;i++)
    {
        for(j=0;j<sav%10;j++) //printf("%d ",N+1-i);
        {
            P[k++]=N+1-i;
        }
        sav/=10;
    }
    if(k) printf("%d",P[0]);
    for(i=1;i<k;i++) printf(" %d",P[i]);
    printf("\n");
}


#include<cstdio>
#include<string.h>
#include<algorithm>
#include<iostream>
using namespace std;
int N,a,b;
int A[20];
int D[20];
int mi;
int sav;
void dfs(int s,int n)
{
    int i;
    if(n==N)
    {
        int sa=0,c=s;
        while(s)
        {
            sa+=s%10;s/=10;
        }
        //if(c<400) cout<<c<<"   "<<sa<<endl;
        if(mi>sa)
        {
            mi=sa;sav=c;
        }
    }
    else if(n==N-1)
    {
        int k,l;k=s%10;l=(s/10)%10;
        for(i=0;i<=8;i++)
        {
            if(A[n-1]<b*l+a*k+i*b&&A[n]<b*k+a*i) dfs(s*10+i,n+1);
        }
    }
    else
    {
        int k,l;k=s%10;l=(s/10)%10;
        for(i=0;i<=8;i++)
        {
            if(A[n-1]<b*l+a*k+i*b) dfs(s*10+i,n+1);
            //if(A[n]<b*k+a*i) break;
        }
    }
}
int main()
{
    int i,j,k;
    int s;
    mi=0x7ffffff;
    D[0]=1;for(i=1;i<10;i++) D[i]=D[i-1]*9;
    scanf("%d%d%d",&N,&a,&b);
    for(i=N-1;i>=0;i--) scanf("%d",A+i);
    dfs(0,1);
    printf("%d\n",mi);
    for(i=1;i<N;i++)
    {
        for(j=0;j<sav%10;j++) printf("%d ",N+1-i);
        sav/=10;
    }
}


#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#define MAX 11
using namespace std;

map < vector < int >, bool > _vdp;
map < vector < int >, int  > _dp;
int a,b,n; int Mov[MAX*MAX]; int Res[MAX*MAX],_Mov[MAX*MAX]; int S[MAX]; int sol; int _sol;

void _solve(int _cnt,int lo,int up){
    if(_cnt > _sol) return;
    while(lo < up && S[lo] < 0) lo++;
    while(lo < up && S[up] < 0) up--;
    if(lo == up && S[lo] < 0){
        // encontre solucion
        _sol = _cnt;
        for(int i = 0;i < _sol;i++) _Mov[i] = Res[i];
        return;
    }
    int p;
    for(int j = lo;j <= up;j++){
        if(S[j - 1] < 0 && S[j + 1] < 0 && S[j] < 0) continue;
        if(S[j] > S[j + 1]){
            if(S[j] > S[j - 1]) p = S[j]/a;
            else p = S[j - 1]/b;
        }
        else{
            if(S[j + 1] > S[j - 1]) p = S[j + 1]/b;
            else p = S[j - 1]/b;
        }
        p++;
        S[j - 1] -= p*b; S[j] -= a*p; S[j + 1] -= b*p;
        for(int i = 0;i < p;i++) Res[_cnt + i] = j;
        _solve(_cnt + p,lo,up);
        S[j - 1] += p*b; S[j] += a*p; S[j + 1] += b*p;
    }
}

int main(){
    scanf("%d %d %d",&n,&a,&b);
    for(int i = 0;i < n;i++) scanf("%d",&S[i]);
    sol = 0; int p = 0; p = S[0]/b; p++;
    sol += p; S[0] -= p*b; S[1] -= p*a; S[2] -= p*b;
    for(int i = 0;i < p;i++) Mov[i] = 1;
    if(S[n - 1] >= 0){
        p = S[n - 1]/b; p++;
        S[n - 1] -= b*p; S[n - 2] -= a*p; S[n - 3] -= b*p;
        for(int i = 0;i < p;i++) Mov[i + sol] = n - 1;
        sol += p;
    }
    int lo = 1; int up = n - 2;
    while(lo < up && S[lo] < 0) lo++;
    while(lo < up && S[up] < 0) up--;
    _sol = (1<<30);
    _solve(0,lo,up);
    if(_sol != (1<<30)){
        for(int i = 0;i < _sol;i++) Mov[sol + i] = _Mov[i];
        sol += _sol;
    }
    printf("%d\n",sol);
    printf("%d",Mov[0] + 1);
    for(int i = 1;i < sol;i++) printf(" %d",Mov[i] + 1);
    printf("\n");
    return 0;
}


#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#define MAX 11
using namespace std;

map < vector < int >, bool > _vdp;
map < vector < int >, int  > _dp;
int a,b,n; int Mov[MAX*MAX]; int Res[MAX*MAX],_Mov[MAX*MAX]; int S[MAX]; int sol; int _sol;

void _solve(int _cnt,int lo,int up){
    if(_cnt > _sol) return;
    while(lo < up && S[lo] < 0) lo++;
    while(lo < up && S[up] < 0) up--;
    if(lo == up && S[lo] < 0){
        // encontre solucion
        _sol = _cnt;
        for(int i = 0;i < _sol;i++) _Mov[i] = Res[i];
        return;
    }
    int p;
    for(int j = lo;j <= up;j++){
        if(S[j - 1] < 0 && S[j + 1] < 0 && S[j] < 0) continue;
        if(S[j] > S[j + 1]){
            if(S[j] > S[j - 1]) p = S[j]/a;
            else p = S[j - 1]/b;
        }
        else{
            if(S[j + 1] > S[j - 1]) p = S[j + 1]/b;
            else p = S[j - 1]/b;
        }
        p++;
        S[j - 1] -= p*b; S[j] -= a*p; S[j + 1] -= b*p;
        for(int i = 0;i < p;i++) Res[_cnt + i] = j;
        _solve(_cnt + p,lo,up);
        S[j - 1] += p*b; S[j] += a*p; S[j + 1] += b*p;
    }
}

int main(){
    scanf("%d %d %d",&n,&a,&b);
    for(int i = 0;i < n;i++) scanf("%d",&S[i]);
    sol = 0; int p = 0; p = S[0]/b; p++;
    sol += p; S[0] -= p*b; S[1] -= p*a; S[2] -= p*b;
    for(int i = 0;i < p;i++) Mov[i] = 1;
    if(S[n - 1] >= 0){
        p = S[n - 1]/b; p++;
        S[n - 1] -= b*p; S[n - 2] -= a*p; S[n - 3] -= b*p;
        for(int i = 0;i < p;i++) Mov[i + sol] = n - 2;
        sol += p;
    }
    int lo = 1; int up = n - 2;
    while(lo < up && S[lo] < 0) lo++;
    while(lo < up && S[up] < 0) up--;
    _sol = (1<<30);
    _solve(0,lo,up);
    if(_sol != (1<<30)){
        for(int i = 0;i < _sol;i++) Mov[sol + i] = _Mov[i];
        sol += _sol;
    }
    printf("%d\n",sol);
    printf("%d",Mov[0] + 1);
    for(int i = 1;i < sol;i++) printf(" %d",Mov[i] + 1);
    printf("\n");
    return 0;
}


#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#define MAX
using namespace std;
int n,a,b;
map < vector < int >,vector < int > > _dp;
map < vector < int >, bool > _vdp;

vector < int > _solve(vector < int > A,bool flag){
    if(flag) return vector < int >();
    if(_vdp[A]) return _dp[A];
    _vdp[A] = true; vector < int > B;
    vector < int > res; int lon = (1<<20);
    for(int i = 1;i <= n - 2;i++){
        if(A[i-1] < 0 && A[i] < 0 && A[i + 1] < 0) continue;
        B.clear(); bool valid = true;
        for(int j = 0;j < n;j++) B.push_back(A[j]);
        B[i - 1] = max(-1,B[i-1] - b); B[i] = max(-1,B[i] - a);
        B[i + 1] = max(-1,B[i + 1] - b);
        for(int j = 0;j < n;j++) valid &= (B[j] < 0);
        vector < int > aux = _solve(B,valid);
        aux.push_back(i);
        if(aux.size() < lon){
            lon = aux.size();
            res = aux;
        }
    }
    return (_dp[A] = res);
}

int main(){
    scanf("%d %d %d",&n,&a,&b);
    vector < int > A(n);
    for(int i = 0;i < n;i++) scanf("%d",&A[i]);
    vector < int > sol = _solve(A,false);
    printf("%d\n",sol.size());
    for(int i = 0;i < sol.size();i++) printf("%d ",sol[i] + 1);
    return 0;
}


#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#define MAX
using namespace std;
int n,a,b;
map < vector < int >,vector < int > > _dp;
map < vector < int >, bool > _vdp;

vector < int > _solve(vector < int > A,bool flag,int lo,int up){
    if(flag) return vector < int >();
    if(_vdp[A]) return _dp[A];
    _vdp[A] = true; vector < int > B;
    vector < int > res; int lon = (1<<20);
    while(lo < up && A[lo] < 0 && A[lo - 1] < 0) lo++;
    while(lo < up && A[up] < 0 && A[up + 1] < 0) up--;

    for(int i = lo;i <= up;i++){
        if(A[i-1] < 0 && A[i] < 0 && A[i + 1] < 0) continue;
        B.clear(); bool valid = true;
        for(int j = 0;j < n;j++) B.push_back(A[j]);
        B[i - 1] = max(-1,B[i-1] - b); B[i] = max(-1,B[i] - a);
        B[i + 1] = max(-1,B[i + 1] - b);
        for(int j = 0;j < n;j++) valid &= (B[j] < 0);
        vector < int > aux = _solve(B,valid,lo,up);
        aux.push_back(i);
        if(aux.size() < lon){
            lon = aux.size();
            res = aux;
        }
    }
    return (_dp[A] = res);
}

int main(){
    scanf("%d %d %d",&n,&a,&b);
    vector < int > A(n);
    for(int i = 0;i < n;i++) scanf("%d",&A[i]);
    vector < int > sol = _solve(A,false,1,n-2);
    printf("%d\n",sol.size());
    for(int i = 0;i < sol.size();i++) printf("%d ",sol[i] + 1);
    return 0;
}


import java.util.*;
import java.io.*;
public class a {
public static void main(String[] args) throws IOException
{
    boolean[] sieve = new boolean[1000001];
    Arrays.fill(sieve, true);
    sieve[0]=sieve[1]=false;
    for(int i = 2; i<sieve.length; i++) if(sieve[i]) for(long j = (long)i*i; j<sieve.length; j+=i) sieve[(int)j] = false;
    //Scanner input = new Scanner(new File("input.txt"));
    //PrintWriter out = new PrintWriter(new File("output.txt"));
    PrintWriter out = new PrintWriter(System.out);
    input.init(System.in);
    int n = input.nextInt(), t1 = input.nextInt(), t2 = input.nextInt(), k = input.nextInt();
    X[] data = new X[n];
    for(int i= 0; i<n; i++)
    {
        int a = input.nextInt(), b = input.nextInt();
        double res = Math.max(t1*a*(1-1.*k/100)+t2*b, t1*b*(1-1.*k/100)+t2*a);
        data[i] = new X(i+1,res);
    }
    Arrays.sort(data);
    for(int i = 0; i<n; i++)
        out.printf("%d %.2f\n",data[i].a,data[i].b);
    out.close();
}
static class X implements Comparable<X>
{
    int a;
    double b;
    public X(int a, double b)
    {
        this.a = a; this.b = b;
    }
    @Override
    public int compareTo(X that) {
        // TODO Auto-generated method stub
        if(this.b == that.b) return this.a-that.a;
        return (int)Math.signum(that.b-this.b);
    }
}
public static long gcd(long a, long b)
{
if(b == 0) return a;
return gcd(b, a%b);
}
public static class input {
    static BufferedReader reader;
    static StringTokenizer tokenizer;

    /** call this method to initialize reader for InputStream */
    static void init(InputStream input) {
        reader = new BufferedReader(
                     new InputStreamReader(input) );
        tokenizer = new StringTokenizer("");
    }

    /** get next word */
    static String next() throws IOException {
        while ( ! tokenizer.hasMoreTokens() ) {
            //TODO add check for eof if necessary
            tokenizer = new StringTokenizer(
                   reader.readLine() );
        }
        return tokenizer.nextToken();
    }

    static int nextInt() throws IOException {
        return Integer.parseInt( next() );
    }

    static double nextDouble() throws IOException {
        return Double.parseDouble( next() );
    }
    static long nextLong() throws IOException {
        return Long.parseLong( next() );
    }
}
static class IT
{
    int[] left,right, val, a, b;
    IT(int n)
    {
        left = new int[3*n];
        right = new int[3*n];
        val = new int[3*n];
        a = new int[3*n];
        b = new int[3*n];
        init(0,0, n);
    }
    int init(int at, int l, int r)
    {
        a[at] = l;
        b[at] = r;
        if(l==r)
            left[at] = right [at] = -1;
        else
        {
            int mid = (l+r)/2;
            left[at] = init(2*at+1,l,mid);
            right[at] = init(2*at+2,mid+1,r);
        }
        return at++;
    }
    //return the sum over [x,y]
    int get(int x, int y)
    {
        return go(x,y, 0);
    }
    int go(int x,int y, int at)
    {
        if(at==-1) return 0;
        if(x <= a[at] && y>= b[at]) return val[at];
        if(y<a[at] || x>b[at]) return 0;
        return go(x, y, left[at]) + go(x, y, right[at]);
    }
    //add v to elements x through y
    void add(int x, int y, int v)
    {
        go3(x, y, v, 0);
    }
    void go3(int x, int y, int v, int at)
    {
        if(at==-1) return;
        if(y < a[at] || x > b[at]) return;
        val[at] += (Math.min(b[at], y) - Math.max(a[at], x) + 1)*v;
        go3(x, y, v, left[at]);
        go3(x, y, v, right[at]);
    }
}
}


import java.util.*;
import java.io.*;
public class a {
public static void main(String[] args) throws IOException
{
    boolean[] sieve = new boolean[1000001];
    Arrays.fill(sieve, true);
    sieve[0]=sieve[1]=false;
    for(int i = 2; i<sieve.length; i++) if(sieve[i]) for(long j = (long)i*i; j<sieve.length; j+=i) sieve[(int)j] = false;
    //Scanner input = new Scanner(new File("input.txt"));
    //PrintWriter out = new PrintWriter(new File("output.txt"));
    PrintWriter out = new PrintWriter(System.out);
    input.init(System.in);
    int n = input.nextInt(), t1 = input.nextInt(), t2 = input.nextInt(), k = input.nextInt();
    X[] data = new X[n];
    for(int i= 0; i<n; i++)
    {
        int a = input.nextInt(), b = input.nextInt();
        double res = Math.max(t1*a*(1-1.*k/100)+t2*b, t2*b*(1-1.*k/100)+t2*a);
        data[i] = new X(i+1,res);
    }
    Arrays.sort(data);
    for(int i = 0; i<n; i++)
        out.printf("%d %.2f\n",data[i].a,data[i].b);
    out.close();
}
static class X implements Comparable<X>
{
    int a;
    double b;
    public X(int a, double b)
    {
        this.a = a; this.b = b;
    }
    @Override
    public int compareTo(X that) {
        // TODO Auto-generated method stub
        if(this.b == that.b) return this.a-that.a;
        return (int)Math.signum(that.b-this.b);
    }
}
public static long gcd(long a, long b)
{
if(b == 0) return a;
return gcd(b, a%b);
}
public static class input {
    static BufferedReader reader;
    static StringTokenizer tokenizer;

    /** call this method to initialize reader for InputStream */
    static void init(InputStream input) {
        reader = new BufferedReader(
                     new InputStreamReader(input) );
        tokenizer = new StringTokenizer("");
    }

    /** get next word */
    static String next() throws IOException {
        while ( ! tokenizer.hasMoreTokens() ) {
            //TODO add check for eof if necessary
            tokenizer = new StringTokenizer(
                   reader.readLine() );
        }
        return tokenizer.nextToken();
    }

    static int nextInt() throws IOException {
        return Integer.parseInt( next() );
    }

    static double nextDouble() throws IOException {
        return Double.parseDouble( next() );
    }
    static long nextLong() throws IOException {
        return Long.parseLong( next() );
    }
}
static class IT
{
    int[] left,right, val, a, b;
    IT(int n)
    {
        left = new int[3*n];
        right = new int[3*n];
        val = new int[3*n];
        a = new int[3*n];
        b = new int[3*n];
        init(0,0, n);
    }
    int init(int at, int l, int r)
    {
        a[at] = l;
        b[at] = r;
        if(l==r)
            left[at] = right [at] = -1;
        else
        {
            int mid = (l+r)/2;
            left[at] = init(2*at+1,l,mid);
            right[at] = init(2*at+2,mid+1,r);
        }
        return at++;
    }
    //return the sum over [x,y]
    int get(int x, int y)
    {
        return go(x,y, 0);
    }
    int go(int x,int y, int at)
    {
        if(at==-1) return 0;
        if(x <= a[at] && y>= b[at]) return val[at];
        if(y<a[at] || x>b[at]) return 0;
        return go(x, y, left[at]) + go(x, y, right[at]);
    }
    //add v to elements x through y
    void add(int x, int y, int v)
    {
        go3(x, y, v, 0);
    }
    void go3(int x, int y, int v, int at)
    {
        if(at==-1) return;
        if(y < a[at] || x > b[at]) return;
        val[at] += (Math.min(b[at], y) - Math.max(a[at], x) + 1)*v;
        go3(x, y, v, left[at]);
        go3(x, y, v, right[at]);
    }
}
}


import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;

public class GrowingMushrooms {

    public static void main( final String[] args ) throws Exception {
        final BufferedReader br = new BufferedReader( new InputStreamReader( System.in ) );
        final int[] t = toi( br.readLine().split( " " ) );
        final int n = t[ 0 ];
        final int[] a = new int[n];
        final int[] b = new int[n];
        for ( int i = 0; i < n; ++i ) {
            final int[] t2 = toi( br.readLine().split( " " ) );
            a[ i ] = t2[ 0 ];
            b[ i ] = t2[ 1 ];
        }
        print( solve( n, t[ 1 ], t[ 2 ], t[ 3 ], a, b ) );
    }

    private static void print( final Dwarf[] ds ) {
        final int n = ds.length;
        for ( int i = 0; i < n; ++i ) {
            final int t = ds[ i ].mh % 100;
            final String ts = ( t < 10 ) ? "0" + t : "" + t;
            System.out.printf( "%d %d.%s\n", ds[ i ].idx, ds[ i ].mh / 100, ts );
        }
    }

    private static Dwarf[] solve( final int n, final int t1, final int t2, final int k, final int[] a, final int[] b ) {
        final Dwarf[] ds = new Dwarf[n];
        for ( int i = 0; i < n; ++i ) {
            ds[ i ] = simulate( i + 1, t1, t2, k, a[ i ], b[ i ] );
        }

        Arrays.sort( ds );
        return ds;
    }

    private static Dwarf simulate( final int idx, final int t1, final int t2, final int k, final int a, final int b ) {
        final Dwarf d1 = new Dwarf( idx, t1, t2, k, a, b );
        final Dwarf d2 = new Dwarf( idx, t1, t2, k, b, a );
        return d1.compareTo( d2 ) <= 0 ? d1 : d2;
    }

    public static class Dwarf implements Comparable<Dwarf> {

        int idx;
        int mh; // mushroom height

        public Dwarf( final int idx, final int t1, final int t2, final int k, final int v1, final int v2 ) {
            this.idx = idx;
            this.mh = t1 * v1 * ( 100 - k ) + 100 * t2 * v2;
        }

        @Override
        public int compareTo( final Dwarf d ) {
            if ( this.mh == d.mh ) return Integer.valueOf( this.idx ).compareTo( d.idx ); // order by index
            return -Integer.valueOf( this.mh ).compareTo( d.mh );
        }
    }

    public static int[] toi( final String[] sa ) {
        final int[] res = new int[sa.length];
        for ( int i = 0; i < sa.length; ++i ) {
            res[ i ] = toi( sa[ i ] );
        }
        return res;
    }

    private static int toi( final String s ) {
        return Integer.parseInt( s );
    }
}


import java.math.BigDecimal;
import java.util.Arrays;
import java.util.Scanner;

public class two {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int t1 = sc.nextInt();
        int t2 = sc.nextInt();
        int k = sc.nextInt();
        player[] array = new player[n];
        for (int i = 0; i < n; i++) {
            int x = sc.nextInt();
            int y = sc.nextInt();
            array[i] = new player(i, x, y);
            array[i].score = Math.max(t1 * x - t1 * x * k / 100.0 + t2 * y, t1
                    * y - t1 * y * k / 100.0 + t2 * x);
        }

        Arrays.sort(array);
        for (int i = 0; i < n; i++) {
            BigDecimal bd = new BigDecimal(array[i].score);
            bd = bd.setScale(2, BigDecimal.ROUND_HALF_UP);
            System.out.println((array[i].index + 1) + " " + bd.toString());
        }
    }

    static class player implements Comparable<player> {
        int v1;
        int v2;
        double score;
        int index;

        public player(int in, int v11, int v22) {
            v1 = v11;
            v2 = v22;
            index = in;
            score = 0;
        }

        @Override
        public int compareTo(player arg0) {
            if (score == arg0.score) {
                return index - arg0.index;
            } else
                return Double.compare(arg0.score, score);

        }

    }
}


import java.math.BigDecimal;
import java.util.Arrays;
import java.util.Scanner;

public class two {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int t1 = sc.nextInt();
        int t2 = sc.nextInt();
        int k = sc.nextInt();
        player[] array = new player[n];
        for (int i = 0; i < n; i++) {
            int x = sc.nextInt();
            int y = sc.nextInt();
            array[i] = new player(i, x, y);
            array[i].score = Math.max(t1 * x - t1 * x * k / 100.0 + t2 * y, t1
                    * y - t1 * y * k / 100.0 + t2 * x);
        }

        Arrays.sort(array);
        for (int i = 0; i < n; i++){
            BigDecimal bd = new BigDecimal(array[i].score);
            bd = bd.setScale(2, BigDecimal.ROUND_HALF_UP);
            System.out.println((array[i].index + 1) + " "+ bd.toString());
    }}

    static class player implements Comparable<player> {
        int v1;
        int v2;
        double score;
        int index;

        public player(int in, int v11, int v22) {
            v1 = v11;
            v2 = v22;
            index = in;
            score = 0;
        }

        @Override
        public int compareTo(player arg0) {
            if (score == arg0.score) {
                return index - arg0.index;
            } else
                return (int) (-score + arg0.score);

        }

    }
}


import java.util.Arrays;
import java.util.Scanner;

public class Prob186B {
	private class Mushroom implements Comparable<Mushroom> {

		int index;
		double score;

		public Mushroom(int i, double s) {
			index = i;
			score = s;
		}

		@Override
		public int compareTo(Mushroom arg0) {
			if (arg0.score > score)
				return 1;
			if (arg0.score < score)
				return -1;
			return 0;
		}
	}

	public static void main(String[] Args) {
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int t1 = in.nextInt();
		int t2 = in.nextInt();
		int k = in.nextInt();

		Mushroom[] mrms = new Mushroom[n];

		for (int i = 0; i < n; i++) {
			double u = in.nextDouble(), v = in.nextDouble();
			double score = Math.max(u * t1 * (100 - k) / 100.0 + v * t2, v * t1
					* (100 - k) / 100.0 + u * t2);
			mrms[i] = new Prob186B().new Mushroom(i + 1, score);
		}

		Arrays.sort(mrms);
		for (int i = 0; i < mrms.length; i++)
			System.out.printf("%d %10.2f\n", mrms[i].index, mrms[i].score);
	}
}


import java.util.Arrays;
import java.util.Scanner;

public class Prob186B {
	private class Mushroom implements Comparable<Mushroom> {

		int index;
		double score;

		public Mushroom(int i, double s) {
			index = i;
			score = s;
		}

		@Override
		public int compareTo(Mushroom arg0) {
			if (arg0.score > score)
				return 1;
			if (arg0.score < score)
				return -1;
			return 0;
		}
	}

	public static void main(String[] Args) {
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int t1 = in.nextInt();
		int t2 = in.nextInt();
		int k = in.nextInt();

		Mushroom[] mrms = new Mushroom[n];

		for (int i = 0; i < n; i++) {
			double u = in.nextDouble(), v = in.nextDouble();
			double score = Math.max(u * t1 * k / 100.0 + v * t2, v * t1 * k
					/ 100.0 + u * t2);
			mrms[i] = new Prob186B().new Mushroom(i + 1, score);
		}

		Arrays.sort(mrms);
		for (int i = 0; i < mrms.length; i++)
			System.out.printf("%d %10.2f\n", mrms[i].index, mrms[i].score);
	}
}


import java.util.*;
import java.io.*;
import java.math.BigInteger;
public class C118B{
    static BufferedReader br;
    public static void main(String args[])throws Exception{
        br=new BufferedReader(new InputStreamReader(System.in));
        int nm[]=toIntArray();
        int n=nm[0];
        int t1=nm[1];
        int t2=nm[2];
        int k=nm[3];
        int speed[][]=new int[n][2];
        for(int i=0;i<n;i++){
            speed[i]=toIntArray();
        }
        double max[]=new double[n];
        Man m[]=new Man[n];
        for(int i=0;i<n;i++){
            double a=speed[i][0]*t1-((double)(speed[i][0]*k*t1)/(double)100)+speed[i][1]*t2;
            double b=speed[i][1]*t1-((double)(speed[i][1]*k*t1)/(double)100)+speed[i][0]*t2;
            m[i]=new Man(Math.max(a,b),i+1);
        }
        Arrays.sort(m);
        for(int i=0;i<n;i++){
            System.out.print(m[i].ind+" ");
            System.out.printf("%.2f ",+m[i].val);
            System.out.println("");
        }

    }

    /****************************************************************/
    public static int[] toIntArray()throws Exception{
       String str[]=br.readLine().split(" ");
       int k[]=new int[str.length];
       for(int i=0;i<str.length;i++){
            k[i]=Integer.parseInt(str[i]);
       }
       return k;
    }
    public static int toInt()throws Exception{
       return Integer.parseInt(br.readLine());
    }
    public static long[] toLongArray()throws Exception{
       String str[]=br.readLine().split(" ");
       long k[]=new long[str.length];
       for(int i=0;i<str.length;i++){
            k[i]=Long.parseLong(str[i]);
       }
       return k;
    }
    public static long toLong()throws Exception{
       return Long.parseLong(br.readLine());
    }
    public static double[] toDoubleArray()throws Exception{
       String str[]=br.readLine().split(" ");
       double k[]=new double[str.length];
       for(int i=0;i<str.length;i++){
            k[i]=Double.parseDouble(str[i]);
       }
       return k;
    }
    public static double toDouble()throws Exception{
       return Double.parseDouble(br.readLine());
    }
    public static String toStr()throws Exception{
       return br.readLine();
    }
    public static String[] toStrArray()throws Exception{
       String str[]=br.readLine().split(" ");
       return str;
    }
    /****************************************************************/

}
class Man implements Comparable<Man>{
    double val;
    int ind;
    public Man(double d, int i){
        val=d;
        ind=i;
    }
    public int compareTo(Man m){
        if(val<m.val){
            return 1;
        }
        else if(val>m.val){
            return -1;
        }
        else{
             if(ind<=m.ind){
                 return -1;
             }
             return 1;
        }
    }
}


import java.io.*;
import java.text.*;
import java.util.*;
import java.math.*;

public class Main {

    static Random rnd = new Random();

      public static void qSort(float[][] a, int low, int high) {
        if (low > high)
          return;
        float x = a[low + rnd.nextInt(high - low + 1)][1];
        int i = low;
        int j = high;
        while (true) {
          while (a[i][1] < x)
            ++i;
          while (x < a[j][1])
            --j;
          if (i > j)
            break;
          float t = a[i][1];
          float t1 = a[i][0];
          a[i][1] = a[j][1];
          a[j][1] = t;
          a[i][0] = a[j][0];
          a[j][0] = t1;
          ++i;
          --j;
          if (i > j)
            break;
        }
        qSort(a, low, j);
        qSort(a, i, high);
      }

    public static void main(String[] args) throws IOException {
        Scanner in = new Scanner (System.in);
        PrintWriter out = new PrintWriter (System.out);
        int n = in.nextInt();
        int t1 = in.nextInt();
        int t2 = in.nextInt();
        int k = in.nextInt();
        int[] a = new int[n];
        int[] b = new int[n];
        float[][] res = new float[n][2];
        int l, r;
        for (int i = 0; i < n; i++) {
            l = in.nextInt();
            r = in.nextInt();
            if (l < r) {
                a[i] = l;
                b[i] = r;
            } else {
                a[i] = r;
                b[i] = l;
            }
        }
        for (int i = 0; i < n; i++) {
            res[i][0] = i+1;
            res[i][1] = a[i]*t1 + b[i]*t2;
            res[i][1] -=  k*a[i]*t1/100.0;
        }
        qSort(res, 0, n-1);
        DecimalFormatSymbols s = new DecimalFormatSymbols();
        s.setDecimalSeparator('.');
        DecimalFormat df = new DecimalFormat("0.00", s);
        for (int i = n-1; i >= 0; i--) {
            out.println((int)res[i][0] + " " + df.format(res[i][1]));
        }
        out.flush();
        return;
    }

}


import java.io.*;
import java.text.*;
import java.util.*;
import java.math.*;

public class Main {

    static Random rnd = new Random();

      public static void qSort(float[][] a, int low, int high) {
        if (low > high)
          return;
        float x = a[low + rnd.nextInt(high - low + 1)][1];
        int i = low;
        int j = high;
        while (true) {
          while (a[i][1] < x)
            ++i;
          while (x < a[j][1])
            --j;
          if (i > j)
            break;
          float t = a[i][1];
          float t1 = a[i][0];
          a[i][1] = a[j][1];
          a[j][1] = t;
          a[i][0] = a[j][0];
          a[j][0] = t1;
          ++i;
          --j;
          if (i > j)
            break;
        }
        qSort(a, low, j);
        qSort(a, i, high);
      }

    public static void main(String[] args) throws IOException {
        Scanner in = new Scanner (System.in);
        PrintWriter out = new PrintWriter (System.out);
        int n = in.nextInt();
        int t1 = in.nextInt();
        int t2 = in.nextInt();
        int k = in.nextInt();
        int[] a = new int[n];
        int[] b = new int[n];
        float[][] res = new float[n][2];
        float l, r;
        for (int i = 0; i < n; i++) {
            a[i] = in.nextInt();
            b[i] = in.nextInt();
        }
        for (int i = 0; i < n; i++) {
            res[i][0] = i+1;
            l = a[i]*t1 + b[i]*t2;
            l -= k*a[i]*t1*0.01;
            r = b[i]*t1 + a[i]*t2;
            r -= k*b[i]*t1*0.01;
            res[i][1] = Math.max(l, r);
        }
        qSort(res, 0, n-1);
        DecimalFormatSymbols s = new DecimalFormatSymbols();
        s.setDecimalSeparator('.');
        DecimalFormat df = new DecimalFormat("0.00", s);
        for (int i = n-1; i >= 0; i--) {
            out.println((int)res[i][0] + " " + df.format(res[i][1]));
        }
        out.flush();
        return;
    }

}


import java.io.*;
import java.text.*;
import java.util.*;

public class Main {

    public static void main(String[] args) throws IOException {
        Scanner in = new Scanner (System.in);
        PrintWriter out = new PrintWriter (System.out);
        int n = in.nextInt();
        int t1 = in.nextInt();
        int t2 = in.nextInt();
        int k = in.nextInt();
        int[] a = new int[n], b = new int[n];
        int[][] res = new int[n][2];
        int l, r;
        for (int i = 0; i < n; i++) {
            l = in.nextInt();
            r = in.nextInt();
            if (l < r) {
                a[i] = l;
                b[i] = r;
            } else {
                a[i] = r;
                b[i] = l;
            }
        }
        for (int i = 0; i < n; i++) {
            res[i][0] = i+1;
            res[i][1] = a[i]*t1*(100 - k) + 100*b[i]*t2;
        }
        Comparator<int[]> comp = new Comparator<int[]>() {
            @Override
            public int compare(int[] o1, int[] o2) {
                if(o1[1] > o2[1])
                    return -1;
                if(o1[1] < o2[1])
                    return 1;

                if(o1[0] < o2[0])
                    return -1;
                else
                    return 1;
            }
        };
        Arrays.sort(res, comp);
        DecimalFormatSymbols s = new DecimalFormatSymbols();
        s.setDecimalSeparator('.');
        DecimalFormat df = new DecimalFormat("0.00", s);
        for (int i = 0; i < n; i++) {
            out.println((int)res[i][0] + " " + df.format(res[i][1]*0.01));
        }
        out.flush();
        return;
    }

}


import java.io.*;
import java.text.*;
import java.util.*;
import java.math.*;

public class Main {

    static Random rnd = new Random();
      public static void qSort(float[][] a, int low, int high) {
        if (low > high)
          return;
        float x = a[low + rnd.nextInt(high - low + 1)][1];
        int i = low;
        int j = high;
        while (true) {
          while (a[i][1] < x)
            ++i;
          while (x < a[j][1])
            --j;
          if (i > j)
            break;
          float t = a[i][1];
          float t1 = a[i][0];
          a[i][1] = a[j][1];
          a[j][1] = t;
          a[i][0] = a[j][0];
          a[j][0] = t1;
          ++i;
          --j;
          if (i > j)
            break;
        }
        qSort(a, low, j);
        qSort(a, i, high);
      }

    public static void main(String[] args) throws IOException {
        Scanner in = new Scanner (System.in);
        PrintWriter out = new PrintWriter (System.out);
        int n = in.nextInt();
        int t1 = in.nextInt();
        int t2 = in.nextInt();
        int e = in.nextInt();
        float k = e * (float)0.01;
        int[] a = new int[n];
        int[] b = new int[n];
        float[][] res = new float[n][2];
        float l, r;
        for (int i = 0; i < n; i++) {
            a[i] = in.nextInt();
            b[i] = in.nextInt();
        }
        for (int i = 0; i < n; i++) {
            res[i][0] = i+1;
            l = a[i]*t1*(1 - k) + b[i]*t2;
            r = b[i]*t1*(1 - k) + a[i]*t2;
            res[i][1] = Math.max(l, r);
        }
        qSort(res, 0, n-1);
        for (int i = n-1; i > 0; i--) {
            if (res[i][1] == res[i-1][1] && res[i][0] >= res[i-1][0]) {
                float k1 = res[i][1], k2 = res[i][0];
                res[i][1] = res[i-1][1];
                res[i-1][1] = k1;
                res[i][0] = res[i-1][0];
                res[i-1][0] = k2;
            }
        }
        DecimalFormatSymbols s = new DecimalFormatSymbols();
        s.setDecimalSeparator('.');
        DecimalFormat df = new DecimalFormat("0.00", s);
        for (int i = n-1; i >= 0; i--) {
            out.println((int)res[i][0] + " " + df.format(res[i][1]));
        }
        out.flush();
        return;
    }

}


import java.io.*;
import java.text.*;
import java.util.*;

public class Main {

    public static void main(String[] args) throws IOException {
        Scanner in = new Scanner (System.in);
        PrintWriter out = new PrintWriter (System.out);
        int n = in.nextInt();
        int t1 = in.nextInt();
        int t2 = in.nextInt();
        int k = in.nextInt();
        int[] a = new int[n], b = new int[n];
        int[][] res = new int[n][2];
        int l, r;
        for (int i = 0; i < n; i++) {
            a[i] = in.nextInt();
            b[i] = in.nextInt();
        }
        for (int i = 0; i < n; i++) {
            res[i][0] = i+1;
            l = a[i]*t1*(100 - k) + 100*b[i]*t2;
            r = b[i]*t1*(100 - k) + 100*a[i]*t2;
            res[i][1] = Math.max(l, r);
        }
        Comparator<int[]> comp = new Comparator<int[]>() {
            @Override
            public int compare(int[] o1, int[] o2) {
                if(o1[1] > o2[1])
                    return -1;
                if(o1[1] < o2[1])
                    return 1;

                if(o1[0] < o2[0])
                    return -1;
                else
                    return 1;
            }
        };
        Arrays.sort(res, comp);
        DecimalFormatSymbols s = new DecimalFormatSymbols();
        s.setDecimalSeparator('.');
        DecimalFormat df = new DecimalFormat("0.00", s);
        for (int i = 0; i < n; i++) {
            out.println((int)res[i][0] + " " + df.format(res[i][1]*0.01));
        }
        out.flush();
        return;
    }

}


import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Comparator;
import java.util.StringTokenizer;

public class Solver {

    public static void main(String[] Args) throws NumberFormatException,
            IOException {
        new Solver().Run();

    }

    PrintWriter pw;
    StringTokenizer Stok;
    BufferedReader br;

    public String nextToken() throws IOException {
        while (Stok == null || !Stok.hasMoreTokens()) {
            Stok = new StringTokenizer(br.readLine());
        }
        return Stok.nextToken();
    }

    public int nextInt() throws NumberFormatException, IOException {
        return Integer.parseInt(nextToken());
    }

    public double nextDouble() throws NumberFormatException, IOException {
        return Double.parseDouble(nextToken());
    }

    public long nextLong() throws NumberFormatException, IOException {
        return Long.parseLong(nextToken());
    }

    int t1, t2;
    double k;

    public class Gnom {
        public int num;
        public double height;

        public Gnom(int aNum, double a, double b) {
            num = aNum;
            height = Math.floor(Math.max(a * t1 * k + b * t2, b * t1 * k
                     + a * t2) * 100)/100;
        }
    }

    public void Run() throws NumberFormatException, IOException {
        // br = new BufferedReader(new FileReader("input.txt"));
        // pw = new PrintWriter("output.txt");
        br = new BufferedReader(new InputStreamReader(System.in));
        pw = new PrintWriter(new OutputStreamWriter(System.out));
        int n = nextInt();
        t1 = nextInt();
        t2 = nextInt();
        k = 100 - nextInt();
        k = k/100;
        Gnom[] Cont = new Gnom[n];
        for (int i = 0; i < n; i++) {
            Cont[i] = new Gnom(i + 1, nextInt(), nextInt());
        }
        Arrays.sort(Cont, new Comparator<Gnom>() {

            @Override
            public int compare(Gnom o1, Gnom o2) {
                if (o1.height != o2.height) {
                    if (o1.height>o2.height){
                        return -1;
                    } else {
                        return 1;
                    }
                } else {
                    return o1.num - o2.num;
                }
            }
        });
        for (int i = 0; i < n; i++) {
            pw.print(Cont[i].num);
            pw.print(' ');
            pw.format("%.2f%n", Cont[i].height);
        }
        pw.flush();
        pw.close();

    }

}


import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Comparator;
import java.util.StringTokenizer;

public class Solver {

    public static void main(String[] Args) throws NumberFormatException,
            IOException {
        new Solver().Run();

    }

    PrintWriter pw;
    StringTokenizer Stok;
    BufferedReader br;

    public String nextToken() throws IOException {
        while (Stok == null || !Stok.hasMoreTokens()) {
            Stok = new StringTokenizer(br.readLine());
        }
        return Stok.nextToken();
    }

    public int nextInt() throws NumberFormatException, IOException {
        return Integer.parseInt(nextToken());
    }

    public double nextDouble() throws NumberFormatException, IOException {
        return Double.parseDouble(nextToken());
    }

    public long nextLong() throws NumberFormatException, IOException {
        return Long.parseLong(nextToken());
    }

    int t1, t2;
    double k;

    public class Gnom {
        public int num;
        public double height;

        public Gnom(int aNum, double a, double b) {
            num = aNum;
            height = Math.floor(Math.max(a * t1 * k + b * t2, b * t1 * k
                     + a * t2) * 100)/100;
        }
    }

    public void Run() throws NumberFormatException, IOException {
        // br = new BufferedReader(new FileReader("input.txt"));
        // pw = new PrintWriter("output.txt");
        br = new BufferedReader(new InputStreamReader(System.in));
        pw = new PrintWriter(new OutputStreamWriter(System.out));
        int n = nextInt();
        t1 = nextInt();
        t2 = nextInt();
        k = 100 - nextInt();
        k = k/100;
        Gnom[] Cont = new Gnom[n];
        for (int i = 0; i < n; i++) {
            Cont[i] = new Gnom(i + 1, nextInt(), nextInt());
        }
        Arrays.sort(Cont, new Comparator<Gnom>() {

            @Override
            public int compare(Gnom o1, Gnom o2) {
                if (o1.height != o2.height) {
                    return (int) (o2.height - o1.height);
                } else {
                    return o1.num - o2.num;
                }
            }
        });
        for (int i = 0; i < n; i++) {
            pw.print(Cont[i].num);
            pw.print(' ');
            pw.format("%.2f%n", Cont[i].height);
        }
        pw.flush();
        pw.close();

    }

}


import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Comparator;
import java.util.StringTokenizer;

public class Solver {

    public static void main(String[] Args) throws NumberFormatException,
            IOException {
        new Solver().Run();

    }

    PrintWriter pw;
    StringTokenizer Stok;
    BufferedReader br;

    public String nextToken() throws IOException {
        while (Stok == null || !Stok.hasMoreTokens()) {
            Stok = new StringTokenizer(br.readLine());
        }
        return Stok.nextToken();
    }

    public int nextInt() throws NumberFormatException, IOException {
        return Integer.parseInt(nextToken());
    }

    public double nextDouble() throws NumberFormatException, IOException {
        return Double.parseDouble(nextToken());
    }

    public long nextLong() throws NumberFormatException, IOException {
        return Long.parseLong(nextToken());
    }

    double k,t1,t2;

    public class Gnom {
        public int num;
        public double height;

        public Gnom(int aNum, double a, double b) {
            num = aNum;
            height = StrictMath.floor(StrictMath.max(a * t1 * k + b * t2, b * t1 * k
                     + a * t2) * 100)*0.01;
        }
    }

    public void Run() throws NumberFormatException, IOException {
        // br = new BufferedReader(new FileReader("input.txt"));
        // pw = new PrintWriter("output.txt");
        br = new BufferedReader(new InputStreamReader(System.in));
        pw = new PrintWriter(new OutputStreamWriter(System.out));
        int n = nextInt();
        t1 = nextDouble();
        t2 = nextDouble();
        k = 100 - nextDouble();
        k = k/100;
        Gnom[] Cont = new Gnom[n];
        for (int i = 0; i < n; i++) {
            Cont[i] = new Gnom(i + 1, nextDouble(), nextDouble());
        }
        Arrays.sort(Cont, new Comparator<Gnom>() {

            @Override
            public int compare(Gnom o1, Gnom o2) {
                if (o1.height != o2.height) {
                    if (o1.height>o2.height){
                        return -1;
                    } else {
                        return 1;
                    }
                } else {
                    return o1.num - o2.num;
                }
            }
        });
        for (int i = 0; i < n; i++) {
            pw.print(Cont[i].num);
            pw.print(' ');
            pw.format("%.2f%n", Cont[i].height);
        }
        pw.flush();
        pw.close();

    }

}


import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Comparator;
import java.util.StringTokenizer;

public class Solver {

    public static void main(String[] Args) throws NumberFormatException,
            IOException {
        new Solver().Run();

    }

    PrintWriter pw;
    StringTokenizer Stok;
    BufferedReader br;

    public String nextToken() throws IOException {
        while (Stok == null || !Stok.hasMoreTokens()) {
            Stok = new StringTokenizer(br.readLine());
        }
        return Stok.nextToken();
    }

    public int nextInt() throws NumberFormatException, IOException {
        return Integer.parseInt(nextToken());
    }

    public double nextDouble() throws NumberFormatException, IOException {
        return Double.parseDouble(nextToken());
    }

    public long nextLong() throws NumberFormatException, IOException {
        return Long.parseLong(nextToken());
    }

    double k,t1,t2;

    public class Gnom {
        public int num;
        public double height;

        public Gnom(int aNum, double a, double b) {
            num = aNum;
            height = Math.floor(Math.max(a * t1 * k + b * t2, b * t1 * k
                     + a * t2) * 100)/100;
        }
    }

    public void Run() throws NumberFormatException, IOException {
        // br = new BufferedReader(new FileReader("input.txt"));
        // pw = new PrintWriter("output.txt");
        br = new BufferedReader(new InputStreamReader(System.in));
        pw = new PrintWriter(new OutputStreamWriter(System.out));
        int n = nextInt();
        t1 = nextDouble();
        t2 = nextDouble();
        k = 100 - nextDouble();
        k = k/100;
        Gnom[] Cont = new Gnom[n];
        for (int i = 0; i < n; i++) {
            Cont[i] = new Gnom(i + 1, nextDouble(), nextDouble());
        }
        Arrays.sort(Cont, new Comparator<Gnom>() {

            @Override
            public int compare(Gnom o1, Gnom o2) {
                if (o1.height != o2.height) {
                    if (o1.height>o2.height){
                        return -1;
                    } else {
                        return 1;
                    }
                } else {
                    return o1.num - o2.num;
                }
            }
        });
        for (int i = 0; i < n; i++) {
            pw.print(Cont[i].num);
            pw.print(' ');
            pw.format("%.2f%n", Cont[i].height);
        }
        pw.flush();
        pw.close();

    }

}