#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
set<int> st;
bool check(vector<long long> v) {
  long long a = v[0];
  for (auto i = 0; i < v.size(); i++) {
    a = gcd(a, v[i]);
    if (st.find(a) == st.end()) {
      cout << -1;
      return false;
    }
  }
  return true;
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  string s1, s2;
  long long inp, n, a, b, t, q, k, m, x, y;
  vector<long long> v1, v2;
  vector<pair<long long, char> > v;
  cin >> n;
  for (auto i = 0; i < n; i++) {
    cin >> a;
    st.insert(a);
    v1.push_back(a);
  }
  if (check(v1)) {
    sort(v1.begin(), v1.end());
    cout << 2 * v1.size();
    cout << endl;
    for (auto i = 0; i < v1.size(); i++) {
      cout << v1[i] << " " << v1[0] << " ";
    }
  }
}
