407386: GYM102780 J Something that resembles Waring's problem

Memory Limit:256 MB Time Limit:4 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

J. Something that resembles Waring's problemtime limit per test4 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard output

Waring's problem is a number-theoretic statement, according to which for every integer $$$n>1$$$ there exists a number $$$k=k(n)$$$ such that any natural number $$$N$$$ can be represented as: $$$$$$x_1^n + x_2^n + ... + x_k^n = N$$$$$$ with non-negative integers $$$x_1$$$, $$$x_2$$$, ..., $$$x_n$$$.

You are required to represent the number $$$x$$$ in the form of $$$a_1^3 + a_2^3 + ... + a_k^3 = x$$$, with integers $$$a_1$$$, ..., $$$a_k$$$ and $$$k \le 5$$$.

Input

The first line contains the number $$$x$$$ $$$(1 \le x \le 10^{100000})$$$.

Output

If such a representation does not exist, type $$$-1$$$. Otherwise, in the first line, type the number $$$k$$$ — the number of numbers. In the second line, type $$$k$$$ integers $$$a_i$$$ $$$(|a_i| \le 10^{110000})$$$.

ExamplesInput
5
Output
5
1 1 1 1 1
Input
17
Output
3
1 2 2
Note

In the first example: $$$1^3 + 1^3 + 1^3 + 1^3 + 1^3 = 5$$$.

In the second example: $$$1^3 + 2^3 + 2^3 = 17$$$.

加入题单

算法标签: