In a dream Marco met an elderly man with a pair of black glasses. The man told him the key to immortality and then disappeared with the wind of time.

When he woke up, he only remembered that the key was a sequence of positive integers of some length n, but forgot the exact sequence. Let the elements of the sequence be a_1, a_2, ..., a_{n}. He remembered that he calculated gcd(a_{i}, a_{i} + 1, ..., a_{j}) for every 1 ≤ i ≤ j ≤ n and put it into a set S. gcd here means the greatest common divisor.

Note that even if a number is put into the set S twice or more, it only appears once in the set.

Now Marco gives you the set S and asks you to help him figure out the initial sequence. If there are many solutions, print any of them. It is also possible that there are no sequences that produce the set S, in this case print -1.


-----Input-----

The first line contains a single integer m (1 ≤ m ≤ 1000) — the size of the set S.

The second line contains m integers s_1, s_2, ..., s_{m} (1 ≤ s_{i} ≤ 10^6) — the elements of the set S. It's guaranteed that the elements of the set are given in strictly increasing order, that means s_1 < s_2 < ... < s_{m}.


-----Output-----

If there is no solution, print a single line containing -1.

Otherwise, in the first line print a single integer n denoting the length of the sequence, n should not exceed 4000.

In the second line print n integers a_1, a_2, ..., a_{n} (1 ≤ a_{i} ≤ 10^6) — the sequence.

We can show that if a solution exists, then there is a solution with n not exceeding 4000 and a_{i} not exceeding 10^6.

If there are multiple solutions, print any of them.


-----Examples-----
Input
4
2 4 6 12

Output
3
4 6 12
Input
2
2 3

Output
-1



-----Note-----

In the first example 2 = gcd(4, 6), the other elements from the set appear in the sequence, and we can show that there are no values different from 2, 4, 6 and 12 among gcd(a_{i}, a_{i} + 1, ..., a_{j}) for every 1 ≤ i ≤ j ≤ n.

Difficulty: interview

Starter code:

Solutions:
import math

n = int(input())
x = [int(k) for k in input().split(" ")]
m = x[0]
chk = [max(0,(x[i]%m)) for i in range(n)]

if sum(chk) > 0:
    print(-1)
else:
    print(2*n-1)
    o = []
    o.append(str(m))
    for i in range(1,n):
        o.append(str(x[i]))
        o.append(str(m))

    print(" ".join(o))


from fractions import gcd
from functools import reduce

m = int(input())
a = list(map(int, input().split()))
ans = []

if reduce(gcd, a) == a[0]:
    for i in range(1, m):
        ans.append(a[0])
        ans.append(a[i])
    ans.append(a[0])
    print(len(ans))
    print(' '.join(map(str, ans)))
else:
    print(-1)


m = int( input() )
a = list( map( int, input().split() ) )

def gcd( a, b ):
    if b == 0:
        return ( a )
    return ( gcd( b, a % b ) )

cur = min( a )
for i in range( 1, m ):
    if a[i] % cur != 0:
        print( "-1" )
        return
L = [cur]

for i in range(m):
    if a[i] != cur:
        L.append( a[i] )
        L.append( cur )

print( len(L) )

for i in range( len(L) ):
    print( L[i], end=' ' )


# -*- coding: utf-8 -*-

import math
import collections
import bisect
import heapq
import time
import random
import itertools
import sys

"""
created by shhuan at 2017/11/19 21:53

"""

N = int(input())
A = [int(x) for x in input().split()]

def gcd(x, y):
    if x < y:
        return gcd(y, x)
    if y == 0:
        return x

    return gcd(y, x%y)

x = A[0]
for v in A[1:]:
    x = gcd(x, v)

if A[0] != x:
    print(-1)
else:
    print(2*len(A)-1)
    print((" %d " % A[0]).join(map(str, A)))



def main():
    m = int(input())
    a = list(map(int, input().split()))
    for i in range(1, m):
        if a[i] % a[0] != 0:
            print(-1)
            return
    print(2*m - 1)
    print(a[0], end=' ')
    for i in range(1, m):
        print(a[i], a[0], end=' ')
main()