EC_CONB - Even Numbers


 

Marina is a college girl who likes to play with all kinds of numbers. One day she was very bored and decided to play around with even numbers.
She notes N numbers on the board(odd and even numbers) and then, she modifies only even numbers (for some reason she likes the odd numbers) and inverts its binary representation and replaces each even number. But soon she gets bored and ask  you help in order to automate the conversion process.

Marina is a college girl who likes to play with all kinds of numbers. One day she was very bored and decided to play around with even numbers.

She writes N numbers on the board (odd and even numbers) and then, she modifies only even numbers (for some reason she likes the odd numbers) and reversed its binary representation (from the left to the right ) and replaces each even number. But soon she gets bored and ask  you help in order to automate the conversion process.

Input

In the first line contains the value of N. This integer is followed by N lines, every one with a positive integer ai (1 <= ai <= 10^7).

Output

The output will contain N lines, the numbers that are on the blackboard after the conversion process.

Example

Input:
5
10
8
3
5
2

Output:
5
1
3
5
1

hide comments
prakash_reddy: 2015-08-20 20:29:00

Easy one.... :)

RADHE SHYAM LODHI: 2015-08-15 08:50:14

50th ! :)

7Bubble: 2015-08-14 19:23:54

The statement is quit.. confusing..!! For clarification please see vedang's comment ...

vedang: 2015-08-01 14:23:45

Technically, it's not inverted binary. It's reversing the binary representation of a number.

Indian Cyber Army (IndiShell): 2015-07-21 08:54:30

For all those who got confused like me, in this problem inverting the bits does NOT mean changing each bit from 0 to 1 and from 1 to 0.
It simply means, rotating the bits around like 0111 to 1110 etc..

Last edit: 2015-07-21 09:11:52
:?ToRpiDo: 2015-07-17 08:12:29

cake piece.:-)

vasayashwanth: 2015-07-10 16:37:47

playing with bits.............

Meek: 2015-07-02 21:55:46

Tried vector 1st time -> green ;)

Ankush : 2015-06-26 09:11:16

8 lines with python ;)

akar sheth: 2015-06-02 19:14:42

very easy ;) AC at first try.


Added by:Eddy Cael
Date:2013-10-12
Time limit:1s
Source limit:2000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:C CSHARP C++ 4.3.2 CPP C99 HASK JAVA PYTHON RUBY