Problem: You are given an array of n elements, you must make it a co-prime array in as few moves as possible.

In each move you can insert any positive integral number you want not greater than 109 in any place in the array.

An array is co-prime if any two adjacent numbers of it are co-prime.

In the number theory, two integers a and b are said to be co-prime if the only positive integer that divides both of them is 1.

Input

The first line contains integer n (1 ≤ n ≤ 1000) — the number of elements in the given array.

The second line contains n integers ai (1 ≤ ai ≤ 109) — the elements of the array a.

Output

Print integer k on the first line — the least number of elements needed to add to the array a to make it co-prime.

The second line should contain n + k integers aj — the elements of the array a after adding k elements to it. Note that the new array should be co-prime, so any two adjacent values should be co-prime. Also the new array should be got from the original array a by adding k elements to it.

If there are multiple answers you can print any one of them.

Example

Input

3
2 7 28


Output

1
2 7 9 28

Solution (in JAVA):

Solution:


import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.List;


public class Problem_01 {

    private static int gcd(int a, int b) {
        BigInteger b1 = BigInteger.valueOf(a);
        BigInteger b2 = BigInteger.valueOf(b);
        BigInteger gcd = b1.gcd(b2);
        return gcd.intValue();
    }

    public static void main(String[] args) throws Exception {
        Scanner input = new Scanner();
        int n = input.nextInt();
        int k = 0;
        int[] a = new int[n];
        List<Integer> b = new ArrayList(n + n);
        for (int i = 0; i < n; i++) {
            a[i] = input.nextInt();
            if (i > 0) {
                if (gcd(a[i], a[i-1]) > 1) {
                    b.add(1);
                }
            }
            b.add(a[i]);
        }

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

    static class Scanner {
        final BufferedReader input;
        String[] buffer;
        int pos;


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


        private String read() {
            try {
                if (buffer == null || pos >= buffer.length) {
                    buffer = input.readLine().split("\\s+");
                    pos = 0;
                }
                return buffer[pos++];
            } catch (Exception ex) {
                throw new RuntimeException(ex);
            }
        }

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

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

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

        String nextLine() {
            if (buffer != null && pos < buffer.length) {
                throw new RuntimeException("Buffer is not empty");
            }
            try {
                return input.readLine();
            } catch (Exception ex) {
                throw new RuntimeException(ex);
            }
        }
    }

}