#C10071. Find the Pair

    ID: 39236 Type: Default 1000ms 256MiB

Find the Pair

Find the Pair

You are given an integer M. Your task is to determine whether there exists a pair of positive integers X and Y satisfying the equation

\(X^2 + 7^Y = M\)

If such a pair exists, output one valid pair (X, Y). Otherwise, output -1.

Note: Both X and Y must be positive integers (i.e., greater than 0).

inputFormat

Input consists of a single line with one integer M.

You should read from standard input.

outputFormat

If a valid pair (X, Y) exists, print the two integers separated by a space. Otherwise, print -1.

Output the result to standard output.

## sample
50
1 2