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
Satyam Mishra: 2015-06-01 18:41:30

piece of cake :) ....

Kshitij Agarwal: 2015-05-29 11:23:59

isn't conversion for 8(1000) be 7(0111) ?

[Mayank Pratap]: 2015-05-26 05:10:13

I loved this ..... Easy but nice....

ASHUTOSH DWIVEDI: 2015-05-11 11:20:32

AC in one go :) easy one....

[Lakshman]: 2014-09-11 02:01:12

@Practise! 'inverts its binary representation'? means just revers its Binary representation.

Mitch Schwartz: 2014-09-11 02:01:12

Satisfying "all test cases" is not the same as satisfying the example test cases. In general example test cases may be designed just to demonstrate the proper input/output formatting or maybe help with understanding of the problem, and only sometimes are harder cases included to help with debugging. In general, everything to understand and solve the problem should be included in the statement, and e.g. additional test cases would be a spoiler in my opinion. You may ask for help on the forums, but here it just clogs the comment section and may bury more valuable comments. Comments I would rather see: those that help to clarify anything unclear in the problem statement, or point out things that should be fixed; insights or connections that don't give too much away (a general statement about complexity is sometimes ok, or a link to a similar problem); an expression of appreciation if you really enjoyed solving the problem; ...

SanchitK: 2014-09-11 02:01:12

it satisfies all the test case given but still it is giving WA.
please give more test cases


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