import java.util.Scanner;

public class C {

	public static void main(String[] args) {
		Scanner s=new Scanner(System.in);
		int n=s.nextInt();
		int[] a=new int[n];
		for (int i=0; i<n; i++)
			a[i]=s.nextInt();

		boolean[] contains=new boolean[1000001];
		int min=Integer.MAX_VALUE;
		for (int i:a) {
			contains[i]=true;
			min=Math.min(min, i);
		}
		boolean works=true;
		for (int i:a)
			if (i%min!=0)
				works=false;

		if (works) {
			System.out.println(2*n);
			for (int i:a)
				System.out.print(i+" "+min+" ");
			return;
		}

		for (int i=0; i<n; i++) {
			int gcd=a[i];
			for (int j=i+1; j<n; j++) {
				gcd=gcd(gcd, a[j]);
				if (!contains[gcd]) {
					System.out.println(-1);
					return;
				}
			}
		}
		System.out.println(n);
		for (int i:a)
			System.out.print(i+" ");
	}

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

}


import java.util.Scanner;

public class C {

	public static void main(String[] args) {
		Scanner s=new Scanner(System.in);
		int n=s.nextInt();
		int[] a=new int[n];
		for (int i=0; i<n; i++)
			a[i]=s.nextInt();

		boolean[] contains=new boolean[1000001];
		for (int i:a)
			contains[i]=true;

		if (contains[1]) {
			System.out.println(2*n);
			for (int i:a)
				System.out.print(i+" 1 ");
			return;
		}

		for (int i=0; i<n; i++) {
			int gcd=a[i];
			for (int j=i+1; j<n; j++) {
				gcd=gcd(gcd, a[j]);
				if (!contains[gcd]) {
					System.out.println(-1);
					return;
				}
			}
		}
		System.out.println(n);
		for (int i:a)
			System.out.print(i+" ");
	}

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

}


//package Round894;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.Scanner;
import java.util.TreeSet;

public class C {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();

        TreeSet<Integer> a = new TreeSet<>();
        HashSet<Integer> trash = new HashSet<>();
        int gcd[][] = new int[n][n];

        int m = 0;
        ArrayList<Integer> ans = new ArrayList<>();

        for (int i = 0; i < n; i++) {
            a.add(scanner.nextInt());
        }

        while (a.size() > 0) {
            int value = a.pollLast();
            ans.add(value);
            trash.add(value);
            gcd[m][m] = value;

            for (int i = 0; i < m; i++) {
                gcd[i][m] = gcd(gcd[i][m - 1], value);
                if (a.remove(gcd[i][m]))
                    trash.add(gcd[i][m]);
                else if (!trash.contains(gcd[i][m])) {
                    System.out.println(-1);
                    System.exit(0);
                }
            }
            m++;
        }

        System.out.println(ans.size());
        for (int i : ans)
            System.out.print(i + " ");
    }

    private static int gcd(int a, int b) {
        int r = a % b;
        while (r != 0) {
            a = b;
            b = r;
            r = a % b;
        }
        return b;
    }
}


//package Round894;

import java.util.ArrayList;
import java.util.Scanner;

public class C {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();

        int[] a = new int[n];
        boolean[] mark = new boolean[n];

        int prev_gcd = 0;
        ArrayList<Integer> ans = new ArrayList<>();

        for (int i = 0; i < n; i++) {
            a[i] = scanner.nextInt();
        }

        for (int i = n - 1; i >= 0; i--) {
            if (!mark[i]) {
                mark[i] = true;

                int new_gcd = gcd(prev_gcd, a[i]);
                prev_gcd = new_gcd;
                int pos = -1;

                for (int j = 0; a[j] <= new_gcd; j++) {
                    if (new_gcd % a[j] == 0) {
                        pos = j;
                        mark[j] = true;
                        break;
                    }
                }

                if (pos == -1) {
                    System.out.println(-1);
                    System.exit(0);
                }

                ans.add(a[pos]);
                ans.add(a[i]);
                m++;
            }
        }

        System.out.println(ans.size());
        for (int i : ans)
            System.out.print(i + " ");
    }

    private static int gcd(int a, int b) {
        int r = a % b;
        while (r != 0) {
            a = b;
            b = r;
            r = a % b;
        }
        return b;
    }
}


//package Round894;

import java.util.ArrayList;
import java.util.Scanner;

public class C {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();

        int[] a = new int[n];
        boolean[] mark = new boolean[n];

        int prev_gcd = 0;
        ArrayList<Integer> ans = new ArrayList<>();

        for (int i = 0; i < n; i++) {
            a[i] = scanner.nextInt();
        }

        for (int i = n - 1; i >= 0; i--) {
            if (!mark[i]) {
                mark[i] = true;

                int new_gcd = gcd(prev_gcd, a[i]);
                prev_gcd = new_gcd;
                int pos = -1;

                for (int j = 0; a[j] <= new_gcd; j++) {
                    if (new_gcd % a[j] == 0) {
                        pos = j;
                        mark[j] = true;
                        break;
                    }
                }

                if (pos == -1) {
                    System.out.println(-1);
                    System.exit(0);
                }

                ans.add(a[pos]);
                ans.add(a[i]);
            }
        }

        System.out.println(ans.size());
        for (int i : ans)
            System.out.print(i + " ");
    }

    private static int gcd(int a, int b) {
        int r = a % b;
        while (r != 0) {
            a = b;
            b = r;
            r = a % b;
        }
        return b;
    }
}


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]);
	}
}


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.*;
	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);
	    	for(int i=0;i<n;i++) {
	    		boolean h = true;
	    		for(int j=0;j<n;j++) {
	    			if(k[j]%k[i]!=0) {
	    				h=false;
	    			}
	    		}
	    		if(h) {
	    			k[i]=0;
	    		}
	    	}
	    	int m=n;
	    	for(int i=0;i<n;i++) {
	    		if(k[i]==0) {
	    			m--;
	    		}
	    	}
	    	if(m==n) {
	    		out.print(-1);
	    	}else {
	    		out.println(m);
	    		for(int i=0;i<n;i++) {
		    		if(k[i]!=0) {
		    			out.print(k[i]+" ");
		    		}
		    	}
	    	}
		 	out.close();
	    }
	}


	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];
	    	int[] x = new int[n];
	    	for(int i=0;i<n;i++) {
	    		k[i]=in.nextInt();
	    		x[i]=k[i];
	    	}
	    	Arrays.sort(k);
	    	Arrays.sort(x);
	    	for(int i=0;i<n;i++) {
	    		boolean h = true;
	    		for(int j=0;j<n;j++) {
	    			if(k[j]%k[i]!=0) {
	    				h=false;
	    			}
	    		}
	    		if(h) {
	    			k[i]=0;
	    		}
	    	}

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

	    	}
		 	out.close();
	    }
	}


import java.io.*;
import java.util.*;
import java.util.Map.Entry;
import java.text.*;
import java.math.*;

public class Solution {
    public static void main(String[] args) {
    	Scanner input = new Scanner(System.in);
    	int n = input.nextInt();
    	int s[] = new int[n];

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

    	int gcd = s[0];
    	for (int i = 1; i < n; i++)
    		gcd = findGCD(gcd, s[i]);

    	if (gcd != s[0]) {
    		System.out.println(-1);
    		return;
    	}

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

    private static int findGCD(int number1, int number2) {
    	if(number2 == 0)
    		return number1;
    	return findGCD(number2, number1%number2);
    }
}


import java.io.*;
import java.util.*;
import java.util.Map.Entry;
import java.text.*;
import java.math.*;

public class Solution {
    public static void main(String[] args) {
    	Scanner input = new Scanner(System.in);
    	int n = input.nextInt();
    	int s[] = new int[n];
    	boolean exists[] = new boolean[1000001];

    	for (int i = 0; i < n; i++) {
    		s[i] = input.nextInt();
    		exists[s[i]] = true;
    	}

    	for (int i = 0; i < n; i++) {
    		for (int j = i + 1; j < n; j++) {
    			int gcd = findGCD(s[i], s[j]);
    			if (!exists[gcd]) {
    				System.out.println(-1);
    				return;
    			}
    		}
    	}

    	System.out.println(n);
    	for (int i = 0; i < n; i++)
    		System.out.print(s[i] + " ");
    }

