#include <bits/stdc++.h>
using namespace std;
const int NMAX = 1e4;
int n, a[NMAX + 2], gcd;
int GCD(int a, int b) {
  while (b) {
    int r = a % b;
    a = b;
    b = r;
  }
  return a;
}
int main() {
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    cin >> a[i];
  }
  gcd = a[1];
  for (int i = 2; i <= n; ++i) {
    gcd = GCD(gcd, a[i]);
  }
  if (gcd == a[1]) {
    cout << n * 2 << "\n";
    for (int i = 1; i <= n; ++i) {
      cout << a[i] << " " << gcd << " ";
    }
    cout << "\n";
    return 0;
  }
  cout << "-1\n";
  return 0;
}
