#include<bits/stdc++.h>
using namespace std;
int check(double h,double u,double d, double f){
int day;
double s;
f=u*f/100;
for(day=1, s=0; ;day++){
s+=u;
if(s>h) return day;
s-=d;
if(s<0) return -day;
u-=f;
if(u<0) u=0;
}
}
int main(){
int h,u,d,f,ans;
while(1)
{
cin>>h>>u>>d>>f;
if(h==0) break;
ans=check(h,u,d,f);
if(ans<0) cout<<"failure on day "<<-ans<<endl;
else cout<<"success on day "<<ans<<endl;
}
}