## GUPTA MECHANICAL

IN THIS WEBSITE I CAN TELL ALL ABOUT TECH. TIPS AND TRICKS APP REVIEWS AND UNBOXINGS ALSO TECH. NEWS .............

# [Solution] The Third Three Number Problem Codeforces Solution

A. The Third Three Number Problem
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

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 $\left(a\oplus b\right)+\left(b\oplus c\right)+\left(a\oplus c\right)=n$, or determine that there are no such integers.

Solution Click Below:-  👉
👇👇👇👇👇

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 Third Three Number Problem Codeforces Solution

Almost Ternary Matrix Codeforces Solution

The Third Problem Codeforces Solution

Almost Triple Deletions CodeForces Solution

Three Days Grace Codeforces Solution

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 $\left(a\oplus b\right)+\left(b\oplus c\right)+\left(a\oplus c\right)=n$. If no such integers exist, print $-1$.