#include <bits/stdc++.h>
using namespace std;
int n, v[1005], m[2005], one, gc;
unordered_set<int> s, r;
int gcd(int x, int y) { return (y == 0 ? x : gcd(y, x % y)); }
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    cin >> v[i];
    r.insert(v[i]);
  }
  for (int i = 1; i <= n; ++i) m[i * 2 - 1] = v[i], m[i * 2] = v[1];
  for (int i = 1; i < n * 2; ++i) {
    int x = m[i];
    s.insert(x);
    for (int j = i + 1; j <= n * 2; ++j) {
      x = gcd(x, m[j]);
      s.insert(x);
    }
  }
  for (unordered_set<int>::iterator it = s.begin(); it != s.end(); ++it)
    if (r.find(*it) == r.end()) {
      cout << "-1";
      return 0;
    }
  cout << n * 2 << "\n";
  for (int i = 1; i <= n; ++i) cout << v[i] << " " << v[1] << " ";
}
