FA

Starting from a huge integer x, repeatedly replace it with (first digit) times (digit count) and report whether the sequence eventually cycles forever.

Medium4MathImplementationSimulationHash mapNo attempts yetTime limit1sMemory limit128 MB

Problem

The function F(x)F(x) returns the first digit of xx multiplied by the number of digits of xx.

For example, if x=932x = 932, the first digit is 99 and the number of digits is 33, so F(932)=9×3=27F(932) = 9 \times 3 = 27.

Apply FF to the given xx, then apply FF to the result, and keep repeating. If the same number keeps coming out from some point on, xx is called an FA number.

Decide whether xx is an FA number.

Input

The first line contains an integer xx (0x101000 \le x \le 10^{100}).

Output

Print FA if xx is an FA number, and NFA otherwise.