Codeforces Round 804 (Div. 2)
A
The Third Three Number Problem
Codeforces
800
原题
←B →
翻译中…

You are given a positive integer $n$. Your task is to find any three integers $a$, $b$ and $c$ ($0 \le a, b, c \le 10^9$) for which $(a\oplus b)+(b\oplus c)+(a\oplus c)=n$, or determine that there are no such integers.

翻译中…

Here $a \oplus b$ denotes the bitwise XOR of $a$ and $b$. For example, $2 \oplus 4 = 6$ and $3 \oplus 1=2$.

翻译中…

Input

翻译中…

Each test contains multiple test cases. The first line contains a single integer $t$ ($1 \le t \le 10^4$) — the number of test cases. The following lines contain the descriptions of the test cases.

翻译中…

The only line of each test case contains a single integer $n$ ($1 \le n \le 10^9$).

翻译中…

Output

翻译中…

For each test case, print any three integers $a$, $b$ and $c$ ($0 \le a, b, c \le 10^9$) for which $(a\oplus b)+(b\oplus c)+(a\oplus c)=n$. If no such integers exist, print $-1$.

翻译中…

Note

翻译中…

In the first test case, $a=3$, $b=3$, $c=1$, so $(3 \oplus 3)+(3 \oplus 1) + (3 \oplus 1)=0+2+2=4$.

翻译中…

In the second test case, there are no solutions.

翻译中…

In the third test case, $(2 \oplus 4)+(4 \oplus 6) + (2 \oplus 6)=6+2+4=12$.

翻译中…

样例

Input #1
5
4
1
12
2046
194723326
Output #1
3 3 1
-1
2 4 6
69 420 666
12345678 87654321 100000000
InputCopy OutputCopy
题目信息
题号
1699A
时间限制
1 s
内存限制
256 MB
标签
构造
数学

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。