#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e3 + 6;
int n;
int a[maxn];
map<int, int> H;
int gcd(int a, int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    H[a[i]] = 1;
  }
  vector<int> ans;
  for (int i = 0; i < n; i++) {
    ans.push_back(a[i]);
    ans.push_back(a[0]);
  }
  for (int i = 0; i < ans.size(); i++) {
    int p = ans[i];
    for (int j = i; j < ans.size(); j++) {
      p = gcd(p, ans[j]);
      if (!H[p]) {
        cout << "-1" << endl;
        return 0;
      }
    }
  }
  cout << n * 2 << endl;
  for (int i = 0; i < ans.size(); i++) {
    cout << ans[i] << " ";
  }
  cout << endl;
}
