#t113. 与或和2025

与或和2025

AND-OR Sum 2025

Problem Description

Little A has an integer xx. He wants to find the smallest positive integer yy such that the following equation holds:

$(x \operatorname{and} y) + (x \operatorname{or} y) = 2025$

Here and⁡\operatorname{and} denotes the bitwise AND operation and or⁡\operatorname{or} denotes the bitwise OR operation. If no such yy exists, output −1-1.

Input Format

One line containing one integer xx.

Output Format

One line containing one integer: if a satisfying yy exists, output yy; otherwise output −1-1.

Sample Input

1025

Sample Output

1000

Sample Explanation

By a property of bitwise operations, for any integers x,yx, y we always have $(x \operatorname{and} y) + (x \operatorname{or} y) = x + y$.

Therefore the original equation is equivalent to x+y=2025x + y = 2025, which gives y=2025−xy = 2025 - x. When x=1025x = 1025, y=1000y = 1000, and 10001000 is a positive integer, so output 10001000.

Constraints

For all test cases, 0≤x<20250 \le x < 2025.