Parity

Time limit1sMemory limit128 MB

Problem

A bit string is said to have odd parity if it contains an odd number of 1s, and even parity if it contains an even number of 1s. Zero is considered even, so a bit string with no 1s has even parity.

You are given a bit string whose last bit has been erased, together with the parity that the bit string must have. Write a program that correctly restores the erased last bit.

Input

The input consists of several lines. Each line contains one bit string with its last bit erased; the number of remaining bits is between 1 and 31, inclusive. The last character of each line is either e or o, indicating the parity the bit string must have: e for even parity and o for odd parity. The final line contains a single #, marking the end of the input.

Output

For each bit string, print the completed bit string with the erased last bit filled in with the correct value, one per line.