    		import java.awt.List;
    		import java.io.*;
    		import java.util.*;

    		/*
    		 *
    		 * daiict
    		 *
    		 *
    		 *
    		 */

    		public class prac {
    			FastScanner in;
    			PrintWriter out;

    			static ArrayList[] adj;

    			static int n;
    			static int m;

    			static int[] dp1;
    			static int[] dp2;
    			static int color[];
    			static int visited[];
    			static long[] arr;
    			static long[] brr;
    			static int[][] ans;
    			static int array[];
    			static int pref[];
    			static int tree[];
    			static int maxval = 32;

    			static int sum = 0;
    		//for dfs do not delete
    			static int dir[][] ={{1,0},{0,1},{0,-1},{-1,0},{1,1},{1,-1},{-1,1},{-1,-1}};

    			static long[] seg;
    			static long count = 1;
    			static long mod = (long)1e9 + 7;

    			static class Pair implements Comparable<Pair>
    		    {
    				int x;int y;

    		        Pair(int l, int m) {

    		        	this.x = l;
    		            this.y = m;

    		        }

    		        public int compareTo(Pair p) {
    		            if (this.x == p.x) {
    		                return (int)(this.y-p.y);
    		            }
    		            return (int)(this.x - p.x);
    		        }

    		        public String toString(){
    		        	return x + " " + y;
    		        }

    		        public boolean equals(Object o){
    		        	if(o instanceof Pair){
    		        		Pair a = (Pair)o;

    		        		return this.x == a.x;
    		        	}

    		        	return false;
    		        }

    		        public int hashCode(){
    		        	return new Long(x).hashCode()*31 + new Long(y).hashCode();
    		        }

    		    }

    			public static int gcd(int a, int b) {
    				if (b == 0) return a;
    				return gcd(b, a%b);
    			}

    			void build(int n) {  // build the tree
    				  for (int i = n - 1; i > 0; --i) seg[i] = Math.max(seg[i<<1],seg[i<<1|1]);
    				}

    			public static void modify(int p, int i,long val,int n) {  // set value at position p
    					if(i == 1){
    						long temp = val;
    						val = seg[p+n] - arr[p] + val;
    						arr[p] = temp;
    					}else{
    						val = Math.min(val, p) + arr[p];
    						brr[p] = val;
    					}

    				  for (seg[p += n] = val; p > 1; p >>= 1) seg[p>>1] = Math.max(seg[p],seg[p^1]);
    				}

    				long query(int l, int r,int n) {  // max on interval [l, r)
    				  long res = Integer.MIN_VALUE;
    				  for (l += n, r += n; l < r; l >>= 1, r >>= 1) {
    				    if ((l&1) == 1) res = (int)Math.max(res,seg[l++]);
    				    if ((r&1) == 1) res = (int)Math.max(res,seg[--r]);
    				  }
    				  return res;
    				}

    			public static void update(int x,int val){
    				while(x<=maxval){
    					tree[x] += val;
    					x = (x&-x);
    				}
    			}

    			public static int read(int idx){
    				int sum = 0;

    				while(idx>= 0){
    					sum += tree[idx];
    					idx -= (idx&(-idx));
    				}

    				return sum;
    			}

    		    void solve() throws NumberFormatException, IOException {

    		    	//Scanner in = new Scanner(System.in);
    		    	StringBuilder sb = new StringBuilder();

    		    	int n = in.nextInt();

    		    	HashSet<Integer> set = new HashSet();

    		    	int arr[] = new int[n];

    		    	for(int i = 0;i<n;i++){
    		    		arr[i] = in.nextInt();

    		    		set.add(arr[i]);
    		    	}
    		    	int f = 0;
    		    	for(int i = 0;i<n;i++){
    		    		int gcd = arr[i];

    		    		for(int j = i+1;j<n;j++){
    		    			gcd = gcd(gcd,arr[j]);

    		    			if(!set.contains(gcd)){
    		    				f = 1;
    		    				break;
    		    			}
    		    		}

    		    		if(f == 1){
    		    			break;
    		    		}
    		    	}

    		    	if(f == 0){
    		    		out.println(n);
    		    		for(Integer s :set){
    		    			out.print(s + " ");
    		    		}
    		    	}else{
    		    		out.println(-1);
    		    	}

    		    }

    		    /**
    		     *
    		     * @param a
    		     * @param left
    		     * @param right
    		     * @param value
    		     * @return the smallest index i which a[i] >= value in range [left, right) if exists, otherwise return -1
    		     */
    		    int ff(long[] a, int left, int right, int value) {
    		        int low = left;
    		        int high = right;
    		        while (low != high) {
    		            int mid = (low + high) / 2;
    		            if (a[mid] < value) {
    		                low = mid + 1;
    		            } else {
    		                high = mid;
    		            }
    		        }
    		        if (low == right) {
    		            return low;
    		        }
    		        return low;
    		    }

    		    /**
    		     *
    		     * @param a
    		     * @param left
    		     * @param right
    		     * @param value
    		     * @return greatest index i which a[i] <= value in range [left, right) if exists, otherwise return a number out of [left, right)
    		     */
    		    int ffff(long[] a, int left, int right, int value) {
    		        while (left != right) {
    		            int mid = (left + right) >> 1;
    		            if (a[mid] <= value) {
    		                left = mid + 1;
    		            } else {
    		                right = mid;
    		            }
    		        }
    		        if (left < 0) {
    		            left *= -1;
    		        }
    		        return --left;
    		    }

    		    public static String reverse(String s){

    		    	String ans = "";

    		    	for(int i = s.length()-1;i>=0;i--){
    		    		ans += s.charAt(i);
    		    	}

    		    	return ans;

    		    }

    		    public static long sum(long x){
    		    	return x<10?x:x%10 + sum(x/10);
    		    }

    			public static long gcd(long x, long y) {
    				if (x == 0)
    					return y;
    				else
    					return gcd( y % x,x);
    			}
    			static long inv(long x , long mod)
    			{
    				long r,y;
    				for(r=1,y=mod-2;y!=0;x=x*x%mod,y>>=1)
    				{
    					if((y&1)==1)
    						r=r*x%mod;

    				}
    				return r;
    			}

    			public static long pow(long x,long y,long n){
    				if(y==0)
    					return 1%n;
    				if(y%2==0){
    					long z=pow(x,y/2,n);
    					return (z*z)%n;
    				}
    				return ((x%n)*pow(x,y-1,n))%n;
    			}

    			public static boolean isPrime(int n) {
    				// Corner cases
    				if (n <= 1)
    					return false;
    				if (n <= 3)
    					return true;

    				// This is checked so that we can skip
    				// middle five numbers in below loop
    				if (n % 2 == 0 || n % 3 == 0)
    					return false;

    				for (int i = 5; i * i <= n; i = i + 6)
    					if (n % i == 0 || n % (i + 2) == 0)
    						return false;

    				return true;
    			}

    			void run() throws NumberFormatException, IOException {
    				in = new FastScanner();
    				out = new PrintWriter(System.out);

    				solve();

    				out.close();
    			}

    			class FastScanner {
    				BufferedReader br;
    				StringTokenizer st;

    				public FastScanner() {
    					br = new BufferedReader(new InputStreamReader(System.in));
    				}

    				String next() {
    					while (st == null || !st.hasMoreTokens()) {
    						try {
    							st = new StringTokenizer(in.br.readLine());
    						} catch (IOException e) {
    							// TODO Auto-generated catch block
    							e.printStackTrace();
    						}
    					}
    					return st.nextToken();
    				}

    				int nextInt() {
    					return Integer.parseInt(next());
    				}

    				long nextLong() {
    					return Long.parseLong(next());
    				}

    				double nextDouble() {
    					return Double.parseDouble(next());
    				}
    			}

    			public static void main(String[] args) throws NumberFormatException, IOException {
    				new prac().run();
    			}
    		}


    		import java.awt.List;
    		import java.io.*;
    		import java.util.*;

    		/*
    		 *
    		 * daiict
    		 *
    		 *
    		 *
    		 */

    		public class prac {
    			FastScanner in;
    			PrintWriter out;

    			static ArrayList[] adj;

    			static int n;
    			static int m;

    			static int[] dp1;
    			static int[] dp2;
    			static int color[];
    			static int visited[];
    			static long[] arr;
    			static long[] brr;
    			static int[][] ans;
    			static int array[];
    			static int pref[];
    			static int tree[];
    			static int maxval = 32;

    			static int sum = 0;
    		//for dfs do not delete
    			static int dir[][] ={{1,0},{0,1},{0,-1},{-1,0},{1,1},{1,-1},{-1,1},{-1,-1}};

    			static long[] seg;
    			static long count = 1;
    			static long mod = (long)1e9 + 7;

    			static class Pair implements Comparable<Pair>
    		    {
    				int x;int y;

    		        Pair(int l, int m) {

    		        	this.x = l;
    		            this.y = m;

    		        }

    		        public int compareTo(Pair p) {
    		            if (this.x == p.x) {
    		                return (int)(this.y-p.y);
    		            }
    		            return (int)(this.x - p.x);
    		        }

    		        public String toString(){
    		        	return x + " " + y;
    		        }

    		        public boolean equals(Object o){
    		        	if(o instanceof Pair){
    		        		Pair a = (Pair)o;

    		        		return this.x == a.x;
    		        	}

    		        	return false;
    		        }

    		        public int hashCode(){
    		        	return new Long(x).hashCode()*31 + new Long(y).hashCode();
    		        }

    		    }

    			public static int gcd(int a, int b) {
    				if (b == 0) return a;
    				return gcd(b, a%b);
    			}

    			void build(int n) {  // build the tree
    				  for (int i = n - 1; i > 0; --i) seg[i] = Math.max(seg[i<<1],seg[i<<1|1]);
    				}

    			public static void modify(int p, int i,long val,int n) {  // set value at position p
    					if(i == 1){
    						long temp = val;
    						val = seg[p+n] - arr[p] + val;
    						arr[p] = temp;
    					}else{
    						val = Math.min(val, p) + arr[p];
    						brr[p] = val;
    					}

    				  for (seg[p += n] = val; p > 1; p >>= 1) seg[p>>1] = Math.max(seg[p],seg[p^1]);
    				}

    				long query(int l, int r,int n) {  // max on interval [l, r)
    				  long res = Integer.MIN_VALUE;
    				  for (l += n, r += n; l < r; l >>= 1, r >>= 1) {
    				    if ((l&1) == 1) res = (int)Math.max(res,seg[l++]);
    				    if ((r&1) == 1) res = (int)Math.max(res,seg[--r]);
    				  }
    				  return res;
    				}

    			public static void update(int x,int val){
    				while(x<=maxval){
    					tree[x] += val;
    					x = (x&-x);
    				}
    			}

    			public static int read(int idx){
    				int sum = 0;

    				while(idx>= 0){
    					sum += tree[idx];
    					idx -= (idx&(-idx));
    				}

    				return sum;
    			}

    		    void solve() throws NumberFormatException, IOException {

    		    	//Scanner in = new Scanner(System.in);
    		    	StringBuilder sb = new StringBuilder();
    		    	int n = in.nextInt();

    		    	HashSet<Integer> set = new HashSet();

    		    	int arr[] = new int[n];

    		    	for(int i = 0;i<n;i++){
    		    		arr[i] = in.nextInt();

    		    		set.add(arr[i]);
    		    	}
    		    	int f = 0;
    		    	int gcd = arr[0];
    		    	for(int i = 0;i<n;i++){
    		    		gcd = gcd(gcd,arr[i]);
    		    	}

    		    	if(arr[0] != gcd){
    		    		f = 1;
    		    	}

    		    	if(f == 0){
    		    		out.println(2*n-1);
    		    		for(int i = 0;i<n;i++){
    		    			out.print(arr[i] + " " + gcd + " ");
    		    		}
    		    	}else{
    		    		out.println(-1);
    		    	}

    		    }

    		    /**
    		     *
    		     * @param a
    		     * @param left
    		     * @param right
    		     * @param value
    		     * @return the smallest index i which a[i] >= value in range [left, right) if exists, otherwise return -1
    		     */
    		    int ff(long[] a, int left, int right, int value) {
    		        int low = left;
    		        int high = right;
    		        while (low != high) {
    		            int mid = (low + high) / 2;
    		            if (a[mid] < value) {
    		                low = mid + 1;
    		            } else {
    		                high = mid;
    		            }
    		        }
    		        if (low == right) {
    		            return low;
    		        }
    		        return low;
    		    }

    		    /**
    		     *
    		     * @param a
    		     * @param left
    		     * @param right
    		     * @param value
    		     * @return greatest index i which a[i] <= value in range [left, right) if exists, otherwise return a number out of [left, right)
    		     */
    		    int ffff(long[] a, int left, int right, int value) {
    		        while (left != right) {
    		            int mid = (left + right) >> 1;
    		            if (a[mid] <= value) {
    		                left = mid + 1;
    		            } else {
    		                right = mid;
    		            }
    		        }
    		        if (left < 0) {
    		            left *= -1;
    		        }
    		        return --left;
    		    }

    		    public static String reverse(String s){

    		    	String ans = "";

    		    	for(int i = s.length()-1;i>=0;i--){
    		    		ans += s.charAt(i);
    		    	}

    		    	return ans;

    		    }

    		    public static long sum(long x){
    		    	return x<10?x:x%10 + sum(x/10);
    		    }

    			public static long gcd(long x, long y) {
    				if (x == 0)
    					return y;
    				else
    					return gcd( y % x,x);
    			}
    			static long inv(long x , long mod)
    			{
    				long r,y;
    				for(r=1,y=mod-2;y!=0;x=x*x%mod,y>>=1)
    				{
    					if((y&1)==1)
    						r=r*x%mod;

    				}
    				return r;
    			}

    			public static long pow(long x,long y,long n){
    				if(y==0)
    					return 1%n;
    				if(y%2==0){
    					long z=pow(x,y/2,n);
    					return (z*z)%n;
    				}
    				return ((x%n)*pow(x,y-1,n))%n;
    			}

    			public static boolean isPrime(int n) {
    				// Corner cases
    				if (n <= 1)
    					return false;
    				if (n <= 3)
    					return true;

    				// This is checked so that we can skip
    				// middle five numbers in below loop
    				if (n % 2 == 0 || n % 3 == 0)
    					return false;

    				for (int i = 5; i * i <= n; i = i + 6)
    					if (n % i == 0 || n % (i + 2) == 0)
    						return false;

    				return true;
    			}

    			void run() throws NumberFormatException, IOException {
    				in = new FastScanner();
    				out = new PrintWriter(System.out);

    				solve();

    				out.close();
    			}

    			class FastScanner {
    				BufferedReader br;
    				StringTokenizer st;

    				public FastScanner() {
    					br = new BufferedReader(new InputStreamReader(System.in));
    				}

    				String next() {
    					while (st == null || !st.hasMoreTokens()) {
    						try {
    							st = new StringTokenizer(in.br.readLine());
    						} catch (IOException e) {
    							// TODO Auto-generated catch block
    							e.printStackTrace();
    						}
    					}
    					return st.nextToken();
    				}

    				int nextInt() {
    					return Integer.parseInt(next());
    				}

    				long nextLong() {
    					return Long.parseLong(next());
    				}

    				double nextDouble() {
    					return Double.parseDouble(next());
    				}
    			}

    			public static void main(String[] args) throws NumberFormatException, IOException {
    				new prac().run();
    			}
    		}


    		import java.awt.List;
    		import java.io.*;
    		import java.util.*;

    		/*
    		 *
    		 * daiict
    		 *
    		 *
    		 *
    		 */

    		public class prac {
    			FastScanner in;
    			PrintWriter out;

    			static ArrayList[] adj;

    			static int n;
    			static int m;

    			static int[] dp1;
    			static int[] dp2;
    			static int color[];
    			static int visited[];
    			static long[] arr;
    			static long[] brr;
    			static int[][] ans;
    			static int array[];
    			static int pref[];
    			static int tree[];
    			static int maxval = 32;

    			static int sum = 0;
    		//for dfs do not delete
    			static int dir[][] ={{1,0},{0,1},{0,-1},{-1,0},{1,1},{1,-1},{-1,1},{-1,-1}};

    			static long[] seg;
    			static long count = 1;
    			static long mod = (long)1e9 + 7;

    			static class Pair implements Comparable<Pair>
    		    {
    				int x;int y;

    		        Pair(int l, int m) {

    		        	this.x = l;
    		            this.y = m;

    		        }

    		        public int compareTo(Pair p) {
    		            if (this.x == p.x) {
    		                return (int)(this.y-p.y);
    		            }
    		            return (int)(this.x - p.x);
    		        }

    		        public String toString(){
    		        	return x + " " + y;
    		        }

    		        public boolean equals(Object o){
    		        	if(o instanceof Pair){
    		        		Pair a = (Pair)o;

    		        		return this.x == a.x;
    		        	}

    		        	return false;
    		        }

    		        public int hashCode(){
    		        	return new Long(x).hashCode()*31 + new Long(y).hashCode();
    		        }

    		    }

    			public static int gcd(int a, int b) {
    				if (b == 0) return a;
    				return gcd(b, a%b);
    			}

    			void build(int n) {  // build the tree
    				  for (int i = n - 1; i > 0; --i) seg[i] = Math.max(seg[i<<1],seg[i<<1|1]);
    				}

    			public static void modify(int p, int i,long val,int n) {  // set value at position p
    					if(i == 1){
    						long temp = val;
    						val = seg[p+n] - arr[p] + val;
    						arr[p] = temp;
    					}else{
    						val = Math.min(val, p) + arr[p];
    						brr[p] = val;
    					}

    				  for (seg[p += n] = val; p > 1; p >>= 1) seg[p>>1] = Math.max(seg[p],seg[p^1]);
    				}

    				long query(int l, int r,int n) {  // max on interval [l, r)
    				  long res = Integer.MIN_VALUE;
    				  for (l += n, r += n; l < r; l >>= 1, r >>= 1) {
    				    if ((l&1) == 1) res = (int)Math.max(res,seg[l++]);
    				    if ((r&1) == 1) res = (int)Math.max(res,seg[--r]);
    				  }
    				  return res;
    				}

    			public static void update(int x,int val){
    				while(x<=maxval){
    					tree[x] += val;
    					x = (x&-x);
    				}
    			}

    			public static int read(int idx){
    				int sum = 0;

    				while(idx>= 0){
    					sum += tree[idx];
    					idx -= (idx&(-idx));
    				}

    				return sum;
    			}

    		    void solve() throws NumberFormatException, IOException {

    		    	//Scanner in = new Scanner(System.in);
    		    	StringBuilder sb = new StringBuilder();
    		    	int n = in.nextInt();

    		    	HashSet<Integer> set = new HashSet();

    		    	int arr[] = new int[n];

    		    	for(int i = 0;i<n;i++){
    		    		arr[i] = in.nextInt();

    		    		set.add(arr[i]);
    		    	}
    		    	int f = 0;
    		    	int gcd = arr[0];
    		    	for(int i = 0;i<n;i++){
    		    		gcd = gcd(gcd,arr[i]);
    		    	}

    		    	if(arr[0] != gcd){
    		    		f = 1;
    		    	}

    		    	if(f == 0){
    		    		out.println(2*n-1);
    		    		for(int i = 0;i<n;i++){
    		    			if(i != n-1)
    		    			out.print(arr[i] + " " + gcd + " ");
    		    			else{
    		    				out.println(arr[i] + " ");
    		    			}
    		    		}
    		    	}else{
    		    		out.println(-1);
    		    	}

    		    }

    		    /**
    		     *
    		     * @param a
    		     * @param left
    		     * @param right
    		     * @param value
    		     * @return the smallest index i which a[i] >= value in range [left, right) if exists, otherwise return -1
    		     */
    		    int ff(long[] a, int left, int right, int value) {
    		        int low = left;
    		        int high = right;
    		        while (low != high) {
    		            int mid = (low + high) / 2;
    		            if (a[mid] < value) {
    		                low = mid + 1;
    		            } else {
    		                high = mid;
    		            }
    		        }
    		        if (low == right) {
    		            return low;
    		        }
    		        return low;
    		    }

    		    /**
    		     *
    		     * @param a
    		     * @param left
    		     * @param right
    		     * @param value
    		     * @return greatest index i which a[i] <= value in range [left, right) if exists, otherwise return a number out of [left, right)
    		     */
    		    int ffff(long[] a, int left, int right, int value) {
    		        while (left != right) {
    		            int mid = (left + right) >> 1;
    		            if (a[mid] <= value) {
    		                left = mid + 1;
    		            } else {
    		                right = mid;
    		            }
    		        }
    		        if (left < 0) {
    		            left *= -1;
    		        }
    		        return --left;
    		    }

    		    public static String reverse(String s){

    		    	String ans = "";

    		    	for(int i = s.length()-1;i>=0;i--){
    		    		ans += s.charAt(i);
    		    	}

    		    	return ans;

    		    }

    		    public static long sum(long x){
    		    	return x<10?x:x%10 + sum(x/10);
    		    }

    			public static long gcd(long x, long y) {
    				if (x == 0)
    					return y;
    				else
    					return gcd( y % x,x);
    			}
    			static long inv(long x , long mod)
    			{
    				long r,y;
    				for(r=1,y=mod-2;y!=0;x=x*x%mod,y>>=1)
    				{
    					if((y&1)==1)
    						r=r*x%mod;

    				}
    				return r;
    			}

    			public static long pow(long x,long y,long n){
    				if(y==0)
    					return 1%n;
    				if(y%2==0){
    					long z=pow(x,y/2,n);
    					return (z*z)%n;
    				}
    				return ((x%n)*pow(x,y-1,n))%n;
    			}

    			public static boolean isPrime(int n) {
    				// Corner cases
    				if (n <= 1)
    					return false;
    				if (n <= 3)
    					return true;

    				// This is checked so that we can skip
    				// middle five numbers in below loop
    				if (n % 2 == 0 || n % 3 == 0)
    					return false;

    				for (int i = 5; i * i <= n; i = i + 6)
    					if (n % i == 0 || n % (i + 2) == 0)
    						return false;

    				return true;
    			}

    			void run() throws NumberFormatException, IOException {
    				in = new FastScanner();
    				out = new PrintWriter(System.out);

    				solve();

    				out.close();
    			}

    			class FastScanner {
    				BufferedReader br;
    				StringTokenizer st;

    				public FastScanner() {
    					br = new BufferedReader(new InputStreamReader(System.in));
    				}

    				String next() {
    					while (st == null || !st.hasMoreTokens()) {
    						try {
    							st = new StringTokenizer(in.br.readLine());
    						} catch (IOException e) {
    							// TODO Auto-generated catch block
    							e.printStackTrace();
    						}
    					}
    					return st.nextToken();
    				}

    				int nextInt() {
    					return Integer.parseInt(next());
    				}

    				long nextLong() {
    					return Long.parseLong(next());
    				}

    				double nextDouble() {
    					return Double.parseDouble(next());
    				}
    			}

    			public static void main(String[] args) throws NumberFormatException, IOException {
    				new prac().run();
    			}
    		}


