#include <bits/stdc++.h>
using namespace std;
int n, a[500010], l, r, ans, len, i, f[500010], j;
int main() {
  scanf("%d", &n);
  for (i = 1; i <= n; i++) scanf("%d", &a[i]);
  f[1] = f[n] = 1;
  for (i = 2; i < n; i++)
    if (a[i] == a[i + 1] || a[i] == a[i - 1])
      f[i] = 1;
    else
      f[i] = 0;
  l = r = -1;
  for (i = 1; i <= n; i++)
    if (!f[i] && l == -1)
      l = i;
    else if (f[i])
      if (l != -1) {
        r = i;
        len = (r - l + 1) / 2;
        ans = max(ans, len);
        for (j = l; j <= l + len - 1; j++) a[j] = a[j - 1];
        for (j = r - 1; j >= r - len; j--) a[j] = a[j + 1];
        l = -1;
      }
  printf("%d\n", ans);
  for (i = 1; i <= n; i++) printf("%d ", a[i]);
  return 0;
}
