Let k be the magic constant for number n, if 1 + 2 + 3 + . . . + (k - 1) + k = n. Your task is to find the magic constant for a given number.
One number n (1 ≤ n ≤ 10^18).
10^18
Print the magic constant for number n, if it exists and -1 otherwise.