#include <bits/stdc++.h>
using namespace std;
const int maxn = 1000 + 10;
const int maxm = 1e6 + 10;
const long long mod = 998244353;
const int inf = 0x3ffffff;
const double eps = 1e-5;
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
int n, maxnum = 0;
int a[maxn];
bool vis[maxm];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    vis[a[i]] = true;
    maxnum = max(maxnum, a[i]);
  }
  int k;
  for (int i = 0; i < n; i++) {
    if (i == 0)
      k = a[i];
    else
      k = gcd(a[i], k);
  }
  if (!vis[k]) return cout << -1, 0;
  cout << 2 * n - 1 << endl;
  bool flag = true;
  for (int i = 0; i < n; i++) {
    if (a[i] == maxnum && flag) {
      cout << a[i] << " ";
      flag = false;
    } else
      cout << a[i] << " " << k << " ";
  }
  return ~~(0 - 0);
}
