#include <bits/stdc++.h>
using namespace std;
vector<int> a, ans;
int gcd(int a, int b) {
  if (a > b) swap(a, b);
  while (a) {
    b %= a;
    if (a > b) swap(a, b);
  }
  return b;
}
int main() {
  int n, cnt(0);
  cin >> n;
  a.resize(n);
  ans.resize(n, -1);
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 1; i < n; i++) {
    if (gcd(a[i], a[i - 1]) != 1) ans[i - 1] = 1, cnt++;
  }
  cout << cnt << '\n';
  for (int i = 0; i < n; i++) {
    cout << a[i] << " ";
    if (ans[i] == 1) cout << ans[i] << " ";
  }
}
