Problem

4 /8


Two arrays (lite)

Problem

Alice and her father Professor Seleznev write down the numbers of a certain sequence on a piece of paper. Alice's i-th sequence member is i2, Professor Seleznev's i-th sequence member is i3. They decided to create a new ascending sequence by concatenating two of their own sequences. In this case, if both sequences contain the same number, then it is present only once in the new sequence. 

Alice and the professor ask you to guess the i-th number in the new combined sequence. 


Input

The single line of the input file contains a natural number i (1 <= i <= 107).


Output

Print the i-th number of the new sequence. 

 
Examples
# Input Output
1 1 1
2 2 4
3 4 9