import java.io.*;
	import java.util.*;

	public class Main {
		 static Scanner in = new Scanner(System.in);
		 static PrintWriter out = new PrintWriter(System.out);

	    public static void main(String args[]) {
	    	int n = in.nextInt();
	    	int[]k=new int[n];
	    	for(int i=0;i<n;i++) {
	    		k[i]=in.nextInt();
	    	}
	    	Arrays.sort(k);
	    	int f=k[0];
	    	boolean h = true;
	    	for(int j=1;j<n;j++) {
	    		if(k[j]%f!=0) {
	    			h=false;
	    		}
	    	}

	    	if(!h) {
	    		out.print(-1);
	    	}else {
	    			out.println(n*2);
	    			for(int i=0;i<n;i++) {
	    				out.print(k[i]+" "+f+" ");
	    			}

	    	}
		 	out.close();
	    }
	}


import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.Arrays;
import java.util.InputMismatchException;

public class Tester
{
	InputStream is;
	PrintWriter out;
	String INPUT = "";

	void solve()
	{
		int m=ni();
		int[] a=na(m);
		int g=0;
		for(int i=0;i<m;i++) {
			g=gcd(a[i],g);
		}

		if(g!=a[0]) {
			out.println(-1);
			return;
		}
		out.println(m<<1);
		for(int i=0;i<m;i++) {
			out.print(a[i]+" "+g+" ");
		}
		out.println();
	}

