#include <bits/stdc++.h>
using namespace std;
template <class T1>
void deb(T1 e1) {
  cout << e1 << endl;
}
template <class T1, class T2>
void deb(T1 e1, T2 e2) {
  cout << e1 << " " << e2 << endl;
}
template <class T1, class T2, class T3>
void deb(T1 e1, T2 e2, T3 e3) {
  cout << e1 << " " << e2 << " " << e3 << endl;
}
template <class T1, class T2, class T3, class T4>
void deb(T1 e1, T2 e2, T3 e3, T4 e4) {
  cout << e1 << " " << e2 << " " << e3 << " " << e4 << endl;
}
template <class T1, class T2, class T3, class T4, class T5>
void deb(T1 e1, T2 e2, T3 e3, T4 e4, T5 e5) {
  cout << e1 << " " << e2 << " " << e3 << " " << e4 << " " << e5 << endl;
}
template <class T1, class T2, class T3, class T4, class T5, class T6>
void deb(T1 e1, T2 e2, T3 e3, T4 e4, T5 e5, T6 e6) {
  cout << e1 << " " << e2 << " " << e3 << " " << e4 << " " << e5 << " " << e6
       << endl;
}
template <class T>
T gcd(const T a, const T b) {
  return (b ? gcd<T>(b, a % b) : a);
}
template <class T>
T lcm(const T a, const T b) {
  return (a / gcd<T>(a, b) * b);
}
int X[] = {0, 0, 1, 0, 0, -1};
int Y[] = {0, 1, 0, 0, -1, 0};
int Z[] = {1, 0, 0, -1, 0, 0};
struct node {
  long long x, y;
  node() {}
  node(long long x, long long y) : x(x), y(y) {}
  bool operator<(const node& p) const { return x < p.x; }
};
bool vis[10007];
vector<long long> v, vec;
void sieve() {
  long long mx = 10004, i, j;
  for (i = 2; i <= mx; i++) {
    if (vis[i]) continue;
    for (j = i + i; j <= mx; j += i) {
      vis[i] = 1;
    }
  }
  for (i = 2; i <= mx; i++)
    if (!vis[i]) v.push_back(i);
}
long long a[10005];
int main() {
  long long i, j, k, l, x, y, z, t, m, n;
  cin >> n;
  for (i = 1; i <= n; i++) {
    cin >> a[i];
  }
  vec.push_back(a[1]);
  for (i = 2; i <= n; i++) {
    if (gcd(a[i], a[i - 1]) != 1) {
      vec.push_back(1);
    }
    vec.push_back(a[i]);
  }
  deb(vec.size() - n);
  for (i = 0; i < vec.size(); i++) printf("%lld ", vec[i]);
  return 0;
}
