Even-Sum Sequence

Replace the fewest entries so every length-k window sum is even, then output the lexicographically smallest such sequence.

Medium6MathGreedyNo attempts yetTime limit1sMemory limit256 MB

Problem

You are given an integer sequence a1,a2,,ana_1, a_2, \dots, a_n. If ai+ai+1++ai+k1a_i + a_{i+1} + \dots + a_{i+k-1} is even for every integer ii with 1ink+11 \le i \le n - k + 1, the sequence is called a kk-even-sum sequence.

You can replace some elements of the sequence with any integers you want. Find the minimum number of elements you have to replace to turn the sequence into a kk-even-sum sequence, and print the sequence you get.

Input

The first line has the integers nn and kk. (1kn1061 \le k \le n \le 10^6)

The second line has nn integers. The ii-th of them is aia_i. (0ai1090 \le a_i \le 10^9)

Output

On the first line print the minimum number of elements that have to be replaced.

On the second line print the nn elements of the finished sequence, separated by single spaces. Every element must satisfy 0ai2×1090 \le a_i \le 2 \times 10^9.

If several sequences reach that minimum, print the lexicographically smallest one. Between two sequences of the same length, the one holding the smaller value at the first position where they differ comes first.