#include<bits/stdc++.h>
using namespace std;
int main(){
int s=0,f=0;
double a,b,c,d,m=0,cb;
while(cin>>a>>b>>c>>d){
cb=b;
if(a==0)break;
else {
while(m<=a or m>=0){
s+=1;
f+=1;
if(cb<0)m+=0;
else m+=cb;
if(m>a)break;
cb=b-b*d/100*s;
m-=c;
if(m<0)break;
}
if(m>a)cout<<"success on day "<<s<<endl;
else if(m<0)cout<<"failure on day "<<f<<endl;
}
s=0;f=0;m=0;
}
}