eolymp
bolt
Try our new interface for solving problems
Problems

Product of digits

Product of digits

Time limit 1 second
Memory limit 128 MiB

Find the largest positive integer which product of digits equals to the positive integer m, or print -1 if there no such number. Numbers that contain digits 0 and 1 are not considered.

Input data

One integer m (2m10^3).

Output data

Print the largest positive integer which product of digits equals to m. Print -1 if such number does not exist.

Examples

Input example #1
12
Output example #1
322
Source 2019 All-Ukrainian Olympiad, Zhitomyr region, ІІ stage