	int gcd(int a,int b) {
		while(b>0) {
			int t=a%b;
			a=b;
			b=t;
		}
		return a;
	}

	void run() throws Exception
	{
		is = INPUT.isEmpty() ? System.in : new ByteArrayInputStream(INPUT.getBytes());
		out = new PrintWriter(System.out);

		long s = System.currentTimeMillis();
		solve();
		out.flush();
		if(!INPUT.isEmpty())tr(System.currentTimeMillis()-s+"ms");
	}

	public static void main(String[] args) throws Exception
	{ new Tester().run(); }

	private byte[] inbuf = new byte[1024];
	public int lenbuf = 0, ptrbuf = 0;

	private int readByte()
	{
		if(lenbuf == -1)throw new InputMismatchException();
		if(ptrbuf >= lenbuf)
		{
			ptrbuf = 0;
			try
			{ lenbuf = is.read(inbuf); }
			catch (IOException e)
			{ throw new InputMismatchException(); }
			if(lenbuf <= 0)return -1;
		}
		return inbuf[ptrbuf++];
	}

	private boolean isSpaceChar(int c)
	{ return !(c >= 33 && c <= 126); }
	private int skip()
	{ int b; while((b = readByte()) != -1 && isSpaceChar(b)); return b; }

	private double nd()
	{ return Double.parseDouble(ns()); }
	private char nc()
	{ return (char)skip(); }

	private String ns()
	{
		int b = skip();
		StringBuilder sb = new StringBuilder();
		while(!(isSpaceChar(b)))
		{ // when nextLine, (isSpaceChar(b) && b != ' ')
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}

	private char[] ns(int n)
	{
		char[] buf = new char[n];
		int b = skip(), p = 0;
		while(p < n && !(isSpaceChar(b)))
		{
			buf[p++] = (char)b;
			b = readByte();
		}
		return n == p ? buf : Arrays.copyOf(buf, p);
	}

	private char[][] nm(int n, int m)
	{
		char[][] map = new char[n][];
		for(int i = 0;i < n;i++)map[i] = ns(m);
		return map;
	}

	private int[] na(int n)
	{
		int[] a = new int[n];
		for(int i = 0;i < n;i++)a[i] = ni();
		return a;
	}

	private int ni()
	{
		int num = 0, b;
		boolean minus = false;
		while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
		if(b == '-')
		{
			minus = true;
			b = readByte();
		}

		while(true)
		{
			if(b >= '0' && b <= '9')
			{
				num = num * 10 + (b - '0');
			}else
			{
				return minus ? -num : num;
			}
			b = readByte();
		}
	}

	private long nl()
	{
		long num = 0;
		int b;
		boolean minus = false;
		while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
		if(b == '-')
		{
			minus = true;
			b = readByte();
		}

		while(true){
			if(b >= '0' && b <= '9')
			{
				num = num * 10 + (b - '0');
			}else
			{
				return minus ? -num : num;
			}
			b = readByte();
		}
	}

	private static void tr(Object... o)
	{ System.out.println(Arrays.deepToString(o)); }
}


//Marco and the GCD Sequence
import java.util.*;
public class P894C {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		System.out.print("Number of elements in S >>> ");
		int n = sc.nextInt();
		ArrayList<Integer> S = new ArrayList<Integer>();
		ArrayList<Integer> originalSeq = new ArrayList<Integer>();

		for(int i = 0; i < n; i++){
			System.out.print("Element " + (i+1) + " = ");
			int x = sc.nextInt();
			S.add(x);
		}
		int ans= 0;
		for(int i = 1; i < S.size(); i++)
			if(S.get(i) % S.get(0) != 0)
				ans = -1;
		if(ans != -1){
			while(!S.isEmpty()){
				int x = S.remove(S.size() - 1);
				originalSeq.add(x);
				for(int i = S.size() - 1; i >= 0; i--){
					if(x % S.get(i) == 0){
						x = S.remove(i);
						originalSeq.add(x);
					}

				}
			}
		}

		if(ans == -1)
			System.out.print(-1);
		else{
			System.out.println(originalSeq.size());
			for(int i : originalSeq){
				System.out.print(i + " ");
			}
		}
	}
}


//Marco and the GCD Sequence
import java.util.*;
public class P894C {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		ArrayList<Integer> S = new ArrayList<Integer>();
		ArrayList<Integer> originalSeq = new ArrayList<Integer>();

		for(int i = 0; i < n; i++){

			int x = sc.nextInt();
			S.add(x);
		}
		int ans= 0;
		for(int i = 1; i < S.size(); i++)
			if(S.get(i) % S.get(0) != 0)
				ans = -1;
		if(ans != -1){
			while(!S.isEmpty()){
				int x = S.remove(S.size() - 1);
				originalSeq.add(x);
				for(int i = S.size() - 1; i >= 0; i--){
					if(x % S.get(i) == 0){
						x = S.remove(i);
						originalSeq.add(x);
					}

				}
			}
		}

		if(ans == -1)
			System.out.print(-1);
		else{
			System.out.println(originalSeq.size());
			for(int i : originalSeq){
				System.out.print(i + " ");
			}
		}
	}
}


//Marco and the GCD Sequence
import java.util.*;
public class P894C {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		int[] s = new int[n];
		for(int i = 0; i < n;i++)
			s[i] = sc.nextInt();

		for(int i = 1; i < n; i++)
			if(s[i] % s[0] != 0){
				System.out.print(-1);
				return;
			}
		System.out.println(2*n - 1);
		for(int i = 0;i  < n-1; i++){
			System.out.print(s[i] + " " + s[0] + " ");
		}
		System.out.print(s[n-1]);
	}
}


//Marco and the GCD Sequence
import java.util.*;
public class P894C {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		int[] s = new int[n];
		for(int i = 0; i < n;i++)
			s[i] = sc.nextInt();

		for(int i = 1; i < n; i++)
			if(s[i] % s[0] != 0){
				System.out.print(-1);
				return;
			}
		for(int i = 0;i  < n-1; i++){
			System.out.print(s[i] + " " + s[0] + " ");
		}
		System.out.print(s[n-1]);
	}
}


//package com.company;
import java.io.*;
import java.lang.reflect.Array;
import java.util.*;

public class Main {
    static int gcd(int a, int b){
        if (b == 0) return a;
        return gcd(b, a % b);
    }
    static void creSeq(int[] arr){
        Set<Integer> s = new HashSet<>();
        for (int i = 0; i < arr.length; i++) {
            int ggg = arr[i];
            for (int j = i; j < arr.length; j++) {
                ggg = gcd(ggg, arr[j]);
                s.add(ggg);
            }
        }
        int[] ll = new int[s.size()]; int idx = 0;
        for(Integer iii : s){
            ll[idx++] = iii;
        }
        Arrays.sort(ll);
        for (int i = 0; i < idx; i++) {
            System.out.print(ll[i] + " ");
        }
        System.out.println();
    }
    public static void main(String[] args) throws IOException {
        MyScanner sc = new MyScanner(System.in);
//        creSeq(new int[]{3, 8, 12, 45});
//        creSeq(new int[]{1, 3, 4, 8, 12, 45});
        int n = sc.nextInt();
        int[] arr = new int[n];
        for (int i = 0; i < n; i++) {
            arr[i] = sc.nextInt();
        }
        int a = arr[0];
        for (int i = 0; i < n; i++) {
            if (arr[i] % a != 0){
                System.out.println(-1);
                return;
            }
        }
        System.out.println(n);
        for (int i = 0; i < n; i++) {
            System.out.print(arr[i] + " ");
        }
    }

    static class MyScanner {
        StringTokenizer st;
        BufferedReader br;

        public MyScanner(InputStream s){  br = new BufferedReader(new InputStreamReader(s));}

        public MyScanner(FileReader s) throws FileNotFoundException {br = new BufferedReader(s);}

        public String next() throws IOException
        {
            while (st == null || !st.hasMoreTokens())
                st = new StringTokenizer(br.readLine());
            return st.nextToken();
        }

        public int nextInt() throws IOException {return Integer.parseInt(next());}

        public long nextLong() throws IOException {return Long.parseLong(next());}

