#include <bits/stdc++.h>
using namespace std;
const int N = 2e3 + 5;
const int S = 1e6 + 5;
int m, s[N], vis[S], ans[N];
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
void solve() {
  scanf("%d", &m);
  for (int i = 0; i < m; i++) {
    scanf("%d", &s[i]);
    vis[s[i]] = 1;
  }
  for (int i = 0; i < m; i++) {
    ans[i * 2] = s[i];
    ans[i * 2 + 1] = s[0];
  }
  for (int i = 0; i < 2 * m; i++) {
    int g = ans[i];
    for (int j = i; j < 2 * m; j++) {
      g = gcd(g, ans[j]);
      if (!vis[g]) {
        printf("-1\n");
        return;
      }
    }
  }
  printf("%d\n", 2 * m);
  for (int i = 0; i < 2 * m; i++) printf("%d ", ans[i]);
  puts("");
}
int main() {
  solve();
  return 0;
}
