시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
5 초 128 MB 127 43 28 50.000%

문제

N개의 램프를 다음과 같은 규칙에 의해 켜고 끄려 한다.

0001 -> 0011 -> 0101 -> 1111 -> 0000 -> 0000 -> …

1은 램프가 켜져 있는 상태를 의미하고. 0은 꺼져 있는 상태를 의미한다. 매 초마다 램프들의 상태를 바꾸는데, 만약 전 시간에 자신의 오른 쪽 램프가 켜져 있었다면 다음 시간에 그 램프의 상태를 바꾸는 것이다. 1번 램프는 N번 램프의 오른쪽이라고 생각하자.

램프들의 모양이 주어졌을 때, M초 후의 램프들의 모양을 구하는 프로그램을 작성하시오.

입력

첫째 줄에 N(1≤N≤1,000,000), M (1≤M≤1,000,000,000)이 주어진다. N개의 줄에는 0 또는 1이 주어진다.

출력

N개의 줄에 램프의 상태를 출력한다.

예제 입력 1

3 1
0
0
1

예제 출력 1

0
1
1
W3sicHJvYmxlbV9pZCI6IjIyNzIiLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWI3YThcdWQ1MDQiLCJkZXNjcmlwdGlvbiI6IjxwPk5cdWFjMWNcdWM3NTggXHViN2E4XHVkNTA0XHViOTdjIFx1YjJlNFx1Yzc0Y1x1YWNmYyBcdWFjMTlcdWM3NDAgXHVhZGRjXHVjZTU5XHVjNWQwIFx1Yzc1OFx1ZDU3NCBcdWNmMWNcdWFjZTAgXHViMDQ0XHViODI0IFx1ZDU1Y1x1YjJlNC48XC9wPlxyXG48cD4wMDAxIC0mZ3Q7IDAwMTEgLSZndDsgMDEwMSAtJmd0OyAxMTExIC0mZ3Q7IDAwMDAgLSZndDsgMDAwMCAtJmd0OyAmaGVsbGlwOzxcL3A+XHJcbjxwPjFcdWM3NDAgXHViN2E4XHVkNTA0XHVhYzAwIFx1Y2YxY1x1YzgzOCBcdWM3ODhcdWIyOTQgXHVjMGMxXHVkMGRjXHViOTdjIFx1Yzc1OFx1YmJmOFx1ZDU1OFx1YWNlMC4gMFx1Yzc0MCB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