n=gets.to_i a=[] n.times do |i| a<< gets.to_i end c=0 b=[] b<< 1+c (n/2).times do |i| g=a[i*2]-b[i*2] c+=1-g if i%2==1&&g<1 b<< g g=b[i*2+1]-a[i*2+1] c+=1-g if i%2==0&&g<1 b<< g end (n%2).times do b<< a[-1]-b[-1] end c=0 (n+1).times do |i| c+=b[i] if 1>b[i] end b=[] b<< 2-c (n/2).times do |i| g=a[i*2]-b[i*2] c+=1-g if i%2==1&&g<1 b<< g g=b[i*2+1]-a[i*2+1] c+=1-g if i%2==0&&g<1 b<< g end (n%2).times do b<< a[-1]-b[-1] end if b.all?{|i|i>0} puts n+1,b.*("\n") else p -1 end