#include <bits/stdc++.h>
using namespace std;
int m, num[1005];
vector<int> ans;
map<int, int> mp;
int gcd(int a, int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
bool is_valid() {
  for (int i = (0); i < (ans.size()); ++i) {
    int cgcd = ans[i];
    for (int j = (i); j < (ans.size()); ++j) cgcd = gcd(cgcd, ans[j]);
    if (!mp[cgcd]) return false;
  }
  return true;
}
void print() {
  cout << ans.size() << endl;
  for (int i = (0); i < (ans.size()); ++i) cout << ans[i] << " ";
  printf("\n");
}
int main() {
  cin >> m;
  for (int j = (0); j < (m); ++j) {
    cin >> num[j];
    mp[num[j]] = 1;
  }
  sort(num, num + m);
  for (int i = (0); i < (m); ++i) ans.push_back(num[i]), ans.push_back(num[0]);
  if (!is_valid()) {
    cout << -1 << endl;
    return 0;
  }
  print();
  return 0;
}
