#include <bits/stdc++.h>
using namespace std;
long long a[1010], i, j, n, ans[2010], k;
long long gcd(long long a, long long b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
int main() {
  ios::sync_with_stdio(0);
  cin >> n;
  for (i = 0; i < n; i++) cin >> a[i];
  ans[0] = a[0];
  k = 0;
  for (i = 1; i < n; i++) {
    if (gcd(a[i - 1], a[i]) != 1) {
      k++;
    }
  }
  cout << k << "\n";
  cout << a[0] << " ";
  for (i = 1; i < n; i++) {
    if (gcd(a[i - 1], a[i]) != 1) {
      cout << 1 << " " << a[i] << " ";
    } else
      cout << a[i] << " ";
  }
  return 0;
}
