#include <bits/stdc++.h>
using namespace std ;
int main ()
{
double x ,a ,b ,h ,d ,u , f ;
while (cin>>h>>u>>d>>f )
{
if (h==0) break ;
a=u-d ;
if (u>h) printf ("success on day 1\n") ;
else if (a<0) printf ("failure on day 1\n") ;
else
{
int da =1 ;
x=(f*u)/100.0 ;
int op=0 ;
while (1)
{
da++ ;
u=u-x ;
if (u<0) u=0 ;
b= a+u ;// cout<<a<<" "<<u<<" "<<b<<endl ;
if (b<h) b=b-d ;
else { op=1 ; break ;}
a=b ;
if (a<0) break ;
}
if (op==1) printf ("success on day %d\n",da) ;
else printf ("failure on day %d\n",da) ;
}
}
return 0 ;
}
using namespace std ;
int main ()
{
double x ,a ,b ,h ,d ,u , f ;
while (cin>>h>>u>>d>>f )
{
if (h==0) break ;
a=u-d ;
if (u>h) printf ("success on day 1\n") ;
else if (a<0) printf ("failure on day 1\n") ;
else
{
int da =1 ;
x=(f*u)/100.0 ;
int op=0 ;
while (1)
{
da++ ;
u=u-x ;
if (u<0) u=0 ;
b= a+u ;// cout<<a<<" "<<u<<" "<<b<<endl ;
if (b<h) b=b-d ;
else { op=1 ; break ;}
a=b ;
if (a<0) break ;
}
if (op==1) printf ("success on day %d\n",da) ;
else printf ("failure on day %d\n",da) ;
}
}
return 0 ;
}