#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const int N = 100005;
const int M = 10;
const string s = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
int nsd(int l, int r) {
  while (l > 0 && r > 0)
    if (l > r)
      l %= r;
    else
      r %= l;
  return (l + r);
}
int b[N], a[N], m;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = 1; i < n; i++)
    if (nsd(a[i], a[i + 1]) != 1) {
      m++;
      b[m] = 1;
      m++;
      b[m] = a[i + 1];
    } else {
      m++;
      b[m] = a[i + 1];
    }
  cout << (m + 1) - n << "\n";
  cout << a[1] << " ";
  for (int i = 1; i <= m; i++) cout << b[i] << " ";
  cout << "\n";
}