        public String nextLine() throws IOException {return br.readLine();}

        public double nextDouble() throws IOException { return Double.parseDouble(next()); }

        public boolean ready() throws IOException {return br.ready();}
    }
}


//package com.company;
import java.io.*;
import java.lang.reflect.Array;
import java.util.*;

public class Main {
    static int gcd(int a, int b){
        if (b == 0) return a;
        return gcd(b, a % b);
    }
    static void creSeq(int[] arr){
        Set<Integer> s = new HashSet<>();
        for (int i = 0; i < arr.length; i++) {
            int ggg = arr[i];
            for (int j = i; j < arr.length; j++) {
                ggg = gcd(ggg, arr[j]);
                s.add(ggg);
            }
        }
        int[] ll = new int[s.size()]; int idx = 0;
        for(Integer iii : s){
            ll[idx++] = iii;
        }
        Arrays.sort(ll);
        for (int i = 0; i < idx; i++) {
            System.out.print(ll[i] + " ");
        }
        System.out.println();
    }
    public static void main(String[] args) throws IOException {
        MyScanner sc = new MyScanner(System.in);
//        creSeq(new int[]{1000, 3000, 5000, 7000, 23000});
//        creSeq(new int[]{1, 3, 4, 8, 12, 45});
        int n = sc.nextInt();
        int[] arr = new int[n];
        for (int i = 0; i < n; i++) {
            arr[i] = sc.nextInt();
        }
        int a = arr[0];
        for (int i = 0; i < n; i++) {
            if (arr[i] % a != 0){
                System.out.println(-1);
                return;
            }
        }
        System.out.println(2*n);
        for (int i = 0; i < n; i++) {
            System.out.print(arr[i] + " ");
            System.out.println(arr[0] + " ");
        }
    }

    static class MyScanner {
        StringTokenizer st;
        BufferedReader br;

        public MyScanner(InputStream s){  br = new BufferedReader(new InputStreamReader(s));}

        public MyScanner(FileReader s) throws FileNotFoundException {br = new BufferedReader(s);}

        public String next() throws IOException
        {
            while (st == null || !st.hasMoreTokens())
                st = new StringTokenizer(br.readLine());
            return st.nextToken();
        }

        public int nextInt() throws IOException {return Integer.parseInt(next());}

        public long nextLong() throws IOException {return Long.parseLong(next());}

        public String nextLine() throws IOException {return br.readLine();}

        public double nextDouble() throws IOException { return Double.parseDouble(next()); }

        public boolean ready() throws IOException {return br.ready();}
    }
}


//package com.company;
import java.io.*;
import java.lang.reflect.Array;
import java.util.*;

public class Main {
    static int gcd(int a, int b){
        if (b == 0) return a;
        return gcd(b, a % b);
    }
    static void creSeq(int[] arr){
        Set<Integer> s = new HashSet<>();
        for (int i = 0; i < arr.length; i++) {
            int ggg = arr[i];
            for (int j = i; j < arr.length; j++) {
                ggg = gcd(ggg, arr[j]);
                s.add(ggg);
            }
        }
        int[] ll = new int[s.size()]; int idx = 0;
        for(Integer iii : s){
            ll[idx++] = iii;
        }
        Arrays.sort(ll);
        for (int i = 0; i < idx; i++) {
            System.out.print(ll[i] + " ");
        }
        System.out.println();
    }
    public static void main(String[] args) throws IOException {
        MyScanner sc = new MyScanner(System.in);
//        creSeq(new int[]{3, 8, 12, 45});
//        creSeq(new int[]{1, 3, 4, 8, 12, 45});
        int n = sc.nextInt();
        int[] arr = new int[n];
        for (int i = 0; i < n; i++) {
            arr[i] = sc.nextInt();
        }
        int a = arr[0];
        for (int i = 0; i < n; i++) {
            if (arr[i] % a != 0){
                System.out.println(-1);
                return;
            }
        }
        for (int i = 0; i < n; i++) {
            System.out.print(arr[i] + " ");
        }
    }

    static class MyScanner {
        StringTokenizer st;
        BufferedReader br;

        public MyScanner(InputStream s){  br = new BufferedReader(new InputStreamReader(s));}

        public MyScanner(FileReader s) throws FileNotFoundException {br = new BufferedReader(s);}

        public String next() throws IOException
        {
            while (st == null || !st.hasMoreTokens())
                st = new StringTokenizer(br.readLine());
            return st.nextToken();
        }

        public int nextInt() throws IOException {return Integer.parseInt(next());}

        public long nextLong() throws IOException {return Long.parseLong(next());}

        public String nextLine() throws IOException {return br.readLine();}

        public double nextDouble() throws IOException { return Double.parseDouble(next()); }

        public boolean ready() throws IOException {return br.ready();}
    }
}


import java.util.*;

