//要点 log()自然对数,log10()以10为底对数
//年份四舍五入
#include<stdio.h>
#include<math.h>
int main(){
int a,b;
int year,n,m,i;
i = 1;
while(1){
scanf("%d%d",&a,&b);
if(a == 0&&b == 0) break;
else{
year = -5730*log10(b*1.0/(a*810))/log10(2);
if(year > 10000){
n = year / 100;
m = n % 10;
if(m>=5) n = (n / 10 +1)*1000;
else n = n/10*1000;
}
else{
n = year / 10;
m = n % 10;
if(m>=5) n = (n/10 + 1)*100;
else n = n/10*100;
}
printf("Sample #%d\nThe approximate age is %d years.\n\n",i,n);
i++;
}
}
return 0;
}