eolymp
bolt
Try our new interface for solving problems
Problems

Sum of cubes

Sum of cubes

Write a program to find the minimal positive integer with the given sum of cubes of digits.

Input

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

Output

Print the minimal positive integer with the given sum of cubes of digits.

Time limit 1 second
Memory limit 122.17 MiB
Input example #1
1    
Output example #1
1
Input example #2
9    
Output example #2
12