Given two infinite non-decreasing sequences and . Find the -th element in the non-decreasing sequence , which contains all elements from and (including duplicates).
The sequence is defined using the polynomial P(x) = x^3 as follows:
The sequence is defined using the polynomial Q(x) = x^2 as follows:
The input file contains the integer (1 \leq k \leq 10^7).
Output one integer—the answer to the problem. It is guaranteed that the answer does not exceed 2 \cdot 10^9.
Example 1