#arc144a. [arc144_a]Digit Sum of 2x

[arc144_a]Digit Sum of 2x

Problem Statement

For a positive integer xx, let f(x)f(x) be the sum of its digit. For example, f(144)=1+4+4=9f(144) = 1+4+4 = 9 and f(1)=1f(1)=1.

You are given a positive integer NN. Find the following positive integers MM and xx:

  • The maximum positive integer MM for which there exists a positive integer xx such that f(x)=Nf(x)=N and f(2x)=Mf(2x)=M.
  • The minimum positive integer xx such that f(x)=Nf(x)=N and f(2x)=Mf(2x)=M for the MM above.

Constraints

  • 1leqNleq1051\\leq N\\leq 10^5

Input

Input is given from Standard Input in the following format:

NN

Output

Print MM in the first line and xx in the second line.


Sample Input 1

3

Sample Output 1

6
3

We can prove that whenever f(x)=3f(x)=3, f(2x)=6f(2x) = 6. Thus, M=6M=6. The minimum positive integer xx such that f(x)=3f(x)=3 and f(2x)=6f(2x)=6 is x=3x=3. These MM and xx should be printed.


Sample Input 2

6

Sample Output 2

12
24

Sample Input 3

100

Sample Output 3

200
4444444444444444444444444