public class Main
{
    public static void main(String[] args) {

        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int[] a = new int[n+5];

        for(int i = 0; i < n; i++) {
            a[i] = in.nextInt();
            if(i > 0 && a[i] % a[0] != 0){
                System.out.println(-1);
                System.exit(0);
            }
        }

        System.out.print(2 * n - 1 + "\n" + a[0]);

        for(int i = 1; i < n; i++) {
            System.out.print(" " + a[0] + " " + a[i]);
        }
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigInteger;
import java.util.LinkedList;
import java.util.Scanner;
import java.util.StringTokenizer;

public class C {

	public static void main(String args[]) {
		//Scanner in = new Scanner(System.in);
		input in = new input();
		int n = in.nextInt();
		int arr[] = new int[n];
		for(int i=0; i<n; i++) arr[i] = in.nextInt();
		int flag=1;
		for(int i=1; i<n; i++) {
			if(arr[i]%arr[0]!=0) flag=-1;
		}

		if(flag==-1) System.out.println("-1");
		else {
			System.out.println(2*n-1);
			for(int i=0; i<2*n-1; i++) {
				if(i%2==0) System.out.print(arr[i/2]+" ");
				else System.out.print(arr[0]+" ");
			}
			System.out.println();
		}

	}

static class input{BufferedReader br;StringTokenizer st;public input(){
	br=new BufferedReader(new InputStreamReader(System.in));}String next(){while(st==null
	||!st.hasMoreElements()){try{st=new StringTokenizer(br.readLine());}catch(IOException e)
	{e.printStackTrace();}}return st.nextToken();}int nextInt(){return Integer.parseInt
	(next());}long nextLong(){return Long.parseLong(next());}double nextDouble(){return
	Double.parseDouble(next());}String nextLine(){String str = "";try{str=br.readLine();}
	catch (IOException e){e.printStackTrace();}return str;}}

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigInteger;
import java.util.Arrays;
import java.util.StringTokenizer;

public class main {
public static void main(String[] args) {
        input in = new input();
	    int n = in.nextInt();
	    int arr[] = new int[n];
	    for(int i=0; i<n; i++) arr[i] = in.nextInt();
	    int flag=0, flag2=0;
	    for(int i=n-1; i>0; i--) {
	    	for(int j=i-1; j>=0; j--) {
	    		if(arr[i]%arr[j]==0) {
	    			flag=1; break;
	    		}
	    		if(flag==0) {
	    			flag2=1;
	    			break;
	    		} else flag=0;
	    	}
	    }
	    if(flag2==1) System.out.println("-1");
	    else {
	    	for(int i=0; i<n; i++) System.out.print(arr[i]+" ");
	    	System.out.println();
	    }

    }

 	static class input
 	{
	        BufferedReader br;
	        StringTokenizer st;

	        public input()
	        {
	            br = new BufferedReader(new
	                     InputStreamReader(System.in));
	        }

	        String next()
	        {
	            while (st == null || !st.hasMoreElements())
	            {
	                try
	                {
	                    st = new StringTokenizer(br.readLine());
	                }
	                catch (IOException  e)
	                {
	                    e.printStackTrace();
	                }
	            }
	            return st.nextToken();
	        }

	        int nextInt()
	        {
	            return Integer.parseInt(next());
	        }

	        long nextLong()
	        {
	            return Long.parseLong(next());
	        }

	        double nextDouble()
	        {
	            return Double.parseDouble(next());
	        }

	        String nextLine()
	        {
	            String str = "";
	    try
	    {
	        str = br.readLine();
	    }
	    catch (IOException e)
	    {
	        e.printStackTrace();
	    }
	    return str;
	}
  }

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigInteger;
import java.util.Arrays;
import java.util.StringTokenizer;

public class main {
public static void main(String[] args) {
        input in = new input();
	    int n = in.nextInt();
	    int arr[] = new int[n];
	    for(int i=0; i<n; i++) arr[i] = in.nextInt();
	    int flag=0, flag2=0;
	    /*for(int i=n-1; i>0; i--) {
	    	for(int j=i-1; j>=0; j--) {
	    		if(arr[i]%arr[j]==0) {
	    			flag=1; break;
	    		}
	    	}
	    		if(flag==0) {
	    			flag2=1;
	    			break;
	    		} else flag=0;
	    }
	    if(flag2==1) System.out.println("-1");
	    else {
	    	for(int i=0; i<n; i++) System.out.print(arr[i]+" ");
	    	System.out.println();
	    }*/
	    for(int i=0; i<n-1; i++) {
	    	int gcd = hcf(arr[i],arr[i+1]);
	    	if(Arrays.binarySearch(arr,gcd)<0) {
	    		flag=1;
	    		break;
	    	}
	    }

	    if(flag==1) System.out.println("-1");
	    else { System.out.println(n);
	    	for(int i=0; i<n; i++) System.out.print(arr[i]+" ");
	    	System.out.println();
	    }
    }

	static int hcf(int a, int b) {
		if (b==0) return a;
		return hcf(b,a%b);
	}

 	static class input
 	{
	        BufferedReader br;
	        StringTokenizer st;

	        public input()
	        {
	            br = new BufferedReader(new
	                     InputStreamReader(System.in));
	        }

	        String next()
	        {
	            while (st == null || !st.hasMoreElements())
	            {
	                try
	                {
	                    st = new StringTokenizer(br.readLine());
	                }
	                catch (IOException  e)
	                {
	                    e.printStackTrace();
	                }
	            }
	            return st.nextToken();
	        }

	        int nextInt()
	        {
	            return Integer.parseInt(next());
	        }

	        long nextLong()
	        {
	            return Long.parseLong(next());
	        }

	        double nextDouble()
	        {
	            return Double.parseDouble(next());
	        }

	        String nextLine()
	        {
	            String str = "";
	    try
	    {
	        str = br.readLine();
	    }
	    catch (IOException e)
	    {
	        e.printStackTrace();
	    }
	    return str;
	}
  }

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigInteger;
import java.util.Arrays;
import java.util.StringTokenizer;

public class main {
public static void main(String[] args) {
        input in = new input();
	    int n = in.nextInt();
	    int arr[] = new int[n];
	    for(int i=0; i<n; i++) arr[i] = in.nextInt();
	    int flag=0, flag2=0;
	    /*for(int i=n-1; i>0; i--) {
	    	for(int j=i-1; j>=0; j--) {
	    		if(arr[i]%arr[j]==0) {
	    			flag=1; break;
	    		}
	    	}
	    		if(flag==0) {
	    			flag2=1;
	    			break;
	    		} else flag=0;
	    }
	    if(flag2==1) System.out.println("-1");
	    else {
	    	for(int i=0; i<n; i++) System.out.print(arr[i]+" ");
	    	System.out.println();
	    }*/
	    for(int i=0; i<n-1; i++) {
	    	int gcd = hcf(arr[i],arr[i+1]);
	    	if(Arrays.binarySearch(arr,gcd)<0) {
	    		flag=1;
	    		break;
	    	}
	    }

	    if(flag==1) System.out.println("-1");
	    else {
	    	for(int i=0; i<n; i++) System.out.print(arr[i]+" ");
	    	System.out.println();
	    }
    }

	static int hcf(int a, int b) {
		if (b==0) return a;
		return hcf(b,a%b);
	}

 	static class input
 	{
	        BufferedReader br;
	        StringTokenizer st;

	        public input()
	        {
	            br = new BufferedReader(new
	                     InputStreamReader(System.in));
	        }

	        String next()
	        {
	            while (st == null || !st.hasMoreElements())
	            {
	                try
	                {
	                    st = new StringTokenizer(br.readLine());
	                }
	                catch (IOException  e)
	                {
	                    e.printStackTrace();
	                }
	            }
	            return st.nextToken();
	        }

	        int nextInt()
	        {
	            return Integer.parseInt(next());
	        }

	        long nextLong()
	        {
	            return Long.parseLong(next());
	        }

	        double nextDouble()
	        {
	            return Double.parseDouble(next());
	        }

	        String nextLine()
	        {
	            String str = "";
	    try
	    {
	        str = br.readLine();
	    }
	    catch (IOException e)
	    {
	        e.printStackTrace();
	    }
	    return str;
	}
  }

}


import java.io.*;
import java.util.*;

public class C implements Runnable{
	public static void main (String[] args) {new Thread(null, new C(), "_cf", 1 << 28).start();}

	public void run() {
		FastScanner fs = new FastScanner();
		PrintWriter out = new PrintWriter(System.out);

		int n = fs.nextInt();
		int[] a = fs.nextIntArray(n);
		int g = a[0];
		for(int i = 1; i < n; i++) g = gcd(g, a[i]);
		if(g != a[0]) System.out.println(-1);
		else for(int i = 0; i < n; i++) System.out.print((i == 0 ? 2*n-1 + "\n" : "") + a[i] + (i == n-1 ? "\n" : " " + a[0] + " "));

		out.close();
	}

	int gcd (int a, int b) {
		while(b > 0) {
			int temp = b;
			b = a % b;
			a = temp;
		}
		return a;
	}

	void sort (int[] a) {
		int n = a.length;
		for(int i = 0; i < 1000; i++) {
			Random r = new Random();
			int x = r.nextInt(n), y = r.nextInt(n);
			int temp = a[x];
			a[x] = a[y];
			a[y] = temp;
		}
		Arrays.sort(a);
	}

	class FastScanner {
		BufferedReader br;
		StringTokenizer st;
		public FastScanner() {
			try	{
				br = new BufferedReader(new InputStreamReader(System.in));
//				br = new BufferedReader(new FileReader("cases.in"));
				st = new StringTokenizer("");
			} catch (Exception e){e.printStackTrace();}
		}
		public String next() {
			if (st.hasMoreTokens())	return st.nextToken();
			try {st = new StringTokenizer(br.readLine());}
			catch (Exception e) {e.printStackTrace();}
			return st.nextToken();
		}
		public int nextInt() {return Integer.parseInt(next());}
		public long nextLong() {return Long.parseLong(next());}
		public double nextDouble() {return Double.parseDouble(next());}

		public String nextLine() {
			String line = "";
			try {line = br.readLine();}
			catch (Exception e) {e.printStackTrace();}
			return line;
		}
		public Integer[] nextIntegerArray(int n) {
			Integer[] a = new Integer[n];
			for(int i = 0; i < n; i++) a[i] = nextInt();
			return a;
		}
		public int[] nextIntArray(int n) {
			int[] a = new int[n];
			for(int i = 0; i < n; i++) a[i] = nextInt();
			return a;
		}
		public char[] nextCharArray() {return nextLine().toCharArray();}
	}

}


import java.io.*;
import java.util.*;

public class C implements Runnable{
	public static void main (String[] args) {new Thread(null, new C(), "_cf", 1 << 28).start();}

	public void run() {
		FastScanner fs = new FastScanner();
		PrintWriter out = new PrintWriter(System.out);

		int max = (int)1e6+10;
		int n = fs.nextInt();
		int[] a = fs.nextIntArray(n);
		boolean[] appears = new boolean[max];
		for(Integer i : a) appears[i] = true;

		int[] freq = new int[max];
		TreeMap<Integer, Integer>[] map = new TreeMap[n];
		for(int i = 0; i < n; i++) map[i] = new TreeMap<>();
		for(int i = 0; i < n; i++) {
			int gcd = 0;
			for(int j = i; j < n; j++) {
				gcd = gcd(gcd, a[j]);
				if(!map[i].containsKey(gcd)) map[i].put(gcd, 0);
				map[i].put(gcd, map[i].get(gcd) + 1);
				freq[gcd]++;
			}
		}

		int sz = 0;
		int[] res = new int[n];

		for(int i = 0; i < n; i++) {
			//does a[i] have a problem?
			//if so, can I remove it disrupting any of the other gcds?
			boolean problem = false;
			boolean rem = true;
			for(Map.Entry<Integer, Integer> mp : map[i].entrySet()) {
				if(!appears[mp.getKey()]) {
					problem = true;
				}
				else {
					if(freq[mp.getKey()] == mp.getValue()) {
						//can't remove this without disrupting other gcds
						rem = false;
					}
				}
			}
			if(!problem) {
				res[sz++] = a[i];
				continue;
			}
			if(!rem) {
				res[sz++] = a[i];
				continue;
			}
		}
		if(sz == 0) {
			System.out.println(-1);
			return;
		}

		boolean kill = false;
		for(int i = 0; i < sz; i++) {
			int gcd = 0;
			for(int j = i; j < sz; j++) {
				gcd = gcd(gcd, a[j]);
				if(!appears[gcd]) {
					kill = true;
				}
			}
		}

		if(kill) System.out.println(-1);
		else {
			out.println(sz);
			for(int i = 0; i < sz; i++) {
				if(i > 0) out.print(" ");
				out.print(res[i]);
			}
			out.println();
		}

		out.close();
	}

	int gcd (int a, int b) {
		while(b > 0) {
			int temp = b;
			b = a % b;
			a = temp;
		}
		return a;
	}

	void sort (int[] a) {
		int n = a.length;
		for(int i = 0; i < 1000; i++) {
			Random r = new Random();
			int x = r.nextInt(n), y = r.nextInt(n);
			int temp = a[x];
			a[x] = a[y];
			a[y] = temp;
		}
		Arrays.sort(a);
	}

	class FastScanner {
		BufferedReader br;
		StringTokenizer st;
		public FastScanner() {
			try	{
				br = new BufferedReader(new InputStreamReader(System.in));
//				br = new BufferedReader(new FileReader("cases.in"));
				st = new StringTokenizer("");
			} catch (Exception e){e.printStackTrace();}
		}
		public String next() {
			if (st.hasMoreTokens())	return st.nextToken();
			try {st = new StringTokenizer(br.readLine());}
			catch (Exception e) {e.printStackTrace();}
			return st.nextToken();
		}
		public int nextInt() {return Integer.parseInt(next());}
		public long nextLong() {return Long.parseLong(next());}
		public double nextDouble() {return Double.parseDouble(next());}

		public String nextLine() {
			String line = "";
			try {line = br.readLine();}
			catch (Exception e) {e.printStackTrace();}
			return line;
		}
		public Integer[] nextIntegerArray(int n) {
			Integer[] a = new Integer[n];
			for(int i = 0; i < n; i++) a[i] = nextInt();
			return a;
		}
		public int[] nextIntArray(int n) {
			int[] a = new int[n];
			for(int i = 0; i < n; i++) a[i] = nextInt();
			return a;
		}
		public char[] nextCharArray() {return nextLine().toCharArray();}
	}

}


import java.lang.String;
import java.lang.reflect.Array;
import java.util.Scanner;
import java.util.Arrays;
import java.io.OutputStream;
import java.io.InputStream;
import java.io.*;
import java.util.*;

public class B894 {
    public static void main(String[] args) {
        Scanner in=new Scanner(System.in);
        int n=in.nextInt();
        int[] a=new int[n+10];
        for(int i=0;i<n;i++){
            a[i]=in.nextInt();
        }
        for(int i=0;i<n;i++){
            if(a[i]%a[0]!=0){
                System.out.print(-1);
                return;
            }
        }
        System.out.println(n*2);
        for(int i=0;i<n;i++){
            System.out.print(a[i] + " " + a[0] + " ");
        }

    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.BufferedWriter;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Rustam Musin (PloadyFree@gmail.com)
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        TaskC solver = new TaskC();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskC {
        public void solve(int testNumber, InputReader in, OutputWriter out) {
//        int n = in.readInt();
//        Set<Integer> all = new TreeSet<>();
//        for (int i = 0; i < n; i++) all.add(in.readInt());
//        int[] a = new int[all.size()];
//        int size = 0;
//        for (int i : all)
//            a[size++] = i;
//        Set<Integer> created = get(a);
//        if (!eq(all, created)) {
//            out.print(-1);
//            return;
//        }
//        out.printLine(n);
//        boolean first = true;
//        for (int i : all) {
//            if (!first) {
//                out.print(' ');
//            } else first = false;
//            out.print(i);
//        }

            int n = in.readInt();
            int[] a = IOUtils.readIntArray(in, n);
            int[] res = solve2(a);
            if (res == null) {
                out.print(-1);
                return;
            } else {
                out.printLine(res.length);
                out.print(res);
            }
        }

        int[] solve2(int[] a) {
            int g = a[0];
            for (int i : a) {
                g = gcd(g, i);
            }
            boolean found = false;
            for (int i : a) {
                if (i == g) {
                    found = true;
                }
            }
            if (!found) {
                return null;
            }
            int[] res = new int[a.length + a.length];
            for (int i = 0; i < a.length; i++) {
                res[i * 2] = a[i];
                res[i * 2 + 1] = g;
            }
            return res;
        }

        int gcd(int a, int b) {
            return b == 0 ? a : gcd(b, a % b);
        }

    }

    static class IOUtils {
        public static int[] readIntArray(InputReader in, int size) {
            int[] array = new int[size];
            for (int i = 0; i < size; i++) {
                array[i] = in.readInt();
            }
            return array;
        }

    }

    static class OutputWriter {
        private final PrintWriter writer;

        public OutputWriter(OutputStream outputStream) {
            writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
        }

        public OutputWriter(Writer writer) {
            this.writer = new PrintWriter(writer);
        }

        public void print(int[] array) {
            for (int i = 0; i < array.length; i++) {
                if (i != 0) {
                    writer.print(' ');
                }
                writer.print(array[i]);
            }
        }

        public void close() {
            writer.close();
        }

        public void print(int i) {
            writer.print(i);
        }

        public void printLine(int i) {
            writer.println(i);
        }

    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private InputReader.SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        }

        public int readInt() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return isWhitespace(c);
        }

        public static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.HashSet;
import java.io.BufferedWriter;
import java.io.Writer;
import java.util.Set;
import java.io.OutputStreamWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.util.TreeSet;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Rustam Musin (PloadyFree@gmail.com)
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        TaskC solver = new TaskC();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskC {
        public void solve(int testNumber, InputReader in, OutputWriter out) {
            int n = in.readInt();
            Set<Integer> all = new TreeSet<>();
            for (int i = 0; i < n; i++) {
                all.add(in.readInt());
            }
            int[] a = new int[all.size()];
            int size = 0;
            for (int i : all) {
                a[size++] = i;
            }
            Set<Integer> created = get(a);
            if (!eq(all, created)) {
                out.print(-1);
                return;
            }
            out.printLine(n);
            boolean first = true;
            for (int i : all) {
                if (!first) {
                    out.print(' ');
                } else {
                    first = false;
                }
                out.print(i);
            }
        }

        Set<Integer> get(int[] a) {
            Set<Integer> res = new HashSet<>();
            for (int i = 0; i < a.length; i++) {
                int g = a[i];
                for (int j = i; j < a.length; j++) {
                    g = gcd(g, a[j]);
                    res.add(g);
                }
            }
            return res;
        }

        boolean eq(Set<Integer> s1, Set<Integer> s2) {
            if (s1.size() != s2.size()) {
                return false;
            }
            for (int x : s1) {
                if (!s2.contains(x)) {
                    return false;
                }
            }
            return true;
        }

        int gcd(int a, int b) {
            return b == 0 ? a : gcd(b, a % b);
        }

    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private InputReader.SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        }

        public int readInt() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return isWhitespace(c);
        }

        public static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }

    static class OutputWriter {
        private final PrintWriter writer;

        public OutputWriter(OutputStream outputStream) {
            writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
        }

        public OutputWriter(Writer writer) {
            this.writer = new PrintWriter(writer);
        }

        public void print(char i) {
            writer.print(i);
        }

        public void close() {
            writer.close();
        }

        public void print(int i) {
            writer.print(i);
        }

        public void printLine(int i) {
            writer.println(i);
        }

    }
}


import java.io.*;
import java.math.BigInteger;
import java.util.*;

public class Main {
    static int MOD = 1000000007;

    // After writing solution, quick scan for:
    //   array out of bounds
    //   special cases e.g. n=1?
    //
    // Big numbers arithmetic bugs:
    //   int overflow
    //   sorting, or taking max, after MOD
    void solve() throws IOException {
        int m = ri();
        int[] s = ril(m);
        Set<Integer> set = new HashSet<>();
        for (int si : s) set.add(si);

        int g = s[0];
        for (int i = 0; i < m; i++) {
            for (int j = i+1; j < m; j++) {
                g = Math.min(g, gcd(s[i], s[j]));
            }
        }
        if (s[0] != g) {
            pw.println("-1");
            return;
        }
        pw.println(2 * m);
        for (int si : s) {
            pw.print(s[0] + " " + si + " ");
        }
    }

    public static int gcd(int a, int b) {
        return a == 0 ? b : gcd(b % a, a);
    }

    // Template code below

    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    PrintWriter pw = new PrintWriter(System.out);

    public static void main(String[] args) throws IOException {
        Main m = new Main();
        m.solve();
        m.close();
    }

    void close() throws IOException {
        pw.flush();
        pw.close();
        br.close();
    }

    int ri() throws IOException {
        return Integer.parseInt(br.readLine().trim());
    }

    long rl() throws IOException {
        return Long.parseLong(br.readLine().trim());
    }

    int[] ril(int n) throws IOException {
        int[] nums = new int[n];
        int c = 0;
        for (int i = 0; i < n; i++) {
            int sign = 1;
            c = br.read();
            int x = 0;
            if (c == '-') {
                sign = -1;
                c = br.read();
            }
            while (c >= '0' && c <= '9') {
                x = x * 10 + c - '0';
                c = br.read();
            }
            nums[i] = x * sign;
        }
        while (c != '\n' && c != -1) c = br.read();
        return nums;
    }

    long[] rll(int n) throws IOException {
        long[] nums = new long[n];
        int c = 0;
        for (int i = 0; i < n; i++) {
            int sign = 1;
            c = br.read();
            long x = 0;
            if (c == '-') {
                sign = -1;
                c = br.read();
            }
            while (c >= '0' && c <= '9') {
                x = x * 10 + c - '0';
                c = br.read();
            }
            nums[i] = x * sign;
        }
        while (c != '\n' && c != -1) c = br.read();
        return nums;
    }

    int[] rkil() throws IOException {
        int sign = 1;
        int c = br.read();
        int x = 0;
        if (c == '-') {
            sign = -1;
            c = br.read();
        }
        while (c >= '0' && c <= '9') {
            x = x * 10 + c - '0';
            c = br.read();
        }
        return ril(x);
    }

    long[] rkll() throws IOException {
        int sign = 1;
        int c = br.read();
        int x = 0;
        if (c == '-') {
            sign = -1;
            c = br.read();
        }
        while (c >= '0' && c <= '9') {
            x = x * 10 + c - '0';
            c = br.read();
        }
        return rll(x);
    }

    char[] rs() throws IOException {
        return br.readLine().toCharArray();
    }

    void sort(int[] A) {
        Random r = new Random();
        for (int i = A.length-1; i > 0; i--) {
            int j = r.nextInt(i+1);
            int temp = A[i];
            A[i] = A[j];
            A[j] = temp;
        }
        Arrays.sort(A);
    }
}


import java.io.*;
import java.util.*;

public class Div2_447_C {
	public static int getGCD(int a, int b) {
		while (a != b) {
			if (a > b) {
				a -= b;
			} else {
				b -= a;
			}
		}
		return a;
	}
	public static void main(String[] args) throws IOException {
		BufferedInputStream bis = new BufferedInputStream(System.in);
		BufferedReader br = new BufferedReader(new InputStreamReader(bis));
		PrintWriter out = new PrintWriter(System.out);
		String line;
		StringTokenizer st;
		while ((line = br.readLine()) != null && !line.equals("")) {
			int n = Integer.parseInt(line.trim());
			int [] common = new int[n];
			st = new StringTokenizer(br.readLine());
			HashSet <Integer> gcds = new HashSet<Integer>();
			for (int i = 0;i < common.length;i++) {
				common[i] = Integer.parseInt(st.nextToken());
				gcds.add(common[i]);
			}

			int currGCD = common[n - 1];
			for (int i = n - 2;i >= 0;i--) {
				currGCD = getGCD(common[i], currGCD);
			}
			if (gcds.contains(currGCD)) {
				out.println(common.length * 2 - 1);
				out.print(common[0]);
				for (int i = 1;i < common.length;i++)
					out.print(" " + common[i]+" "+currGCD);
				out.println();
			} else {
				out.println(-1);
			}
		}
		out.close();
	}
}


import java.io.*;
import java.util.*;

public class Div2_447_C {
	public static int getGCD(int a, int b) {
		while (a != b) {
			if (a > b) {
				a -= b;
			} else {
				b -= a;
			}
		}
		return a;
	}
	public static boolean sameSet(HashSet<Integer> set, int [] arr) {
		if (arr.length != set.size())
			return false;
		for (int x : arr)
			if (!set.contains(x))
				return false;
		return true;
	}
	public static void main(String[] args) throws IOException {
		BufferedInputStream bis = new BufferedInputStream(System.in);
		BufferedReader br = new BufferedReader(new InputStreamReader(bis));
		PrintWriter out = new PrintWriter(System.out);
		String line;
		StringTokenizer st;
		while ((line = br.readLine()) != null && !line.equals("")) {
			int n = Integer.parseInt(line.trim());
			int [] common = new int[n];
			st = new StringTokenizer(br.readLine());
			for (int i = 0;i < common.length;i++)
				common[i] = Integer.parseInt(st.nextToken());

			LinkedList <Integer> ans = new LinkedList<Integer>();
			HashSet <Integer> gcds = new HashSet<Integer>();
			for (int i = n - 1;i >= 0;i--) {
				if (gcds.contains(common[i]))
					continue;
				int currGCD = common[i];
				for (int x : ans) {
					gcds.add(currGCD);
					currGCD = getGCD(x, currGCD);
				}
				ans.addFirst(common[i]);
				gcds.add(currGCD);
			}
			if (sameSet(gcds, common)) {
				out.println(ans.size());
				for (int x : ans)
					out.print(x+" ");
				out.println();
			} else {
				out.println(-1);
			}
		}
		out.close();
	}
}


import java.io.*;
import java.util.*;

public class C {
    FScanner in = new FScanner();
    PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out), true);
    final int INF = Integer.MAX_VALUE >> 1;

    int gcd(int a, int b) {
        return b == 0 ? a : gcd(b, a % b);
    }

    void run() {
        int n = in.nextInt();
        int[] a = new int[n];
        int mn = INF;
        for (int i = 0; i < n; i++) {
            a[i] = in.nextInt();
            mn = Math.min(mn, a[i]);
        }
        int g = 0;
        for (int i = 0; i < n; i++) {
            g = gcd(g, a[i]);
        }
        if (g != mn)
            out.print(-1);
        else {
            out.println(2 * n - 1);
            for (int i = 0; i < n; i++) {
                if (i > 0)
                    out.print(g + " ");
                out.print(a[i] + " ");
            }
        }
        out.close();
    }

    public static void main(String[] args) {
        new C().run();
    }

    static class FScanner {
        BufferedReader br;
        StringTokenizer st;

        FScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }

        char[][] nextCharArray(int n, int m) {
            char[][] g = new char[n][m];
            for (int i = 0; i < n; i++)
                g[i] = next().toCharArray();
            return g;
        }

        double[] nextDoubleArray(int n) {
            double[] a = new double[n];
            for (int i = 0; i < n; i++)
                a[i] = nextDouble();
            return a;
        }

        int[] nextIntArray(int n) {
            int[] a = new int[n];
            for (int i = 0; i < n; i++)
                a[i] = nextInt();
            return a;
        }

        long[] nextLongArray(int n) {
            long[] a = new long[n];
            for (int i = 0; i < n; i++)
                a[i] = nextLong();
            return a;
        }
    }

