#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long int n, cnt = 0;
  cin >> n;
  vector<long long int> a(n + 1);
  for (long long int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  for (long long int i = 1; i <= n; i++) {
    long long int l = i, r = i + 1;
    while (r <= n && a[l] ^ a[r]) l++, r++;
    l = i + 1, r -= 2;
    long long int cur = 0;
    while (l <= r) {
      a[l] = a[l - 1];
      a[r] = a[r + 1];
      l++, r--;
      cur++;
    }
    cnt = max(cnt, cur);
  }
  cout << cnt << "\n";
  for (int i = 1; i <= n; i++) {
    cout << a[i] << " \n"[i == n];
  }
  return 0;
}
