eolymp
bolt
Try our new interface for solving problems
Problems

2-variable Function

2-variable Function

Time limit 1 second
Memory limit 128 MiB

Given an integer n, find the smallest integer x that satisfies two conditions:

  • x is greater than or equal to n;

  • There is a pair of non-negative integers (a, b) such that x = a^3 + a^2 \cdot b + a \cdot b^2 + b^3.

Input data

One nonnegative integer n~(n \le 10^{18}).

Output data

Print the smallest value of x.

Examples

Input example #1
9
Output example #1
15
Input example #2
0
Output example #2
0