시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 128 MB 573 429 404 75.233%

문제

1의 개수가 홀수개인 비트스트링을 "홀수 패리티"를 가지고 있다고 한다. 또, 짝수개인 경우에는 "짝수 패리티"를 가지고 있다고 한다. 또, 0도 짝수로 간주한다. 따라서, 1이 없는 비트 스트링은 짝수 패리티를 가지고 있다.

마지막 숫자가 지워진 비트 스트링이 주어지고, 이 비트 스트링의 패리티가 주어졌을 때, 마지막 숫자를 올바르게 구하는 프로그램을 작성하시오.

입력

입력은 여러 개의 비트 스트링으로 이루어져 있다. 각 비트 스트링은 한 줄로 이루어져 있고, 길이는 1~31비트이다. 또, 비트 스트링의 마지막 문자는 e 또는 o이다. (e: 짝수 패리티, o: 홀수 패리티) 마지막 줄에는 '#'이 주어진다.

출력

입력으로 주어진 각각의 비트 스트링에 대해서, 마지막 문자를 올바른 비트로 바꾼 비트 스트링을 출력한다.

예제 입력 1

101e
010010o
1e
000e
110100101o
#

예제 출력 1

1010
0100101
11
0000
1101001010

힌트

W3sicHJvYmxlbV9pZCI6IjQ1OTciLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWQzMjhcdWI5YWNcdWQyZjAiLCJkZXNjcmlwdGlvbiI6IlxyXG48cD5cclxuXHQxXHVjNzU4IFx1YWMxY1x1YzIxOFx1YWMwMCBcdWQ2NDBcdWMyMThcdWFjMWNcdWM3NzggXHViZTQ0XHVkMmI4XHVjMmE0XHVkMmI4XHViOWMxXHVjNzQ0ICZxdW90O1x1ZDY0MFx1YzIxOCBcdWQzMjhcdWI5YWNcdWQyZjAmcXVvdDtcdWI5N2MgXHVhYzAwXHVjOWMwXHVhY2UwIFx1Yzc4OFx1YjJlNFx1YWNlMCBcdWQ1NWNcdWIyZTQuIFx1YjYxMCwgXHVjOWRkXHVjMjE4XHVhYzFjXHVjNzc4IFx1YWNiZFx1YzZiMFx1YzVkMFx1YjI5NCAmcXVvdDtcdWM5ZGRcdWMyMTggXHVkMzI4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