def f(l):
    if(l[0]%2==0):
           u=sum(l)+1
    else:
           u=sum(l)         
    return u    
for i in range(int(input())):
    k=int(input());l=list(map(int,input().split()));l.reverse()
    j=0
    while(j<k-1):
            z=[]
            if sum(l[j:j+2:])%2==0:
                 u=f(l[j:j+2:])
                 z.extend(l[:j])
                 z.append(u)
                 z.extend(l[j+2:])
                 l=z[:]
                 k-=1
                 j=0
            else:
                 j+=1
                 continue
    l.reverse() 
    print(k)
    for t in l:
        print(t,end=" ")
        
        
