#include <bits/stdc++.h>
using namespace std;
const long long INF = 4e18;
const long long MAX = 1e5 + 5;
const long long MOD = 1e9 + 7;
int gcd(int a, int b) {
  while ((a %= b) && (b %= a))
    ;
  return a + b;
}
int m, arr[1010];
int main() {
  do {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
  } while (0);
  cin >> m;
  int g = 0;
  for (int i = 0; i < m; i++) {
    cin >> arr[i];
    if (!g)
      g = arr[i];
    else
      g = gcd(g, arr[i]);
  }
  if (arr[0] == g) {
    cout << m * 2 << '\n';
    for (int i = 0; i < m; i++) cout << arr[i] << ' ' << g << ' ';
    cout << '\n';
  } else
    cout << "-1\n";
  return 0;
}
