P9901 [HackerEarth] smallest positive integer
普及
题目描述

Given a number X between 0 to 1000000006 find smallest positive integer Y such that the products of digits of Y modulo 1000000007 is X.

Input Format

A single integer - X

Output Format

A single integer - Y

Input Constraint

0 ≤ X ≤ 1000000006

Problem Setter: Practo Tech Team

SAMPLE INPUT
16

SAMPLE OUTPUT
28

Explanation

If x is 16 then y is 28 as (2*8)%1000000007 = 16

输入格式

见题面

输出格式

见题面

样例输入
16
样例输出
28