406551: GYM102439 E Small business
Description
A little girl named Julia has decided to open a toy store in the backyard. She decided to sell two types of goods: teddy bears and stuffed bunnies. As you know, every normal store has price tags for its goods. But Julia still can not write, although she is taking her first steps in business. That's why she decided to form price tags from her kids blocks with numbers using every single block, so that not one is lost. Julia is very kind and generous, so she decided that prices should form a minimum pair, should not be more than $$$10^{18}$$$, and even can be equal to zero. However, the girl doesn't like leading zeros, so they shouldn't be present on price tags. Let's support small business and help to form two price tags from the available blocks.
InputThe first and the only line contains a list of available blocks — string $$$s$$$ consisting of digits only. $$$$$$1 \le |s| \le 50 $$$$$$
OutputOutput two price tags. Remember that the minimum pair is a pair where, firstly, the lower of the two prices is minimal, and, secondly, the other price is also the minimal possible for the given first one. If such price tags can't be formed, output «-1 -1».
ExamplesInput123456Output
1 23456Input
42Output
2 4Input
000Output
-1 -1