    static class Pair implements Comparable<Pair> {
        int first;
        int second;

        Pair (int first, int second) {
            this.first = first;
            this.second = second;
        }

        @Override
        public int compareTo (Pair pair) {
            if (this.first != pair.first)
                return this.first - pair.first;
            else
                return this.second - pair.second;
        }

        @Override
        public boolean equals(Object o) {
            if (!(o instanceof Pair))
                return false;
            Pair p = (Pair) o;
            return Objects.equals(p.first, first) && Objects.equals(p.second, second);
        }

        @Override
        public int hashCode() {
            return this.first  ^ this.second;
        }

        @Override
        public String toString() {
            return "" + '(' + this.first + ',' + this.second + ')';
        }
    }
}


import java.io.*;
import java.util.*;

public class C {
    FScanner in = new FScanner();
    PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out), true);
    HashSet<Integer> set = new HashSet<>();
    HashSet<Integer> forRemoval = new HashSet<>();

    int gcd(int a, int b) {
        return b == 0 ? a : gcd(b, a % b);
    }

    void run() {
        int n = in.nextInt();
        int[] a = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = in.nextInt();
            set.add(a[i]);
        }
        for (int i = 0; i < n - 1; i++) {
            for (int j = i + 1; j < n; j++) {
                int x = gcd(a[i], a[j]);
                if (set.contains(x) && x != a[i] && x != a[j]) {
                    forRemoval.add(x);
                }
            }
        }
        HashSet<Integer> oldSet = new HashSet<>();
        oldSet.addAll(set);
        set.removeAll(forRemoval);
        boolean ok = true;
        int size = set.size();
        int[] b = new int[size];
        Iterator<Integer> iter = set.iterator();
        for (int i = 0; i < size; i++) {
            b[i] = iter.next();
        }
        Arrays.sort(b);
        for (int i = 0; i < size - 1; i++) {
            for (int j = i + 1; j < size; j++) {
                int x = gcd(b[i], b[j]);
                ok &= oldSet.contains(x);
            }
        }
        if (ok) {
            out.println(size);
            iter = set.iterator();
            while (iter.hasNext()) {
                out.print(iter.next() + " ");
            }
        }
        else
            out.print(-1);
        out.close();
    }

    public static void main(String[] args) {
        new C().run();
    }

    static class FScanner {
        BufferedReader br;
        StringTokenizer st;

        FScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }

        char[][] nextCharArray(int n, int m) {
            char[][] g = new char[n][m];
            for (int i = 0; i < n; i++)
                g[i] = next().toCharArray();
            return g;
        }

        double[] nextDoubleArray(int n) {
            double[] a = new double[n];
            for (int i = 0; i < n; i++)
                a[i] = nextDouble();
            return a;
        }

        int[] nextIntArray(int n) {
            int[] a = new int[n];
            for (int i = 0; i < n; i++)
                a[i] = nextInt();
            return a;
        }

        long[] nextLongArray(int n) {
            long[] a = new long[n];
            for (int i = 0; i < n; i++)
                a[i] = nextLong();
            return a;
        }
    }

    static class Pair implements Comparable<Pair> {
        int first;
        int second;

        Pair (int first, int second) {
            this.first = first;
            this.second = second;
        }

        @Override
        public int compareTo (Pair pair) {
            if (this.first != pair.first)
                return this.first - pair.first;
            else
                return this.second - pair.second;
        }

        @Override
        public boolean equals(Object o) {
            if (!(o instanceof Pair))
                return false;
            Pair p = (Pair) o;
            return Objects.equals(p.first, first) && Objects.equals(p.second, second);
        }

        @Override
        public int hashCode() {
            return this.first  ^ this.second;
        }

        @Override
        public String toString() {
            return "" + '(' + this.first + ',' + this.second + ')';
        }
    }
}