    private static int findGCD(int number1, int number2) {
    	if(number2 == 0)
    		return number1;
    	return findGCD(number2, number1%number2);
    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author hsy
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(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, Scanner in, PrintWriter out) {
            int m = in.nextInt();
            int[] a = new int[m];
            for (int i = 0; i < m; i++) {
                a[i] = in.nextInt();
            }
            for (int i = 1; i < m; i++) {
                if (a[i] % a[0] != 0) {
                    out.println("-1");
                    return;
                }
            }
            out.println(2 * m - 1);
            for (int i = 0; i < m; i++) {
                if (i != 0) {
                    out.print(a[0] + " ");
                }
                out.print(a[i] + " ");
            }
            out.println("");
        }

    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.List;
import java.util.Arrays;
import java.util.Scanner;
import java.util.ArrayList;

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

    static class TaskC {
        static final int N = (int) 1e6 + 10;

        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int m = in.nextInt();
            int[] a = new int[m];
            int[] b = new int[m];
            int[] c = new int[m];
            boolean[] vis1 = new boolean[N];
            boolean[] vis2 = new boolean[N];
            List<Integer> list = new ArrayList<>();
            for (int i = 0; i < m; i++) {
                a[i] = in.nextInt();
                if (!vis2[a[i]]) {
                    list.add(a[i]);
                }
                vis1[a[i]] = vis2[a[i]] = true;
            }
            c = Arrays.copyOf(a, a.length);
            for (int i = 0; i < m; i++) {
                for (int j = 0; j < m - i - 1; j++) {
                    b[j] = gcd(a[j], a[j + 1]);
                }
                for (int j = 0; j < m - i - 1; j++) {
                    a[j] = b[j];
                    if (!vis2[b[j]]) {
                        list.add(b[j]);
                        vis2[b[j]] = true;
                    }
                }
            }
            for (int x : list) {
                if (!vis1[x]) {
                    out.println("-1");
                    return;
                }
            }
            out.println(m);
            for (int i = 0; i < m; i++) {
                out.print(c[i] + " ");
            }
            out.println("");
        }

        private int gcd(int i, int i1) {
            if (i > i1) {
                int t = i;
                i = i1;
                i1 = t;
            }
            while (i > 0) {
                int k = i1 % i;
                i1 = i;
                i = k;
            }
            return i1;
        }

    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author hsy
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(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, Scanner in, PrintWriter out) {
            int m = in.nextInt();
            int[] a = new int[m];
            for (int i = 0; i < m; i++) {
                a[i] = in.nextInt();
            }
            for (int i = 1; i < m; i++) {
                if (a[i] % a[0] != 0) {
                    out.println("-1");
                    return;
                }
            }
            out.println(2 * m - 1);
            for (int i = 0; i < m; i++) {
                if (i != 0) {
                    out.print(a[0] + " ");
                }
                out.print(a[i] + " ");
            }
            out.print("\n");
        }

    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.List;
import java.util.Scanner;
import java.util.ArrayList;

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

    static class TaskC {
        static final int N = (int) 1e6 + 10;

        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int m = in.nextInt();
            int[] a = new int[m];
            int[] b = new int[m];
            boolean[] vis1 = new boolean[N];
            boolean[] vis2 = new boolean[N];
            List<Integer> list = new ArrayList<>();
            for (int i = 0; i < m; i++) {
                a[i] = in.nextInt();
                if (!vis2[a[i]]) {
                    list.add(a[i]);
                }
                vis1[a[i]] = vis2[a[i]] = true;
            }
            for (int i = 0; i < m; i++) {
                for (int j = 0; j < m - i - 1; j++) {
                    b[j] = gcd(a[j], a[j + 1]);
                }
                for (int j = 0; j < m - i - 1; j++) {
                    a[j] = b[j];
                    if (!vis2[b[j]]) {
                        list.add(b[j]);
                        vis2[b[j]] = true;
                    }
                }
            }
            for (int x : list) {
                if (!vis1[x]) {
                    out.println("-1");
                    return;
                }
            }
            out.println(m);
            for (int i = 0; i < m; i++) {
                out.print(a[i] + " ");
            }
            out.println("");
        }

        private int gcd(int i, int i1) {
            if (i > i1) {
                int t = i;
                i = i1;
                i1 = t;
            }
            while (i > 0) {
                int k = i1 % i;
                i1 = i;
                i = k;
            }
            return i1;
        }

    }
}


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

public class Main {
    static int gcd(int a, int b) {
        while (a != 0 && b != 0) {
            if (a > b) a = a % b;
            else b = b % a;
        }
        return a + b;
    }

    static void solve() throws IOException {
        int m = ni1();
        int s[] = new int[m];
        rl();
        for (int i = 0; i < m; i++) s[i] = ni2();
        if (m == 1){
            ans.append("1\n");
            ans.append(s[0]).append('\n');
        } else {
            boolean possible = true;
            for (int i = 0; i < m - 1; i++) {
                if (s[m - 1] % s[i] != 0) {
                    possible = false;
                    break;
                }
            }
            if (!possible) ans.append("-1\n");
            else {
                HashSet<Integer> set = new HashSet<>();
                for (int i = 0; i < m; i++) set.add(s[i]);
                for (int i = 0; i < m - 1; i++) {
                    for (int j = i + 1; j < m - 1; j++) {
                        int x = gcd(s[i], s[j]);
                        if (!set.contains(x)) {
                            possible = false;
                            break;
                        }
                        if (!possible) break;
                    }
                }
                if (!possible) ans.append("-1\n");
                else {
                    ans.append(m).append('\n');
                    for (int i = 0; i < m; i++) ans.append(s[i]).append(" ");
                }
            }
        }
        output.write(ans.toString());
        output.flush();
        output.close();
    }

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

    static BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
    static BufferedWriter output = new BufferedWriter(new OutputStreamWriter(System.out));
    static StringBuilder ans = new StringBuilder();
    static String line;
    static StringTokenizer stringTokenizer;

    static int ni1() throws IOException {
        return Integer.parseInt(input.readLine());
    }

    static int ni2() throws IOException {
        return Integer.parseInt(stringTokenizer.nextToken());
    }

    static long nl1() throws IOException {
        return Long.parseLong(input.readLine());
    }

    static long nl2() {
        return Long.parseLong(stringTokenizer.nextToken());
    }

    static void rl() throws IOException {
        stringTokenizer = new StringTokenizer(input.readLine());
    }
}


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

public class Main {
    static int gcd(int a, int b) {
        while (a != 0 && b != 0) {
            if (a > b) a = a % b;
            else b = b % a;
        }
        return a + b;
    }

    static void solve() throws IOException {
        int m = ni1();
        int s[] = new int[m];
        rl();
        for (int i = 0; i < m; i++) s[i] = ni2();
        boolean possible = true;
        HashSet<Integer> set = new HashSet<>();
        for (int i = 0; i < m; i++) set.add(s[i]);
        for (int i = 0; i < m; i++) {
            for (int j = 0; j < m; j++) {
                int x = gcd(s[i], s[j]);
                if (!set.contains(x)) {
                    possible = false;
                    break;
                }
            }
            if (!possible) break;
        }
        if (!possible) ans.append("-1\n");
        else {
            ans.append(m).append('\n');
            for (int i = 0; i < m; i++) ans.append(s[i]).append(" ");
        }
        output.write(ans.toString());
        output.flush();
        output.close();
    }

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

    static BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
    static BufferedWriter output = new BufferedWriter(new OutputStreamWriter(System.out));
    static StringBuilder ans = new StringBuilder();
    static String line;
    static StringTokenizer stringTokenizer;

    static int ni1() throws IOException {
        return Integer.parseInt(input.readLine());
    }

    static int ni2() throws IOException {
        return Integer.parseInt(stringTokenizer.nextToken());
    }

    static long nl1() throws IOException {
        return Long.parseLong(input.readLine());
    }

    static long nl2() {
        return Long.parseLong(stringTokenizer.nextToken());
    }

    static void rl() throws IOException {
        stringTokenizer = new StringTokenizer(input.readLine());
    }
}


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

public class Main {
    static int gcd(int a, int b) {
        while (a != 0 && b != 0) {
            if (a > b) a = a % b;
            else b = b % a;
        }
        return a + b;
    }

    static void solve() throws IOException {
        int m = ni1();
        int s[] = new int[m];
        rl();
        for (int i = 0; i < m; i++) s[i] = ni2();
        int gcdAll = s[0];
        for (int i = 1; i < m; i++) gcdAll = gcd(gcdAll, s[i]);
        if (gcdAll != s[0]) {
            ans.append("-1\n");
        } else {
            ans.append(2 * m).append('\n');
            for (int i = 0; i < m; i++) {
                ans.append(s[i]).append(" ").append(s[0]).append(" ");
            }
        }
        output.write(ans.toString());
        output.flush();
        output.close();
    }

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

    static BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
    static BufferedWriter output = new BufferedWriter(new OutputStreamWriter(System.out));
    static StringBuilder ans = new StringBuilder();
    static String line;
    static StringTokenizer stringTokenizer;

