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
import sys

def get_min_length_single_digit_factors(x):
	original_x = x
	factor_counts = [0]*10
	for i in xrange(8):
		if x < 2:
			break
		factor = 9-i
		while x % factor == 0:
			x = x/factor
			factor_counts[factor] += 1
	if not x==1:
		return get_min_length_single_digit_factors(original_x+1000000007)

	return factor_counts

def get_smallest_positive_int(x):
	if x==0:
		return str(10);
	factor_counts = get_min_length_single_digit_factors(x)
	ret =""
	for digit,count in enumerate(factor_counts):
		if count > 0:
			for j in xrange(count):
				ret += str(digit)
	return ret

def main():
	X = input()
	sys.stdout.write(get_smallest_positive_int(X))
	
if __name__=="__main__":
	main()