#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) {
  if (a % b == 0) return b;
  return gcd(b, a % b);
}
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; ++i) cin >> a[i];
  if (n == 1) {
    cout << 1 << endl << a[0];
    return 0;
  }
  int total = gcd(a[0], a[1]);
  for (int i = 2; i < n; ++i) total = gcd(total, a[i]);
  if (total != a[0]) {
    cout << -1;
    return 0;
  }
  cout << 2 * n - 1 << endl;
  for (int i = 0; i < n - 1; ++i) cout << a[i] << " " << total << " ";
  cout << a.back();
  return 0;
}
