#include<iostream.h>
#include<math.h>
//using namespace std;
//公式是N=No(1/2)^(t/T),由于No=原子数(题中的w)* 810,
//而N为t时刻的原子总质量(题中的d),使公式变形,得:
int main() // t=5730*log((810*w)/d)
{
int num,sen,j=1;
double sum;
while(cin>>num>>sen)
{
if(num==0&&sen==0)
return 0;
cout<<"Sample #"<<j<<endl;
sum=810*num/double(sen);
sum=5730*log10(sum)/log10(2);
if(sum<=10000)
sum=(int(sum)+50)/100*100;
else
sum=(int(sum)+500)/1000*1000;
cout<<"The approximate age is "<<sum<<" years."
<<endl<<endl;
j++;
}
return 0;
}