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.*;
import java.util.*;

public class CoprimeArray {

	public static void main(String[] args) {
		try {
			int[] A = processInput();
			int[] coprimeA = minCoprimeArray(A);
			int k = coprimeA.length - A.length;
			printOutput(k, coprimeA);
		}
		catch( Exception ex ) {
			ex.printStackTrace();
		}
	}

	static int[] processInput() throws IOException {
		InputStreamReader istream = new InputStreamReader(System.in);
		BufferedReader ibuf = new BufferedReader(istream);

		ibuf.readLine();
		String line = ibuf.readLine();
		ibuf.close();

		String[] splitLine = line.split(" ");
		int n = splitLine.length;

		int[] A = new int[n];
		for( int i = 0; i < n; i++ ) {
			A[i] = Integer.parseInt(splitLine[i]);
		}

		return A;
	}

	static int[] minCoprimeArray(int[] A) throws Exception {
		int n = A.length;

		int numOnesAdded = 0;
		int[] coprimeA = new int[2*n-1];
		coprimeA[0] = A[0];

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

			int d;

			try {
				d = gcd(A[i-1], A[i]);
			}
			catch (Exception ex) {
				throw ex;
			}

			if( d > 1 ) {
				coprimeA[i+numOnesAdded] = 1;
				numOnesAdded++;
			}
			coprimeA[i+numOnesAdded] = A[i];
		}

		return Arrays.copyOfRange(coprimeA, 0, n+numOnesAdded);
	}

	static int gcd(int a, int b) throws Exception {
		if( a <= 0 || b <= 0 ) {
			throw new Exception("arguments must be positive");
		}

		int t;
		if( a < b ) {
			t = a;
			a = b;
			b = t;
		}
		while( b != 0 ) {
			t = a % b;
			a = b;
			b = t;
		}
		return a;
	}

	// test case: a == 15, b == 12
	// a = 3
	// b = 0
	// t = 0

	static void printOutput(int k, int[] coprimeA) {
		System.out.println(k);
		for( int i = 0; i < coprimeA.length; i++ ) {
			System.out.print(coprimeA[i] + " ");
		}
	}

}