    static int ni1() throws IOException {
        return Integer.parseInt(input.readLine());
    }

    static int ni2() throws IOException {
        return Integer.parseInt(stringTokenizer.nextToken());
    }

    static long nl1() throws IOException {
        return Long.parseLong(input.readLine());
    }

    static long nl2() {
        return Long.parseLong(stringTokenizer.nextToken());
    }

    static void rl() throws IOException {
        stringTokenizer = new StringTokenizer(input.readLine());
    }
}


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

public class Main {
    static int gcd(int a, int b) {
        while (a != 0 && b != 0) {
            if (a > b) a = a % b;
            else b = b % a;
        }
        return a + b;
    }

    static void solve() throws IOException {
        int m = ni1();
        int s[] = new int[m];
        rl();
        for (int i = 0; i < m; i++) s[i] = ni2();
        if (m == 1){
            ans.append("1\n");
            ans.append(s[0]).append('\n');
        } else {
            boolean possible = true;
            HashSet<Integer> set = new HashSet<>();
            for (int i = 0; i < m; i++) set.add(s[i]);
            for (int i = 0; i < m; i++) {
                for (int j = i + 1; j < m; j++) {
                    int x = gcd(s[i], s[j]);
                    if (!set.contains(x)) {
                        possible = false;
                        break;
                    }
                    if (!possible) break;
                }
            }
            if (!possible) ans.append("-1\n");
            else {
                ans.append(m).append('\n');
                for (int i = 0; i < m; i++) ans.append(s[i]).append(" ");
            }
        }
        output.write(ans.toString());
        output.flush();
        output.close();
    }

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

    static BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
    static BufferedWriter output = new BufferedWriter(new OutputStreamWriter(System.out));
    static StringBuilder ans = new StringBuilder();
    static String line;
    static StringTokenizer stringTokenizer;

    static int ni1() throws IOException {
        return Integer.parseInt(input.readLine());
    }

    static int ni2() throws IOException {
        return Integer.parseInt(stringTokenizer.nextToken());
    }

    static long nl1() throws IOException {
        return Long.parseLong(input.readLine());
    }

    static long nl2() {
        return Long.parseLong(stringTokenizer.nextToken());
    }

    static void rl() throws IOException {
        stringTokenizer = new StringTokenizer(input.readLine());
    }
}


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

public class Main {
    static int gcd(int a, int b) {
        while (a != 0 && b != 0) {
            if (a > b) a = a % b;
            else b = b % a;
        }
        return a + b;
    }

    static void solve() throws IOException {
        int m = ni1();
        int s[] = new int[m];
        rl();
        for (int i = 0; i < m; i++) s[i] = ni2();
        int gcdAll = s[0];
        for (int i = 1; i < m; i++) gcdAll = gcd(gcdAll, s[i]);
        if (gcdAll != s[0]) {
            ans.append("-1\n");
        } else {
            for (int i = 0; i < m; i++) {
                ans.append(s[i]).append(" ").append(s[0]).append(" ");
            }
        }
        output.write(ans.toString());
        output.flush();
        output.close();
    }

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

    static BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
    static BufferedWriter output = new BufferedWriter(new OutputStreamWriter(System.out));
    static StringBuilder ans = new StringBuilder();
    static String line;
    static StringTokenizer stringTokenizer;

    static int ni1() throws IOException {
        return Integer.parseInt(input.readLine());
    }

    static int ni2() throws IOException {
        return Integer.parseInt(stringTokenizer.nextToken());
    }

    static long nl1() throws IOException {
        return Long.parseLong(input.readLine());
    }

    static long nl2() {
        return Long.parseLong(stringTokenizer.nextToken());
    }

    static void rl() throws IOException {
        stringTokenizer = new StringTokenizer(input.readLine());
    }
}


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

public class Main
{
	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;
        }
    }

	public static void main (String[] args)
	{
		FastReader reader = new FastReader();
		PrintWriter writer = new PrintWriter (System.out);
		int setSize = reader.nextInt();

		int[] set = new int[setSize];
		for (int i=0; i<setSize; i++)
			set[i] = reader.nextInt();

		int finalGcd = set[0];
		boolean check = false;

		for (int i=0; i<setSize; i++)
			finalGcd = gcdExtended (finalGcd, set[i], 1, 1);

		for (int i=0; i<setSize; i++)
		{
			if (finalGcd == set[i])
				check = true;
		}

		if (check)
		{
			writer.println (2*setSize + 1);

			for (int i=0; i<setSize; i++)
				writer.print (finalGcd + " " + set[i] + " ");

			writer.print (finalGcd);
			writer.println ();
		}
		else
			writer.println (-1);

		writer.close();
	}

	static int gcdExtended(int a, int b, int x, int y)
	{
			// Base Case
			if (a == 0)
			{
					x = 0;
					y = 1;
					return b;
			}

			int x1=1, y1=1; // To store results of recursive call
			int gcd = gcdExtended(b%a, a, x1, y1);

			// Update x and y using results of recursive
			// call
			x = y1 - (b/a) * x1;
			y = x1;

			return gcd;
	}

}


import java.io.PrintWriter;
import java.util.Scanner;

public class P894C
{
	public static void main(String[] args)
	{
		Scanner scan = new Scanner(System.in);
		PrintWriter pw = new PrintWriter(System.out);
		int n = scan.nextInt();
		int[] arr = new int[n];
		for (int i = 0; i < n; i++)
			arr[i] = scan.nextInt();
		boolean poss = true;
		for (int i = 1; i < n; i++)
		{
			if (gcd(arr[0], arr[i]) < arr[0])
				poss = false;
		}
		if (!poss)
		{
			pw.println(-1);
			pw.flush();
			return;
		}
		pw.println(2*n);
		for (int i = 0; i < n; i++)
		{
			pw.print(arr[i] + " ");
			pw.print(arr[0] + " ");
		}
		pw.flush();
	}

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


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

public class Main {
    public static void main(String[] args) {
        InputReader in = new InputReader();
        PrintWriter out = new PrintWriter(System.out);
        Solver s = new Solver();
        int test = 1;
        for (int i = 1; i <= test; i++) {
            s.solve(i, in, out);
        }
        out.close();
    }

    static class Solver {
        final int MOD = 1000000007;
        void solve(int test_case, InputReader in, PrintWriter out) {
            int n  = in.nextInt();
            int[] a = new int[n];
            for (int i = 0; i < n; i++) a[i] = in.nextInt();
            if (check(a)) {
                for (int i = 0; i < n; i++) out.print(a[i] + " ");
            } else {
                out.println(-1);
            }
        }

        private boolean check(int[] a) {
            int n = a.length;
            for (int i = 0; i < n; i++) {
                for (int j = 0; j < n; j++) {
                    if (Arrays.binarySearch(a, gcd(a[i], a[j])) < 0) return false;
                }
            }
            return true;
        }

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

        BufferedReader br;
        StringTokenizer st;

