Product of digits#194

Product of digits

1 second
64 megabytes
Very easy

Find the smallest and largest natural numbers such that the product of their digits is equal to the given natural number . If no such numbers exist, output -1 -1. The digits and must not be used in constructing these numbers.

Input

The input contains a single integer (2 \leq M \leq 10^3).

Output

Output two integers — the smallest and the largest such numbers — in ascending order.

Examples

Example 1

Loading
Loading