import java.io.*;
import java.util.*;

public class C {
    FScanner in = new FScanner();
    PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out), true);
    HashSet<Integer> set = new HashSet<>();
    HashSet<Integer> forRemoval = new HashSet<>();

    int gcd(int a, int b) {
        return b == 0 ? a : gcd(b, a % b);
    }

    void run() {
        int n = in.nextInt();
        int[] a = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = in.nextInt();
            set.add(a[i]);
        }
        for (int i = 0; i < n - 1; i++) {
            for (int j = i + 1; j < n; j++) {
                int x = gcd(a[i], a[j]);
                if (set.contains(x) && x != a[i] && x != a[j]) {
                    forRemoval.add(x);
                }
            }
        }
        HashSet<Integer> oldSet = new HashSet<>();
        oldSet.addAll(set);
        set.removeAll(forRemoval);
        boolean ok = true;
        int size = set.size();
        int[] b = new int[size];
        Iterator<Integer> iter = set.iterator();
        for (int i = 0; i < size; i++) {
            b[i] = iter.next();
        }
        Arrays.sort(b);
        for (int i = 0; i < size - 1; i++) {
            for (int j = i + 1; j < size; j++) {
                int x = gcd(b[i], b[j]);
                ok &= oldSet.contains(x);
            }
        }
        if (ok && size > 0) {
            out.println(size);
            iter = set.iterator();
            while (iter.hasNext()) {
                out.print(iter.next() + " ");
            }
        }
        else
            out.print(-1);
        out.close();
    }

    public static void main(String[] args) {
        new C().run();
    }

    static class FScanner {
        BufferedReader br;
        StringTokenizer st;

        FScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }

        char[][] nextCharArray(int n, int m) {
            char[][] g = new char[n][m];
            for (int i = 0; i < n; i++)
                g[i] = next().toCharArray();
            return g;
        }

        double[] nextDoubleArray(int n) {
            double[] a = new double[n];
            for (int i = 0; i < n; i++)
                a[i] = nextDouble();
            return a;
        }

        int[] nextIntArray(int n) {
            int[] a = new int[n];
            for (int i = 0; i < n; i++)
                a[i] = nextInt();
            return a;
        }

        long[] nextLongArray(int n) {
            long[] a = new long[n];
            for (int i = 0; i < n; i++)
                a[i] = nextLong();
            return a;
        }
    }

    static class Pair implements Comparable<Pair> {
        int first;
        int second;

        Pair (int first, int second) {
            this.first = first;
            this.second = second;
        }

        @Override
        public int compareTo (Pair pair) {
            if (this.first != pair.first)
                return this.first - pair.first;
            else
                return this.second - pair.second;
        }

        @Override
        public boolean equals(Object o) {
            if (!(o instanceof Pair))
                return false;
            Pair p = (Pair) o;
            return Objects.equals(p.first, first) && Objects.equals(p.second, second);
        }

        @Override
        public int hashCode() {
            return this.first  ^ this.second;
        }

        @Override
        public String toString() {
            return "" + '(' + this.first + ',' + this.second + ')';
        }
    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.FilterInputStream;
import java.io.BufferedInputStream;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author khokharnikunj8
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        ScanReader in = new ScanReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskC solver = new TaskC();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskC {
        public void solve(int testNumber, ScanReader in, PrintWriter out) {
            int n = in.scanInt();
            int array[] = new int[n];
            boolean flag = true;
            for (int i = 0; i < n; i++) {
                array[i] = in.scanInt();
                if (array[i] % array[0] != 0) flag = false;
            }
            if (!flag) out.println(-1);
            else {
                out.println(2 * (n) - 1);
                out.print(array[0] + " ");
                for (int i = 1; i < n; i++) out.print(array[0] + " " + array[i] + " ");

            }
        }

    }

    static class ScanReader {
        private byte[] buf = new byte[4 * 1024];
        private int index;
        private BufferedInputStream in;
        private int total;

        public ScanReader(InputStream inputStream) {
            in = new BufferedInputStream(inputStream);
        }

        private int scan() {
            if (index >= total) {
                index = 0;
                try {
                    total = in.read(buf);
                } catch (Exception e) {
                    e.printStackTrace();
                }
                if (total <= 0) return -1;
            }
            return buf[index++];
        }

        public int scanInt() {
            int integer = 0;
            int n = scan();
            while (isWhiteSpace(n)) n = scan();
            int neg = 1;
            if (n == '-') {
                neg = -1;
                n = scan();
            }
            while (!isWhiteSpace(n)) {
                if (n >= '0' && n <= '9') {
                    integer *= 10;
                    integer += n - '0';
                    n = scan();
                }
            }
            return neg * integer;
        }

        private boolean isWhiteSpace(int n) {
            if (n == ' ' || n == '\n' || n == '\r' || n == '\t' || n == -1) return true;
            else return false;
        }

    }
}


import java.util.Scanner;
public class Geom {

    public static void main(String[] args) {

        Scanner sc=new Scanner(System.in);
      int m=sc.nextInt();
      int g=0;
      int[] arr=new int[m];
      for(int i=0;i<m;i++){
          arr[i]=sc.nextInt();
          g=GCD(g,arr[i]);
          System.out.print(g+" ");
      }
      boolean ok=false;
      for(int i=0;i<m;i++){
        if(arr[i]==g)
            ok=true; break;
    }
      if(ok==true){
          System.out.println(2*m);
          for(int i=0;i<m;i++)
              System.out.print(arr[i]+" "+g+" ");
      }
      else
          System.out.println(-1);
    }

    private static int GCD(int g, int i) {
          if(i==0)
              return g;
          else
              return GCD(i,g%i);
    }

}


import java.util.Scanner;
public class Geom {

    public static void main(String[] args) {

        Scanner sc=new Scanner(System.in);
      int m=sc.nextInt();
      int g=0;
      int[] arr=new int[m];
      for(int i=0;i<m;i++){
          arr[i]=sc.nextInt();
          g=GCD(g,arr[i]);
      }
      boolean ok=false;
      for(int i=0;i<m;i++){
        if(arr[i]==g)
            ok=true; break;
    }
      if(ok==true){
          System.out.println(2*m);
          for(int i=0;i<m;i++)
              System.out.print(arr[i]+" "+g+" ");
      }
      else
          System.out.println(-1);
    }

    private static int GCD(int g, int i) {
          if(i==0)
              return g;
          else
              return GCD(i,g%i);
    }

}


