#include <bits/stdc++.h>
using namespace std;
int mdc(int a, int b) {
  int remainder;
  while (b != 0) {
    remainder = a % b;
    a = b;
    b = remainder;
  }
  return a;
}
int main() {
  set<int> mdcs;
  int n, e, r;
  cin >> n;
  vector<int> valores(n);
  for (auto &it : valores) cin >> it, mdcs.insert(it);
  r = valores[0];
  for (auto &it : valores) r = mdc(r, it);
  if (mdcs.count(r)) {
    cout << n * 2 << endl;
    for (int i = 0; i < n; i++)
      cout << valores[i] << " " << r << " \n"[i == n - 1];
  } else
    puts("-1");
}
