Jumbled Communication

Recover each original byte x from the scrambled value x xor (x shifted left by one).

Easy3Bit manipulationBrute forceInterviewNo attempts yetTime limit5sMemory limit256 MB

Problem

Your friend Adam bought a Raspberry Pi, a wireless temperature sensor, and a 433MHz receiver that picks up the signals the sensor sends. Adam plans to use the Raspberry Pi as an indoor display for his weather sensor. He is good with electronics, so he quickly got the receiver to pick up the sensor signals. When he looked at the bytes the sensor had sent, though, he could not make sense of them. After hours of reading through websites he found a document explaining that his weather sensor scrambles the data it sends, so that it cannot be used together with products from other manufacturers.

The document also describes how the sensor scrambles its communication. The sensor applies the expression x ^ (x << 1) to every byte it sends. The ^ operator is bit-wise exclusive or, for example 10110000 ^ 01100100 = 11010100. The << operator is a left shift of a byte value, and it does not wrap bits around, for example 10111001 << 1 = 01110010.

In bit-wise exclusive or, bit ii of the result is 1 if and only if exactly one of the two operands has bit ii set. In x << j, the bits of xx move jj steps to the left. The jj most significant bits of xx are discarded, and jj zeroes become the least significant bits of the result. Here xx is an 8-bit byte, so the result is 8 bits wide as well.

For Adam's Raspberry Pi to read the bytes correctly, the transmission has to be unscrambled. Write the unscrambling algorithm for him.

Input

The first line contains an integer nn, the number of bytes in the message the weather sensor sent. (1n1051 \le n \le 10^5)

The second line contains the byte values of the message, b1,b2,,bnb_1, b_2, \dots, b_n, separated by spaces. (0bi2550 \le b_i \le 255)

Output

Print the nn byte values of the unscrambled message in decimal on one line, separated by single spaces.