import java.util.*;
import java.io.*;
public class lp{
static PrintWriter out = new PrintWriter(System.out);

static void solve() {

int n = ni();
int a[] = new int[n];
int min=0;
int g=0;

for(int i=0;i<n;i++)
{
    a[i] = ni();
    if(a[min]>a[i])
       min=i;
    g = (int)gcd(g,a[i]);
}

if(g%a[min]!=0)
   pn(-1);
else{
  pn(2*n-1);
  p(a[min]+" ");
 for(int i=0;i<n;i++)
    if(i!=min)
  p(a[i]+" "+a[min]+" ");
  pn("");
}

   out.flush();
}
public static void main(String[] args) throws Exception{

// use this block when you need more recursion depth
new Thread(null, null, "Name", 999999999) {
            public void run() {
                try {
                    solve();
                } catch(Exception e) {
                    e.printStackTrace();
                    System.exit(1);
                }
            }
        }.start();
}
static int[] ai(int n)  // it will give in array of size n
{
    int a[] = new int[n];
    for(int i=0;i<n;i++)
        a[i] = ni();
    return a;
}
static long[] al(int n)  // it will give in array of size n
{
    long a[] = new long[n];
    for(int i=0;i<n;i++)
        a[i] = nl();
    return a;
}

static void p(Object o)
{
   out.print(o);
}
static void pn(Object o)
{
    out.println(o);
}
static int abs(int x)
{
    return x>0 ? x : -x;
}
static long gcd(long a,long b)
{
       if(a==0)
          return b;
       if(b==0)
          return a;
       if(b%a==0)
          return a;
          return gcd(b%a,a);
}
static int count_set(int n)
{
   int c=0;
while(n>0)
{
   if(n%2==1)
     c++;
     n=n/2;
}
   return c;
}
static void subtract_1(char s[]) // it will subtract 1 from the given number.  number should be positive
{
      if(s[0]=='0') // number is zero
          return;
     int n = s.length,i=n-1;
     while(s[i]=='0')
       i--;
     s[i] = (char)((int)(s[i]-'0') + 47);

     for(int j=i+1;j<n;j++)
         s[j]='9';
}
static long pow(long a,long b,long md)
{
    long ans=1;
    while(b>0)
    {
         if(b%2==1)
           ans = (ans*a)%md;
           a = (a*a)%md;
           b = b/2;
    }
   return ans;
}
static long min(long a,long b){

     return a<b ? a : b;
}
static long max(long a,long b){
     return a>b ? a : b;
}
static boolean pal(String s)
{
   int n = s.length(),i1=0,i2=n-1;

     while(i1<i2)
     {
        if(s.charAt(i1)!=s.charAt(i2))
             return false;
             i1++; i2--;
     }
       return true;
}
static String rev(String r)
{
    String s = "";
    int i= r.length()-1;

    while(i>=0)
    {
        s=s+r.charAt(i);
        i--;
    }
       return s;
}
static FastReader sc=new FastReader();

      static int ni(){
                 int x = sc.nextInt();
                 return(x);
        }
      static long nl(){
              long x = sc.nextLong();
              return(x);
         }
      static String n(){
                 String str = sc.next();
                     return(str);
       }
     static String ns(){
                 String str = sc.nextLine();
                   return(str);
      }
     static double nd(){
               double d = sc.nextDouble();
                 return(d);
       }
  static class FastReader
    {
        BufferedReader br;
        StringTokenizer st;

        public FastReader()
        {
            br = new BufferedReader(new
                     InputStreamReader(System.in));
        }

        String next()
        {
            while (st == null || !st.hasMoreElements())
            {
                try
                {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException  e)
                {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt()
        {
            return Integer.parseInt(next());
        }

        long nextLong()
        {
            return Long.parseLong(next());
        }

        double nextDouble()
        {
            return Double.parseDouble(next());
        }

        String nextLine()
        {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }
    }
}


import java.util.*;
import java.io.*;
import java.math.*;

    public  class Sample implements Runnable
    {
          static int n,m;
          static int max=1000005;
          static int[] s=new int[max];
          static int[] a=new int[max];
          public static void solve()
          {
              n=i();
              int min=Integer.MAX_VALUE;
              int g=0;
              for(int i=0;i<n;i++)
              {
                a[i]=i();
                min=Math.min(min,a[i]);
                g=gcd(g,a[i]);
              }
              if(g!=min)out.println("-1");
              else
              {
                out.println(2*n-1);
                for(int i=0;i<n-1;i++)
                {
                  out.print(a[i]+" "+min+" ");
                }
                out.print(a[n-1]);
              }

          }

          public void run()
          {
              solve();
              out.close();
          }

          public static void main(String[] args) throws IOException
          {
                new Thread(null, new Sample(), "whatever", 1<<26).start();
          }
         static class Pair implements Comparable<Pair>
         {
            long a;
            int b;
            Pair(){}
            Pair(long a,int b)
            {
                       this.a=a;
                       this.b=b;
            }

            public int compareTo(Pair x)
           {
                return Long.compare(x.a,this.a);
           }
        }

    ////////////////////////////////////////////////////// Merge Sort ////////////////////////////////////////////////////////////////////////

   static class Merge
   {

        public static void sort(long inputArr[])
        {
            int length = inputArr.length;
            doMergeSort(inputArr,0, length - 1);
        }

        private static void doMergeSort(long[] arr,int lowerIndex, int higherIndex)
        {
            if (lowerIndex < higherIndex) {
                int middle = lowerIndex + (higherIndex - lowerIndex) / 2;
                doMergeSort(arr,lowerIndex, middle);
                doMergeSort(arr,middle + 1, higherIndex);
                mergeParts(arr,lowerIndex, middle, higherIndex);
            }
        }

        private static void mergeParts(long[]array,int lowerIndex, int middle, int higherIndex)
        {
            long[] temp=new long[higherIndex-lowerIndex+1];
            for (int i = lowerIndex; i <= higherIndex; i++)
            {
                temp[i-lowerIndex] = array[i];
            }
            int i = lowerIndex;
            int j = middle + 1;
            int k = lowerIndex;
            while (i <= middle && j <= higherIndex)
            {
                if (temp[i-lowerIndex] < temp[j-lowerIndex])
                {
                    array[k] = temp[i-lowerIndex];
                    i++;
                } else {
                    array[k] = temp[j-lowerIndex];
                    j++;
                }
                k++;
            }
            while (i <= middle)
            {
                array[k] = temp[i-lowerIndex];
                k++;
                i++;
            }
            while(j<=higherIndex)
            {
                array[k]=temp[j-lowerIndex];
                k++;
                j++;
            }
        }

    }

    /////////////////////////////////////////////////////////// Methods ////////////////////////////////////////////////////////////////////////

     static boolean isPal(String s)
     {
        for(int i=0, j=s.length()-1;i<=j;i++,j--)
        {
                if(s.charAt(i)!=s.charAt(j)) return false;
        }
        return true;
     }
     static String rev(String s)
     {
                StringBuilder sb=new StringBuilder(s);
                sb.reverse();
                return sb.toString();
     }
     static int gcd(int a,int b){return (a==0)?b:gcd(b%a,a);}
     static long gcdExtended(long a,long b,long[] x)
     {

        if(a==0){
            x[0]=0;
            x[1]=1;
            return b;
        }
        long[] y=new long[2];
        long gcd=gcdExtended(b%a, a, y);

        x[0]=y[1]-(b/a)*y[0];
        x[1]=y[0];

        return gcd;
    }

     boolean findSum(int set[], int n, long sum)
    {
      if (sum == 0)
         return true;
      if (n == 0 && sum != 0)
         return false;
      if (set[n-1] > sum)
         return findSum(set, n-1, sum);
      return findSum(set, n-1, sum) ||findSum(set, n-1, sum-set[n-1]);
    }

      public static long modPow(long base, long exp, long mod)
     {
        base = base % mod;
        long result = 1;
        while (exp > 0)
       {
            if (exp % 2 == 1)
            {
                result = (result * base) % mod;
            }
            base = (base * base) % mod;
            exp = exp >> 1;
       }
        return result;
    }

    static long[] fac;
    static long[] inv;
    static long mod=(long)1e9+7;
    public static void cal()
    {
        fac = new long[1000005];
        inv = new long[1000005];
        fac[0] = 1;
        inv[0] = 1;
        for (int i = 1; i <= 1000000; i++)
        {
            fac[i] = (fac[i - 1] * i) % mod;
            inv[i] = (inv[i - 1] * modPow(i, mod - 2, mod)) % mod;
        }
    }

    public static long ncr(int n, int r)
    {
        return (((fac[n] * inv[r]) % mod) * inv[n - r]) % mod;
    }

////////////////////////////////////////// Input Reader ////////////////////////////////////////////////////////////////////////////////////////////////////

    static InputReader sc = new InputReader(System.in);
    static PrintWriter out= new PrintWriter(System.out);

    static class InputReader {

          private final InputStream stream;
          private final byte[] buf = new byte[8192];
          private int curChar, snumChars;
          private SpaceCharFilter filter;

          public InputReader(InputStream stream) {
                  this.stream = stream;
          }

          public int snext()
         {
                  if (snumChars == -1)
                          throw new InputMismatchException();
                  if (curChar >= snumChars) {
                          curChar = 0;
                          try {
                                  snumChars = stream.read(buf);
                          } catch (IOException e) {
                                  throw new InputMismatchException();
                          }
                          if (snumChars <= 0)
                                  return -1;
                  }
                  return buf[curChar++];
          }

          public int nextInt()
         {
                  int c = snext();
                  while (isSpaceChar(c))
                  {
                          c = snext();
                  }
                  int sgn = 1;
                  if (c == '-')
                  {
                          sgn = -1;
                          c = snext();
                  }
                  int res = 0;
                  do {
                          if (c < '0' || c > '9')
                                  throw new InputMismatchException();
                          res *= 10;
                          res += c - '0';
                          c = snext();
                  } while (!isSpaceChar(c));
                  return res * sgn;
          }

          public long nextLong()
          {
                  int c = snext();
                  while (isSpaceChar(c))
                  {
                          c = snext();
                  }
                  int sgn = 1;
                  if (c == '-')
                  {
                          sgn = -1;
                          c = snext();
                  }
                  long res = 0;
                  do {
                          if (c < '0' || c > '9')
                                  throw new InputMismatchException();
                          res *= 10;
                          res += c - '0';
                          c = snext();
                  } while (!isSpaceChar(c));
                  return res * sgn;
          }

          public int[] nextIntArray(int n)
          {
                  int a[] = new int[n];
                  for (int i = 0; i < n; i++)
                  {
                          a[i] = nextInt();
                  }
                  return a;
          }

          public long[] nextLongArray(int n)
          {
                  long a[] = new long[n];
                  for (int i = 0; i < n; i++)
                  {
                          a[i] = nextLong();
                  }
                  return a;
          }

          public String nextLine()
         {
                  int c = snext();
                  while (isSpaceChar(c))
                          c = snext();
                  StringBuilder res = new StringBuilder();
                  do {
                          res.appendCodePoint(c);
                          c = snext();
                  } while (!isEndOfLine(c));
                  return res.toString();
          }

          public boolean isSpaceChar(int c)
          {
                  if (filter != null)
                          return filter.isSpaceChar(c);
                  return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
          }

          private boolean isEndOfLine(int c)
          {
                  return c == '\n' || c == '\r' || c == -1;
          }

          public interface SpaceCharFilter
          {
                  public boolean isSpaceChar(int ch);
          }

    }

    static int i()
    {
        return sc.nextInt();
    }
    static long l(){
        return sc.nextLong();
    }
    static int[] iarr(int n)
    {
        return sc.nextIntArray(n);
    }
    static long[] larr(int n)
    {
        return sc.nextLongArray(n);
    }
    static String s(){
        return sc.nextLine();
    }

 }