ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules

1014. Product of Digits

Time limit: 1.0 second
Memory limit: 64 MB
Your task is to find the minimal positive integer number Q so that the product of digits of Q is exactly equal to N.

Input

The input contains the single integer number N (0 ≤ N ≤ 109).

Output

Your program should print to the output the only number Q. If such a number does not exist print −1.

Sample

inputoutput
10
25
Problem Source: Ural State University Internal Contest '99 #2