eolymp
bolt
Try our new interface for solving problems
Problems

Sum of cubes

Sum of cubes

Write a program that finds the minimal positive integer with a given sum of cubes of digits.

Input

One number - the required sum of cubes of digits n (1n8000).

Output

Print one number - the answer to the problem.

Time limit 1 second
Memory limit 128 MiB
Input example #1
1    
Output example #1
1
Input example #2
9    
Output example #2
12
Source 2018 Azerbaijan School Competition, II Stage, April 8, Problem G