A schoolboy named Vasya loves reading books on programming and mathematics. He has recently read an encyclopedia article that described the method of median smoothing (or median filter) and its many applications in science and engineering. Vasya liked the idea of the method very much, and he decided to try it in practice.

Applying the simplest variant of median smoothing to the sequence of numbers *a*<sub class="lower-index">1</sub>, *a*<sub class="lower-index">2</sub>, ..., *a*<sub class="lower-index">*n*</sub> will result a new sequence *b*<sub class="lower-index">1</sub>, *b*<sub class="lower-index">2</sub>, ..., *b*<sub class="lower-index">*n*</sub> obtained by the following algorithm:
 -  *b*<sub class="lower-index">1</sub> = *a*<sub class="lower-index">1</sub>, *b*<sub class="lower-index">*n*</sub> = *a*<sub class="lower-index">*n*</sub>, that is, the first and the last number of the new sequence match the corresponding numbers of the original sequence. -  For *i* = 2, ..., *n* - 1 value *b*<sub class="lower-index">*i*</sub> is equal to the median of three values *a*<sub class="lower-index">*i* - 1</sub>, *a*<sub class="lower-index">*i*</sub> and *a*<sub class="lower-index">*i* + 1</sub>. 
The median of a set of three numbers is the number that goes on the second place, when these three numbers are written in the non-decreasing order. For example, the median of the set 5, 1, 2 is number 2, and the median of set 1, 0, 1 is equal to 1.

In order to make the task easier, Vasya decided to apply the method to sequences consisting of zeros and ones only.

Having made the procedure once, Vasya looked at the resulting sequence and thought: what if I apply the algorithm to it once again, and then apply it to the next result, and so on? Vasya tried a couple of examples and found out that after some number of median smoothing algorithm applications the sequence can stop changing. We say that the sequence is stable, if it does not change when the median smoothing is applied to it.

Now Vasya wonders, whether the sequence always eventually becomes stable. He asks you to write a program that, given a sequence of zeros and ones, will determine whether it ever becomes stable. Moreover, if it ever becomes stable, then you should determine what will it look like and how many times one needs to apply the median smoothing algorithm to initial sequence in order to obtain a stable one.
The first input line of the input contains a single integer *n* (3 ≤ *n* ≤ 500 000) — the length of the initial sequence.

The next line contains *n* integers *a*<sub class="lower-index">1</sub>, *a*<sub class="lower-index">2</sub>, ..., *a*<sub class="lower-index">*n*</sub> (*a*<sub class="lower-index">*i*</sub> = 0 or *a*<sub class="lower-index">*i*</sub> = 1), giving the initial sequence itself.
n = int(input())
A = list(input().split())
B = [0] * n
go = True
count = 0
while go:
	B[0] = A[0]
	B[n - 1] = A[n - 1]
	for i in range (1, n - 1):
		if A[i - 1] == A[i + 1]:
			B[i] = A[i - 1]
		else:
			B[i] = A[i]
	go = False
	for i in range (1, n - 1):
		if A[i] != B[i]:
			go = True
		A[i] = B[i]
	if go:
		count += 1
print(count)
print(" ".join(A))
