Moderate Numbers#6464

Moderate Numbers

1 second
256 megabytes
Hard

A positive integer is called a moderate number if the product of its digits is equal to their sum. You are given an integer . Find the -th moderate number. Moderate numbers are numbered starting from .

Input

The only line contains a single integer (1 \leq n \leq 10^{18}).

Output

Print the -th moderate number.

Examples

Example 1

Loading
Loading