C. Perfect Split
time limit per test
1 second
memory limit per test
1024 megabytes
input
standard input
output
standard output

When Onisilos of Salamis rose to free his land, an oracle told him: "To win, you must divide your power in two yet keep your spirit whole." At first, Onisilos was puzzled by this phrase, but later realized its meaning.

The army of Onisilos consists of $$$n$$$ soldiers. Onisilos defines the spirit of the army of size $$$x$$$ as the sum of digits of the number $$$x$$$ in decimal notation. For example, the spirit of the army of size 243 is $$$s(243)=2+4+3=9$$$.

Onisilos needs to split his army into two parts, such that each part has the same spirit as the whole army. In other words, you need to find integers $$$a$$$ and $$$b$$$ such that:

  • $$$n = a + b$$$, and
  • $$$s(a) = s(b) = s(n)$$$, where $$$s(x)$$$ is the sum of digits of the number $$$x$$$ in decimal notation.

For example, if $$$n=243$$$, you can choose $$$a=216$$$ and $$$b=27$$$, so $$$243=216+27$$$, and $$$2+1+6=2+7=2+4+3$$$.

Input

The input contains one integer $$$n$$$ without leading zeroes ($$$1\le n \lt 10^{100000}$$$). Note that this number may be huge.

Output

Print two integers $$$a$$$ and $$$b$$$ that satisfy the required properties. If there are multiple solutions, output any. If there is no solution, output $$$-1$$$.

Scoring

This task contains four subtasks. To get the points for the subtask, your solution should pass all the tests in the corresponding subtask.

SubtaskConstraintsPoints
$$$1$$$$$$n \le 10^{6}$$$$$$10$$$
$$$2$$$$$$n \le 10^{50}$$$$$$20$$$
$$$3$$$$$$n \le 10^{1000}$$$$$$30$$$
$$$4$$$no additional constraints$$$40$$$
Examples
Input
243
Output
216
27
Input
42
Output
-1