Extending Goldbach's Conjecture

No attempts yetTime limit1sMemory limit128 MB

Problem

Let mm be a positive integer. Writing an even mm of at least 44 as a sum of two primes, and writing an odd mm greater than 77 as a sum of three primes, are questions that no algorithm settles today, and nobody has proved that such a sum always exists.

So we change the target. Numbers that add up to m3m^3 are more likely to exist than numbers that add up to mm. To keep the search from turning trivial and the checking from turning hard (a sum of primes can have many answers), we look for mm consecutive odd integers instead of primes. When such a run exists, it is the only one.

For example, take m=2m = 2. Then 23=82^3 = 8, and 88 is the sum of the two consecutive odd integers 3+53 + 5.

Input

Each line holds one integer mm with 1m1091 \le m \le 10^9. The last line holds m=0m = 0 and marks the end of the input. The input has at most 100100 values of mm.

Output

For each mm before the terminating 00, print one line holding two fields AA and BB separated by a single space.

AA is Y if mm consecutive odd integers adding up to m3m^3 exist, and N if they do not.

BB is the first of those mm odd integers when AA is Y, and 00 otherwise.