Carbon Dating

No attempts yetTime limit1sMemory limit128 MB

Problem

Until the second half of the 20th century, determining the actual age of an archaeological find was largely a matter of educated guessing. Comparing a find to previously dated ones and studying its surroundings were the best techniques available.

Today there is a far more reliable method: carbon dating. It works as follows. Naturally occurring carbon is a mixture of stable isotopes (mostly $^{12}\mathrm{C}$) and the unstable, radioactive isotope $^{14}\mathrm{C}$. In living organisms the ratio between the two is almost constant: $^{14}\mathrm{C}$ slowly decays, but at the same time solar radiation produces the same amount in the upper atmosphere, which organisms continually take in.

Once a tree is felled and turned into wood, however, it no longer takes in new $^{14}\mathrm{C}$, so the amount present decreases steadily through radioactive decay. In this problem you must write a program that estimates the approximate age of a sample from the amount of $^{14}\mathrm{C}$ still remaining. Use the following facts.

  • The amount of $^{14}\mathrm{C}$ in a sample halves every 5730 years (the half-life of $^{14}\mathrm{C}$).
  • The rate of decay (measured in decays per hour per gram of carbon) is proportional to the amount of $^{14}\mathrm{C}$ left in the sample.
  • In a living organism (age zero) there are 810 decays per hour per gram of carbon.

So, for example, if one gram of carbon in a sample shows 405 decays per hour, the sample is about 5730 years old.

Input

Each line describes one sample to date and contains two positive integers $w$ and $d$. $w$ is the amount of carbon in the sample, measured in grams, and $d$ is the number of decays measured over one hour.

The input is terminated by a line with $w = d = 0$, which must not be processed.

Output

For each sample, first print its number, then print its estimated age in the format:

The approximate age is x years.

If the age is less than 10000 years, round $x$ to the nearest multiple of 100 years (rounding up in case of a tie). If the age is more than 10000 years, round it to the nearest multiple of 1000 years (again rounding up in case of a tie).

Separate consecutive samples with a blank line.