        public InputReader() {
            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.*;

public class Main {
    public static void main(String[] args) {
        InputReader in = new InputReader();
        PrintWriter out = new PrintWriter(System.out);
        Solver s = new Solver();
        int test = 1;
        for (int i = 1; i <= test; i++) {
            s.solve(i, in, out);
        }
        out.close();
    }

    static class Solver {
        final int MOD = 1000000007;
        void solve(int test_case, InputReader in, PrintWriter out) {
            int n  = in.nextInt();
            int[] a = new int[n];
            for (int i = 0; i < n; i++) a[i] = in.nextInt();
            if (check(a)) {
                out.println(n);
                for (int i = 0; i < n; i++) out.print(a[i] + " ");
            } else {
                out.println(-1);
            }
        }

        private boolean check(int[] a) {
            int n = a.length;
            for (int i = 0; i < n; i++) {
                for (int j = 0; j < n; j++) {
                    if (Arrays.binarySearch(a, gcd(a[i], a[j])) < 0) return false;
                }
            }
            return true;
        }

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

        BufferedReader br;
        StringTokenizer st;

        public InputReader() {
            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.*;

public class Main {
    public static void main(String[] args) {
        InputReader in = new InputReader();
        PrintWriter out = new PrintWriter(System.out);
        Solver s = new Solver();
        int test = 1;
        for (int i = 1; i <= test; i++) {
            s.solve(i, in, out);
        }
        out.close();
    }

    static class Solver {
        final int MOD = 1000000007;
        final int MAX = (int) (1e6 + 7);
        boolean[] contains = new boolean[MAX];
        void solve(int test_case, InputReader in, PrintWriter out) {
            int n  = in.nextInt();
            int[] a = new int[n];
            for (int i = 0; i < n; i++) {
                a[i] = in.nextInt();
                contains[a[i]] = true;
            }
            if (check(a)) {
                out.println(n);
                for (int i = 0; i < n; i++) out.print(a[i] + " ");
            } else {
                out.println(-1);
            }
        }

        private boolean check(int[] a) {
            int n = a.length;
            for (int i = 0; i < n; i++) {
                for (int j = 0; j < n; j++) {
                    if (!contains[gcd(a[i], a[j])]) return false;
                }
            }
            return true;
        }

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

        BufferedReader br;
        StringTokenizer st;

        public InputReader() {
            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.*;

public class Main {
    public static void main(String[] args) {
        InputReader in = new InputReader();
        PrintWriter out = new PrintWriter(System.out);
        Solver s = new Solver();
        int test = 1;
        for (int i = 1; i <= test; i++) {
            s.solve(i, in, out);
        }
        out.close();
    }

    static class Solver {
        final int MOD = 1000000007;
        void solve(int test_case, InputReader in, PrintWriter out) {
            int n  = in.nextInt();
            int[] a = new int[n];
            for (int i = 0; i < n; i++) a[i] = in.nextInt();
            int g = a[0];
            for (int i = 1; i < n; i++) g = gcd(g, a[i]);
            if (g != a[0]) {
                out.println(-1);
            } else {
                out.println(n * 2);
                for (int i = 0; i < n; i++) out.print(a[i] + " " + g + " ");
            }
        }

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

    }
    static class InputReader {

        BufferedReader br;
        StringTokenizer st;

        public InputReader() {
            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.PrintWriter;
import java.util.Scanner;
import java.util.ArrayList;

public class Task {

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

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);

		int n = in.nextInt();
		ArrayList<Integer> list = new ArrayList<Integer>();

		int min = 0;
		for (int i = 0; i < n; i++) {
		       	list.add(in.nextInt());
			min = gcd(list.get(i), min);
		}

		if (min == list.get(0)) {
			out.println(n);
			for (int i = 0; i < n; i++) {
				out.print(list.get(i) + " ");
			}
		} else out.println(-1);

		out.close();
	}
}


import java.io.PrintWriter;
import java.util.Scanner;
import java.util.ArrayList;

public class Task {

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

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);

		int n = in.nextInt();
		ArrayList<Integer> list = new ArrayList<Integer>();

		int min = 0;
		for (int i = 0; i < n; i++) {
		       	list.add(in.nextInt());
			min = gcd(list.get(i), min);
		}

		if (min == list.get(0)) {
			out.println(2 * n);
			for (int i = 0; i < n; i++) {
				out.print(list.get(i) + " " + min + " ");
			}
		} else out.println(-1);

		out.close();
	}
}


/*
 *
 * @Author  Ajudiya_13(Bhargav Girdharbhai Ajudiya)
 * Dhirubhai Ambani Institute of Information And Communication Technology
 *
 */

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

public class Code258
{
	public static int ans[];
	public static HashSet<Integer> hash;
	public static PrintWriter pw;
	public static void getAns(int n,int[] a)
	{
		boolean flag = true;
		for(int i=0;i<n;i++)
		{
			int gcd = a[i];
			for(int j=i;j<n;j++)
			{
				gcd = GCD(gcd,a[j]);
				if(!hash.contains(gcd))
				{
					if(i==0)
					{
						flag = false;
						break;
					}
					ans[j]++;
				}
			}
		}

		if(flag)
		{
			int sum = 0;
			for(int i=0;i<n;i++)
				sum += ans[i];
			pw.println(n+sum);
			for(int i=0;i<n;i++)
			{
				while(ans[i]>0)
				{
					pw.print(a[0] + " ");
					ans[i]--;
				}
				pw.print(a[i] + " ");
			}
		}
		else
			pw.println("-1");

	}
	public static void main(String[] args)
	{
		InputReader in = new InputReader(System.in);
		pw = new PrintWriter(System.out);

		int n = in.nextInt();
		int[] a = in.nextIntArray(n);
		ans = new int[n];
		hash = new HashSet<Integer>();
		boolean flag = false;
		int gcd = a[0];
		hash.add(a[0]);
		if(a[0]==1)
			flag = true;
		for(int i=1;i<n;i++)
		{
			hash.add(a[i]);
			if(a[i]==1)
				flag = true;
			gcd = GCD(gcd, a[i]);
		}

		if(gcd==1)
		{
			if(!flag)
				pw.println("-1");
			else
			{
				getAns(n, a);
			}
		}
		else
		{
			getAns(n, a);
		}
		pw.flush();
		pw.close();
	}

	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 String readString()
	    {
			int c = snext();
			while (isSpaceChar(c))
			{
				c = snext();
			}
			StringBuilder res = new StringBuilder();
			do
			{
				res.appendCodePoint(c);
				c = snext();
			} while (!isSpaceChar(c));
			return res.toString();
		}

		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);
		}
	}

	public static long mod = 1000000007;
	public static int d;
	public static int p;
	public static int q;

	public static int[] suffle(int[] a,Random gen)
	{
		int n = a.length;
		for(int i=0;i<n;i++)
		{
			int ind = gen.nextInt(n-i)+i;
			int temp = a[ind];
			a[ind] = a[i];
			a[i] = temp;
		}
		return a;
	}

	public static void swap(int a, int b){
		int temp = a;
		a = b;
		b = temp;
	}

	public static HashSet<Integer> primeFactorization(int n)
	{
		HashSet<Integer> a =new HashSet<Integer>();
		for(int i=2;i*i<=n;i++)
		{
			while(n%i==0)
			{
				a.add(i);
				n/=i;
			}
		}
		if(n!=1)
			a.add(n);
		return a;
	}

	public static void sieve(boolean[] isPrime,int n)
	{
		for(int i=1;i<n;i++)
			isPrime[i] = true;

		isPrime[0] = false;
		isPrime[1] = false;

		for(int i=2;i*i<n;i++)
		{
			if(isPrime[i] == true)
			{
				for(int j=(2*i);j<n;j+=i)
					isPrime[j] = false;
			}
		}
	}

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

	public static long GCD(long a,long b)
	{
		if(b==0)
			return a;
		else
			return GCD(b,a%b);
	}

	public static void extendedEuclid(int A,int B)
	{
		if(B==0)
		{
			d = A;
			p = 1 ;
			q = 0;
		}
		else
		{
			extendedEuclid(B, A%B);
			int temp = p;
			p = q;
			q = temp - (A/B)*q;
		}
	}

	public static long LCM(long a,long b)
	{
		return (a*b)/GCD(a,b);
	}

	public static int LCM(int a,int b)
	{
		return (a*b)/GCD(a,b);
	}

	public static int binaryExponentiation(int x,int n)
	{
	    int result=1;
	    while(n>0)
	    {
	        if(n % 2 ==1)
	            result=result * x;
	        x=x*x;
	        n=n/2;
	    }
	    return result;
	}

	public static long binaryExponentiation(long x,long n)
	{
	    long result=1;
	    while(n>0)
	    {
	        if(n % 2 ==1)
	            result=result * x;
	        x=x*x;
	        n=n/2;
	    }
	    return result;
	}

	public static int modularExponentiation(int x,int n,int M)
	{
	    int result=1;
	    while(n>0)
	    {
	        if(n % 2 ==1)
	            result=(result * x)%M;
	        x=(x*x)%M;
	        n=n/2;
	    }
	    return result;
	}

	public static long modularExponentiation(long x,long n,long M)
	{
	    long result=1;
	    while(n>0)
	    {
	        if(n % 2 ==1)
	            result=(result * x)%M;
	        x=(x*x)%M;
	        n=n/2;
	    }
	    return result;
	}

	public static int modInverse(int A,int M)
	{
	    return modularExponentiation(A,M-2,M);
	}

	public static long modInverse(long A,long M)
	{
	    return modularExponentiation(A,M-2,M);
	}

	public static boolean isPrime(int n)
	{

	    if (n <= 1)  return false;
	    if (n <= 3)  return true;

	    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;
	}

	static class pair implements Comparable<pair>
	{
		Integer x, y;
		pair(int x,int y)
		{
			this.x=x;
			this.y=y;
		}

		public int compareTo(pair o) {
			int result = x.compareTo(o.x);
			if(result==0)
				result = y.compareTo(o.y);

			return result;
		}

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

		public boolean equals(Object o)
		{
			if (o instanceof pair)
		    {
				pair p = (pair)o;
				return p.x == x && p.y == y ;
			}
			return false;
		}

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


/*
 *
 * @Author  Ajudiya_13(Bhargav Girdharbhai Ajudiya)
 * Dhirubhai Ambani Institute of Information And Communication Technology
 *
 */

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

public class Code258
{
	public static int ans[];
	public static HashSet<Integer> hash;
	public static PrintWriter pw;
	public static void getAns(int n,int[] a)
	{
		for(int i=0;i<n;i++)
		{
			int gcd = a[i];
			for(int j=0;j<n;j++)
			{
				gcd = GCD(gcd,a[j]);
				if(!hash.contains(gcd))
					ans[j]++;
			}
		}
		int sum = 0;
		for(int i=0;i<n;i++)
			sum += ans[i];
		pw.println(n+sum);
		for(int i=0;i<n;i++)
		{
			while(ans[i]>0)
			{
				pw.print(a[0] + " ");
				ans[i]--;
			}
			pw.print(a[i] + " ");
		}

	}
	public static void main(String[] args)
	{
		InputReader in = new InputReader(System.in);
		pw = new PrintWriter(System.out);

		int n = in.nextInt();
		int[] a = in.nextIntArray(n);
		ans = new int[n];
		hash = new HashSet<Integer>();
		boolean flag = false;
		int gcd = a[0];
		hash.add(a[0]);
		if(a[0]==1)
			flag = true;
		for(int i=1;i<n;i++)
		{
			hash.add(a[i]);
			if(a[i]==1)
				flag = true;
			gcd = GCD(gcd, a[i]);
		}

		if(gcd==1)
		{
			if(!flag)
				pw.println("-1");
			else
			{
				getAns(n, a);
			}
		}
		else
		{
			getAns(n, a);
		}
		pw.flush();
		pw.close();
	}

	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 String readString()
	    {
			int c = snext();
			while (isSpaceChar(c))
			{
				c = snext();
			}
			StringBuilder res = new StringBuilder();
			do
			{
				res.appendCodePoint(c);
				c = snext();
			} while (!isSpaceChar(c));
			return res.toString();
		}

		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);
		}
	}

	public static long mod = 1000000007;
	public static int d;
	public static int p;
	public static int q;

	public static int[] suffle(int[] a,Random gen)
	{
		int n = a.length;
		for(int i=0;i<n;i++)
		{
			int ind = gen.nextInt(n-i)+i;
			int temp = a[ind];
			a[ind] = a[i];
			a[i] = temp;
		}
		return a;
	}

	public static void swap(int a, int b){
		int temp = a;
		a = b;
		b = temp;
	}

	public static HashSet<Integer> primeFactorization(int n)
	{
		HashSet<Integer> a =new HashSet<Integer>();
		for(int i=2;i*i<=n;i++)
		{
			while(n%i==0)
			{
				a.add(i);
				n/=i;
			}
		}
		if(n!=1)
			a.add(n);
		return a;
	}

	public static void sieve(boolean[] isPrime,int n)
	{
		for(int i=1;i<n;i++)
			isPrime[i] = true;

		isPrime[0] = false;
		isPrime[1] = false;

		for(int i=2;i*i<n;i++)
		{
			if(isPrime[i] == true)
			{
				for(int j=(2*i);j<n;j+=i)
					isPrime[j] = false;
			}
		}
	}

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

	public static long GCD(long a,long b)
	{
		if(b==0)
			return a;
		else
			return GCD(b,a%b);
	}

	public static void extendedEuclid(int A,int B)
	{
		if(B==0)
		{
			d = A;
			p = 1 ;
			q = 0;
		}
		else
		{
			extendedEuclid(B, A%B);
			int temp = p;
			p = q;
			q = temp - (A/B)*q;
		}
	}

	public static long LCM(long a,long b)
	{
		return (a*b)/GCD(a,b);
	}

	public static int LCM(int a,int b)
	{
		return (a*b)/GCD(a,b);
	}

	public static int binaryExponentiation(int x,int n)
	{
	    int result=1;
	    while(n>0)
	    {
	        if(n % 2 ==1)
	            result=result * x;
	        x=x*x;
	        n=n/2;
	    }
	    return result;
	}

	public static long binaryExponentiation(long x,long n)
	{
	    long result=1;
	    while(n>0)
	    {
	        if(n % 2 ==1)
	            result=result * x;
	        x=x*x;
	        n=n/2;
	    }
	    return result;
	}

	public static int modularExponentiation(int x,int n,int M)
	{
	    int result=1;
	    while(n>0)
	    {
	        if(n % 2 ==1)
	            result=(result * x)%M;
	        x=(x*x)%M;
	        n=n/2;
	    }
	    return result;
	}

	public static long modularExponentiation(long x,long n,long M)
	{
	    long result=1;
	    while(n>0)
	    {
	        if(n % 2 ==1)
	            result=(result * x)%M;
	        x=(x*x)%M;
	        n=n/2;
	    }
	    return result;
	}

	public static int modInverse(int A,int M)
	{
	    return modularExponentiation(A,M-2,M);
	}

	public static long modInverse(long A,long M)
	{
	    return modularExponentiation(A,M-2,M);
	}

	public static boolean isPrime(int n)
	{

	    if (n <= 1)  return false;
	    if (n <= 3)  return true;

	    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;
	}

	static class pair implements Comparable<pair>
	{
		Integer x, y;
		pair(int x,int y)
		{
			this.x=x;
			this.y=y;
		}

		public int compareTo(pair o) {
			int result = x.compareTo(o.x);
			if(result==0)
				result = y.compareTo(o.y);

			return result;
		}

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

		public boolean equals(Object o)
		{
			if (o instanceof pair)
		    {
				pair p = (pair)o;
				return p.x == x && p.y == y ;
			}
			return false;
		}

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


/*
 *
 * @Author  Ajudiya_13(Bhargav Girdharbhai Ajudiya)
 * Dhirubhai Ambani Institute of Information And Communication Technology
 *
 */

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

public class Code258
{
	public static HashSet<Integer> hash;
	public static HashSet<Integer> notans;

	public static void getAns(int n,int[] a)
	{
		for(int i=0;i<n;i++)
		{
			int gcd = a[i];
			for(int j=i;j<n;j++)
			{
				gcd = GCD(gcd, a[j]);
				if(!hash.contains(gcd))
					notans.add(a[j]);
			}
		}
	}
	public static void main(String[] args)
	{
		InputReader in = new InputReader(System.in);
		PrintWriter pw = new PrintWriter(System.out);

		int n = in.nextInt();
		int[] a = in.nextIntArray(n);
		hash = new HashSet<Integer>();
		notans = new HashSet<Integer>();

		boolean flag = false;
		int gcd = a[0];
		hash.add(a[0]);
		if(a[0]==1)
			flag = true;
		for(int i=1;i<n;i++)
		{
			hash.add(a[i]);
			if(a[i]==1)
				flag = true;
			gcd = GCD(gcd, a[i]);
		}

		if(gcd==1)
		{
			if(!flag)
				pw.println("-1");
			else
			{
				getAns(n, a);
				pw.println(n-notans.size());
				for(int i=0;i<n;i++)
				{
					if(!notans.contains(a[i]))
						pw.print(a[i] + " ");
				}
			}
		}
		else
		{
			getAns(n, a);
			pw.println(n-notans.size());
			for(int i=0;i<n;i++)
			{
				if(!notans.contains(a[i]))
					pw.print(a[i] + " ");
			}
		}
		pw.flush();
		pw.close();
	}

	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 String readString()
	    {
			int c = snext();
			while (isSpaceChar(c))
			{
				c = snext();
			}
			StringBuilder res = new StringBuilder();
			do
			{
				res.appendCodePoint(c);
				c = snext();
			} while (!isSpaceChar(c));
			return res.toString();
		}

		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);
		}
	}

	public static long mod = 1000000007;
	public static int d;
	public static int p;
	public static int q;

	public static int[] suffle(int[] a,Random gen)
	{
		int n = a.length;
		for(int i=0;i<n;i++)
		{
			int ind = gen.nextInt(n-i)+i;
			int temp = a[ind];
			a[ind] = a[i];
			a[i] = temp;
		}
		return a;
	}

	public static void swap(int a, int b){
		int temp = a;
		a = b;
		b = temp;
	}

	public static HashSet<Integer> primeFactorization(int n)
	{
		HashSet<Integer> a =new HashSet<Integer>();
		for(int i=2;i*i<=n;i++)
		{
			while(n%i==0)
			{
				a.add(i);
				n/=i;
			}
		}
		if(n!=1)
			a.add(n);
		return a;
	}

	public static void sieve(boolean[] isPrime,int n)
	{
		for(int i=1;i<n;i++)
			isPrime[i] = true;

		isPrime[0] = false;
		isPrime[1] = false;

		for(int i=2;i*i<n;i++)
		{
			if(isPrime[i] == true)
			{
				for(int j=(2*i);j<n;j+=i)
					isPrime[j] = false;
			}
		}
	}

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

	public static long GCD(long a,long b)
	{
		if(b==0)
			return a;
		else
			return GCD(b,a%b);
	}

	public static void extendedEuclid(int A,int B)
	{
		if(B==0)
		{
			d = A;
			p = 1 ;
			q = 0;
		}
		else
		{
			extendedEuclid(B, A%B);
			int temp = p;
			p = q;
			q = temp - (A/B)*q;
		}
	}

	public static long LCM(long a,long b)
	{
		return (a*b)/GCD(a,b);
	}

	public static int LCM(int a,int b)
	{
		return (a*b)/GCD(a,b);
	}

	public static int binaryExponentiation(int x,int n)
	{
	    int result=1;
	    while(n>0)
	    {
	        if(n % 2 ==1)
	            result=result * x;
	        x=x*x;
	        n=n/2;
	    }
	    return result;
	}

	public static long binaryExponentiation(long x,long n)
	{
	    long result=1;
	    while(n>0)
	    {
	        if(n % 2 ==1)
	            result=result * x;
	        x=x*x;
	        n=n/2;
	    }
	    return result;
	}

	public static int modularExponentiation(int x,int n,int M)
	{
	    int result=1;
	    while(n>0)
	    {
	        if(n % 2 ==1)
	            result=(result * x)%M;
	        x=(x*x)%M;
	        n=n/2;
	    }
	    return result;
	}

	public static long modularExponentiation(long x,long n,long M)
	{
	    long result=1;
	    while(n>0)
	    {
	        if(n % 2 ==1)
	            result=(result * x)%M;
	        x=(x*x)%M;
	        n=n/2;
	    }
	    return result;
	}

	public static int modInverse(int A,int M)
	{
	    return modularExponentiation(A,M-2,M);
	}

	public static long modInverse(long A,long M)
	{
	    return modularExponentiation(A,M-2,M);
	}

	public static boolean isPrime(int n)
	{

	    if (n <= 1)  return false;
	    if (n <= 3)  return true;

	    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;
	}

	static class pair implements Comparable<pair>
	{
		Integer x, y;
		pair(int x,int y)
		{
			this.x=x;
			this.y=y;
		}

		public int compareTo(pair o) {
			int result = x.compareTo(o.x);
			if(result==0)
				result = y.compareTo(o.y);

			return result;
		}

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

		public boolean equals(Object o)
		{
			if (o instanceof pair)
		    {
				pair p = (pair)o;
				return p.x == x && p.y == y ;
			}
			return false;
		}

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


/*
 *
 * @Author  Ajudiya_13(Bhargav Girdharbhai Ajudiya)
 * Dhirubhai Ambani Institute of Information And Communication Technology
 *
 */

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

public class Code258
{

	public static void main(String[] args)
	{
		InputReader in = new InputReader(System.in);
		PrintWriter pw = new PrintWriter(System.out);

		int n = in.nextInt();
		int[] a = in.nextIntArray(n);

		boolean flag = false;
		int gcd = a[0];
		if(a[0]==1)
			flag = true;
		for(int i=1;i<n;i++)
		{
			if(a[i]==1)
				flag = true;
			gcd = GCD(gcd, a[i]);
		}

		if(gcd==1)
		{
			if(!flag)
				pw.println("-1");
			else
			{
				pw.println(n);
				for(int i=0;i<n;i++)
					pw.print(a[i] + " ");
			}
		}
		else
		{
			pw.println(n);
			for(int i=0;i<n;i++)
				pw.print(a[i] + " ");
		}
		pw.flush();
		pw.close();
	}

	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 String readString()
	    {
			int c = snext();
			while (isSpaceChar(c))
			{
				c = snext();
			}
			StringBuilder res = new StringBuilder();
			do
			{
				res.appendCodePoint(c);
				c = snext();
			} while (!isSpaceChar(c));
			return res.toString();
		}

		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);
		}
	}

	public static long mod = 1000000007;
	public static int d;
	public static int p;
	public static int q;

	public static int[] suffle(int[] a,Random gen)
	{
		int n = a.length;
		for(int i=0;i<n;i++)
		{
			int ind = gen.nextInt(n-i)+i;
			int temp = a[ind];
			a[ind] = a[i];
			a[i] = temp;
		}
		return a;
	}

	public static void swap(int a, int b){
		int temp = a;
		a = b;
		b = temp;
	}

	public static HashSet<Integer> primeFactorization(int n)
	{
		HashSet<Integer> a =new HashSet<Integer>();
		for(int i=2;i*i<=n;i++)
		{
			while(n%i==0)
			{
				a.add(i);
				n/=i;
			}
		}
		if(n!=1)
			a.add(n);
		return a;
	}

	public static void sieve(boolean[] isPrime,int n)
	{
		for(int i=1;i<n;i++)
			isPrime[i] = true;

		isPrime[0] = false;
		isPrime[1] = false;

		for(int i=2;i*i<n;i++)
		{
			if(isPrime[i] == true)
			{
				for(int j=(2*i);j<n;j+=i)
					isPrime[j] = false;
			}
		}
	}

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

	public static long GCD(long a,long b)
	{
		if(b==0)
			return a;
		else
			return GCD(b,a%b);
	}

	public static void extendedEuclid(int A,int B)
	{
		if(B==0)
		{
			d = A;
			p = 1 ;
			q = 0;
		}
		else
		{
			extendedEuclid(B, A%B);
			int temp = p;
			p = q;
			q = temp - (A/B)*q;
		}
	}

	public static long LCM(long a,long b)
	{
		return (a*b)/GCD(a,b);
	}

	public static int LCM(int a,int b)
	{
		return (a*b)/GCD(a,b);
	}

	public static int binaryExponentiation(int x,int n)
	{
	    int result=1;
	    while(n>0)
	    {
	        if(n % 2 ==1)
	            result=result * x;
	        x=x*x;
	        n=n/2;
	    }
	    return result;
	}

	public static long binaryExponentiation(long x,long n)
	{
	    long result=1;
	    while(n>0)
	    {
	        if(n % 2 ==1)
	            result=result * x;
	        x=x*x;
	        n=n/2;
	    }
	    return result;
	}

	public static int modularExponentiation(int x,int n,int M)
	{
	    int result=1;
	    while(n>0)
	    {
	        if(n % 2 ==1)
	            result=(result * x)%M;
	        x=(x*x)%M;
	        n=n/2;
	    }
	    return result;
	}

	public static long modularExponentiation(long x,long n,long M)
	{
	    long result=1;
	    while(n>0)
	    {
	        if(n % 2 ==1)
	            result=(result * x)%M;
	        x=(x*x)%M;
	        n=n/2;
	    }
	    return result;
	}

	public static int modInverse(int A,int M)
	{
	    return modularExponentiation(A,M-2,M);
	}

	public static long modInverse(long A,long M)
	{
	    return modularExponentiation(A,M-2,M);
	}

	public static boolean isPrime(int n)
	{

	    if (n <= 1)  return false;
	    if (n <= 3)  return true;

	    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;
	}

	static class pair implements Comparable<pair>
	{
		Integer x, y;
		pair(int x,int y)
		{
			this.x=x;
			this.y=y;
		}

		public int compareTo(pair o) {
			int result = x.compareTo(o.x);
			if(result==0)
				result = y.compareTo(o.y);

			return result;
		}

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

		public boolean equals(Object o)
		{
			if (o instanceof pair)
		    {
				pair p = (pair)o;
				return p.x == x && p.y == y ;
			}
			return false;
		}

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


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.PriorityQueue;
import java.util.StringTokenizer;

public class NEWW {

	static Pair[] arr;
	static int[] gen;
	static int[][] memo;
	static int n;
	static int OO = (int) 1e9;
	static ArrayList<Edge>[] adj;

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

	public static void main(String[] args) throws NumberFormatException, IOException {

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

		int g = 0;
		int n = Integer.parseInt(br.readLine());
		int[] arr = new int[n];
		st = new StringTokenizer(br.readLine());

		for (int i = 0; i < n; i++) {
			arr[i] = Integer.parseInt(st.nextToken());
			g = gcd(g, arr[i]);
		}
		if ( arr[0] != g) {
			System.out.println(-1);
		} else {
			System.out.println(n*2);
			for (int i = 0; i < n; i++)
				System.out.print(arr[i] + " "+gcd(arr[n-1],arr[i])+" ");
		}

	}

	static class Edge implements Comparable<Edge> {

		int node, cost, level;

		public Edge(int node, int cost, int level) {
			this.node = node;
			this.cost = cost;
			this.level = level;
		}

		public int compareTo(Edge O) {
			return O.cost == cost ? node - O.node : cost - O.cost;
		}
	}

	static class Pair {

		int day, dec;

		public Pair(int node, int cost) {
			day = node;
			dec = cost;
		}

	}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.PriorityQueue;
import java.util.StringTokenizer;

public class NEWW {

	static Pair[] arr;
	static int[] gen;
	static int[][] memo;
	static int n;
	static int OO = (int) 1e9;
	static ArrayList<Edge>[] adj;

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

	public static void main(String[] args) throws NumberFormatException, IOException {

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

		int g = 0;
		int n = Integer.parseInt(br.readLine());
		int[] arr = new int[n];
		st = new StringTokenizer(br.readLine());

		for (int i = 0; i < n; i++) {
			arr[i] = Integer.parseInt(st.nextToken());
			g = gcd(g, arr[i]);
		}

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

	}

	static class Edge implements Comparable<Edge> {

		int node, cost, level;

		public Edge(int node, int cost, int level) {
			this.node = node;
			this.cost = cost;
			this.level = level;
		}

		public int compareTo(Edge O) {
			return O.cost == cost ? node - O.node : cost - O.cost;
		}
	}

	static class Pair {

		int day, dec;

		public Pair(int node, int cost) {
			day = node;
			dec = cost;
		}

	}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.PriorityQueue;
import java.util.StringTokenizer;

public class NEWW {

	static Pair[] arr;
	static int[] gen;
	static int[][] memo;
	static int n;
	static int OO = (int) 1e9;
	static ArrayList<Edge>[] adj;

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

	public static void main(String[] args) throws NumberFormatException, IOException {

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

		int g = 0;
		int n = Integer.parseInt(br.readLine());
		int[] arr = new int[n];
		st = new StringTokenizer(br.readLine());

		for (int i = 0; i < n; i++) {
			arr[i] = Integer.parseInt(st.nextToken());
			g = gcd(g, arr[i]);
		}
		if ( arr[0] != g) {
			System.out.println(-1);
		} else {
			System.out.println(n);
			for (int i = 0; i < n; i++)
				System.out.print(arr[i] + " "+gcd(arr[0],arr[i]));
		}

	}

	static class Edge implements Comparable<Edge> {

		int node, cost, level;

		public Edge(int node, int cost, int level) {
			this.node = node;
			this.cost = cost;
			this.level = level;
		}

		public int compareTo(Edge O) {
			return O.cost == cost ? node - O.node : cost - O.cost;
		}
	}

	static class Pair {

		int day, dec;

		public Pair(int node, int cost) {
			day = node;
			dec = cost;
		}

	}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.PriorityQueue;
import java.util.StringTokenizer;

public class NEWW {

	static Pair[] arr;
	static int[] gen;
	static int[][] memo;
	static int n;
	static int OO = (int) 1e9;
	static ArrayList<Edge>[] adj;

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

	public static void main(String[] args) throws NumberFormatException, IOException {

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

		int g = 0;
		int n = Integer.parseInt(br.readLine());
		int[] arr = new int[n];
		st = new StringTokenizer(br.readLine());

		for (int i = 0; i < n; i++) {
			arr[i] = Integer.parseInt(st.nextToken());
			g = gcd(g, arr[i]);
		}

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

	}

	static class Edge implements Comparable<Edge> {

		int node, cost, level;

		public Edge(int node, int cost, int level) {
			this.node = node;
			this.cost = cost;
			this.level = level;
		}

		public int compareTo(Edge O) {
			return O.cost == cost ? node - O.node : cost - O.cost;
		}
	}

	static class Pair {

		int day, dec;

		public Pair(int node, int cost) {
			day = node;
			dec = cost;
		}

	}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.PriorityQueue;
import java.util.StringTokenizer;

public class NEWW {

	static Pair[] arr;
	static int[] gen;
	static int[][] memo;
	static int n;
	static int OO = (int) 1e9;
	static ArrayList<Edge>[] adj;

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

	public static void main(String[] args) throws NumberFormatException, IOException {

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

		int g = 0;
		int n = Integer.parseInt(br.readLine());
		int[] arr = new int[n];
		st = new StringTokenizer(br.readLine());

		for (int i = 0; i < n; i++) {
			arr[i] = Integer.parseInt(st.nextToken());
			g = gcd(g, arr[i]);
		}
		if ( arr[0] != g) {
			System.out.println(-1);
		} else {
			System.out.println(n*2);
			for (int i = 0; i < n; i++)
				System.out.print(arr[i] + " "+gcd(arr[0],arr[i])+" ");
		}

	}

	static class Edge implements Comparable<Edge> {

		int node, cost, level;

		public Edge(int node, int cost, int level) {
			this.node = node;
			this.cost = cost;
			this.level = level;
		}

		public int compareTo(Edge O) {
			return O.cost == cost ? node - O.node : cost - O.cost;
		}
	}

	static class Pair {

		int day, dec;

		public Pair(int node, int cost) {
			day = node;
			dec = cost;
		}

	}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.PriorityQueue;
import java.util.StringTokenizer;

public class NEWW {

	static Pair[] arr;
	static int[] gen;
	static int[][] memo;
	static int n;
	static int OO = (int) 1e9;
	static ArrayList<Edge>[] adj;

	static int gcd(int d, int b) {
		if (d == 0)
			return b;
		return gcd(b % d, d);
	}
	public static void main(String[] args) throws NumberFormatException, IOException {

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

		int g = 0;
		int n = Integer.parseInt(br.readLine());
		int[]arr = new int[n];
		st = new StringTokenizer(br.readLine());

		for(int i = 0;i<n;i++){
			arr[i] = Integer.parseInt(st.nextToken());
			g = gcd(g, arr[i]);
		}

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

	}

	static class Edge implements Comparable<Edge> {

		int node, cost, level;

		public Edge(int node, int cost, int level) {
			this.node = node;
			this.cost = cost;
			this.level = level;
		}

		public int compareTo(Edge O) {
			return O.cost == cost ? node - O.node : cost - O.cost;
		}
	}

	static class Pair {

		int day, dec;

		public Pair(int node, int cost) {
			day = node;
			dec = cost;
		}

	}
}


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

public class R447C {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		int n = scan.nextInt();
		long[] arr = new long[n];
		long min = Integer.MAX_VALUE;
		for(int i = 0; i < n; i++){
			arr[i] = scan.nextInt();
		}
		min = arr[0];
		long g = arr[0];
		for(int i = 1; i < n; i++){
			g = gcd(g, arr[i]);
			min = Math.min(min, arr[i]);
		}
		if(g != min){
			System.out.println(-1);
			return;
		}
		System.out.println(2*n);
		for(int i = 0; i < n; i++){
			System.out.print(arr[i]+" "+min+" ");
		}
	}

	static long gcd(long p, long q) {
        if (q == 0) return p;
        else return gcd(q, p % q);
    }

	static long lcm(long p, long q){
		return p*(q/gcd(p, q));
	}
}

/*
3
1 2 3
*/


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

public class R447C {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		int n = scan.nextInt();
		long[] arr = new long[n];
		boolean foundOne = false;
		for(int i = 0; i < n; i++){
			arr[i] = scan.nextInt();
			if(arr[i] == 1)	foundOne = true;
		}
//		long g = arr[0];
//		for(int i = 1; i < n; i++){
//			g = gcd(arr[i], g);
//		}
//		if(g == 1 && !foundOne){
//			System.out.println("-1");
//			return;
//		}
		HashSet<Long> x = new HashSet<Long>();
		ArrayList<Long> set = new ArrayList<Long>();
		long[][] gcdOfRange = new long[n][n]; //from 0 to n-1
		for(int i = 0; i < n; i++){
			for(int j = i; j < n; j++){
				if(j == i) gcdOfRange[i][i] = arr[i];
				else gcdOfRange[i][j] = gcd(gcdOfRange[i][j-1], arr[j]);
				//System.out.println(gcdOfRange[i][j]);
				if(!x.contains(gcdOfRange[i][j])){
					set.add(gcdOfRange[i][j]);
					x.add(gcdOfRange[i][j]);
				}
			}
		}
		Collections.sort(set);
		if(set.size() > n){
			System.out.println(-1);
			return;
		}
		for(int i = 0; i < set.size(); i++){
			if(set.get(i) != arr[i]){
				System.out.println(-1);
				return;
			}
		}
		System.out.println(set.size());
		for(int i = 0; i < set.size(); i++){
			System.out.print(set.get(i)+" ");
		}

		/*
		ArrayList<Long> ans = new ArrayList<Long>();
		for(int i = 0; i < n; i++){
			ans.add(lcm(g, arr[i]));
		}
		for(int i = 0; i < ans.size(); i++){
			System.out.print(ans.get(i)+" ");
		}
		*/
	}

	static long gcd(long p, long q) {
        if (q == 0) return p;
        else return gcd(q, p % q);
    }

	static long lcm(long p, long q){
		return p*(q/gcd(p, q));
	}

}

/*
3
1 2 3
*/


import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.BitSet;
import java.util.Calendar;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.PriorityQueue;
import java.util.SortedSet;
import java.util.Stack;
import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.TreeSet;

/**
 * #
 * @author pttrung
 */
public class C_Round_447_Div2 {

    public static long MOD = 1000000007;

    public static void main(String[] args) throws FileNotFoundException {
        // PrintWriter out = new PrintWriter(new FileOutputStream(new File(
        // "output.txt")));
        PrintWriter out = new PrintWriter(System.out);
        Scanner in = new Scanner();
        int n = in.nextInt();
        int[] data = new int[n];

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

        }
        int min = data[0];
        boolean ok = true;
        for (int i : data) {
            if (gcd(i, min) != min) {
                ok = false;
                break;
            }
        }
        if (ok) {
            out.println(2 * n);
            for (int i : data) {
                out.print(min + " " + i + " ");
            }
        }else{
            out.println(-1);
        }
        out.close();
    }

    public static int[] KMP(String val) {
        int i = 0;
        int j = -1;
        int[] result = new int[val.length() + 1];
        result[0] = -1;
        while (i < val.length()) {
            while (j >= 0 && val.charAt(j) != val.charAt(i)) {
                j = result[j];
            }
            j++;
            i++;
            result[i] = j;
        }
        return result;

    }

    public static boolean nextPer(int[] data) {
        int i = data.length - 1;
        while (i > 0 && data[i] < data[i - 1]) {
            i--;
        }
        if (i == 0) {
            return false;
        }
        int j = data.length - 1;
        while (data[j] < data[i - 1]) {
            j--;
        }
        int temp = data[i - 1];
        data[i - 1] = data[j];
        data[j] = temp;
        Arrays.sort(data, i, data.length);
        return true;
    }

    public static int digit(long n) {
        int result = 0;
        while (n > 0) {
            n /= 10;
            result++;
        }
        return result;
    }

    public static double dist(long a, long b, long x, long y) {
        double val = (b - a) * (b - a) + (x - y) * (x - y);
        val = Math.sqrt(val);
        double other = x * x + a * a;
        other = Math.sqrt(other);
        return val + other;

    }

    public static class Point implements Comparable<Point> {

        int x, y;

        public Point(int start, int end) {
            this.x = start;
            this.y = end;
        }

        @Override
        public int hashCode() {
            int hash = 5;
            hash = 47 * hash + this.x;
            hash = 47 * hash + this.y;
            return hash;
        }

        @Override
        public boolean equals(Object obj) {
            if (obj == null) {
                return false;
            }
            if (getClass() != obj.getClass()) {
                return false;
            }
            final Point other = (Point) obj;
            if (this.x != other.x) {
                return false;
            }
            if (this.y != other.y) {
                return false;
            }
            return true;
        }

        @Override
        public int compareTo(Point o) {
            return Integer.compare(x, o.x);
        }
    }

    public static class FT {

        long[] data;

        FT(int n) {
            data = new long[n];
        }

        public void update(int index, long value) {
            while (index < data.length) {
                data[index] += value;
                index += (index & (-index));
            }
        }

        public long get(int index) {
            long result = 0;
            while (index > 0) {
                result += data[index];
                index -= (index & (-index));
            }
            return result;

        }
    }

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

    public static long pow(long a, long b, long MOD) {
        if (b == 0) {
            return 1;
        }
        if (b == 1) {
            return a;
        }
        long val = pow(a, b / 2, MOD);
        if (b % 2 == 0) {
            return val * val % MOD;
        } else {
            return val * (val * a % MOD) % MOD;

        }
    }

    static class Scanner {

        BufferedReader br;
        StringTokenizer st;

        public Scanner() throws FileNotFoundException {
            // System.setOut(new PrintStream(new BufferedOutputStream(System.out), true));
            br = new BufferedReader(new InputStreamReader(System.in));
            //  br = new BufferedReader(new InputStreamReader(new FileInputStream(new File("input.txt"))));
        }

        public String next() {

            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (Exception e) {
                    throw new RuntimeException();
                }
            }
            return st.nextToken();
        }

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

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

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

        public String nextLine() {
            st = null;
            try {
                return br.readLine();
            } catch (Exception e) {
                throw new RuntimeException();
            }
        }

        public boolean endLine() {
            try {
                String next = br.readLine();
                while (next != null && next.trim().isEmpty()) {
                    next = br.readLine();
                }
                if (next == null) {
                    return true;
                }
                st = new StringTokenizer(next);
                return st.hasMoreTokens();
            } catch (Exception e) {
                throw new RuntimeException();
            }
        }
    }
}


import java.io.BufferedReader;
import java.io.Closeable;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class MarcoAndGcdSequence implements Closeable {

    private InputReader in = new InputReader(System.in);
    private PrintWriter out = new PrintWriter(System.out);

    public void solve() {
        int n = in.ni();
        boolean[] have = new boolean[1000001];
        int[] x = new int[n];
        for (int i = 0; i < n; i++) {
            x[i] = in.ni();
            have[x[i]] = true;
            if (i == 0) {
                for (int j = 2 * x[i]; j < have.length; j += x[i]) {
                    have[j] = true;
                }
            }
        }
        for (int i = 0; i < n; i++) {
            int gcd = x[i];
            for (int j = i + 1; j < n; j++) {
                gcd = gcd(gcd, x[j]);
                if (!have[gcd]) {
                    out.println(-1);
                    return;
                }
            }
        }
        out.println(n);
        for (int i = 0; i < n; i++) {
            out.print(x[i]);
            out.print(' ');
        }
    }

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

    @Override
    public void close() throws IOException {
        in.close();
        out.close();
    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int ni() {
            return Integer.parseInt(next());
        }

        public long nl() {
            return Long.parseLong(next());
        }

        public void close() throws IOException {
            reader.close();
        }
    }

    public static void main(String[] args) throws IOException {
        try (MarcoAndGcdSequence instance = new MarcoAndGcdSequence()) {
            instance.solve();
        }
    }
}


import java.io.BufferedReader;
import java.io.Closeable;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class MarcoAndGcdSequence implements Closeable {

    private InputReader in = new InputReader(System.in);
    private PrintWriter out = new PrintWriter(System.out);

    public void solve() {
        int n = in.ni(), gcd = 0;
        int[] x = new int[n];
        for (int i = 0; i < n; i++) {
            x[i] = in.ni();
            gcd = gcd(gcd, x[i]);
        }
        if (x[0] != gcd) {
            out.println(-1);
            return;
        }
        int[] result = new int[2 * n - 1];
        int idx = 0;
        for (int i = 0; i < result.length; i += 2) {
            result[i] = x[idx++];
            if (i < result.length - 1) {
                result[i + 1] = x[0];
            }
        }
        out.println(2 * n - 1);
        for (int value : result) {
            out.print(value);
            out.print(' ');
        }
    }

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

    @Override
    public void close() throws IOException {
        in.close();
        out.close();
    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int ni() {
            return Integer.parseInt(next());
        }

        public long nl() {
            return Long.parseLong(next());
        }

        public void close() throws IOException {
            reader.close();
        }
    }

    public static void main(String[] args) throws IOException {
        try (MarcoAndGcdSequence instance = new MarcoAndGcdSequence()) {
            instance.solve();
        }
    }
}


import java.io.BufferedReader;
import java.io.Closeable;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class MarcoAndGcdSequence implements Closeable {

    private InputReader in = new InputReader(System.in);
    private PrintWriter out = new PrintWriter(System.out);

    public void solve() {
        int n = in.ni();
        boolean[] have = new boolean[1000001];
        int[] x = new int[n];
        for (int i = 0; i < n; i++) {
            x[i] = in.ni();
            have[x[i]] = true;
        }
        for (int i = 0; i < n; i++) {
            int gcd = x[i];
            for (int j = i + 1; j < n; j++) {
                gcd = gcd(gcd, x[j]);
                if (!have[gcd]) {
                    out.println(-1);
                    return;
                }
            }
        }
        out.println(n);
        for (int i = 0; i < n; i++) {
            out.print(x[i]);
            out.print(' ');
        }
    }

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

    @Override
    public void close() throws IOException {
        in.close();
        out.close();
    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int ni() {
            return Integer.parseInt(next());
        }

        public long nl() {
            return Long.parseLong(next());
        }

        public void close() throws IOException {
            reader.close();
        }
    }

    public static void main(String[] args) throws IOException {
        try (MarcoAndGcdSequence instance = new MarcoAndGcdSequence()) {
            instance.solve();
        }
    }
}