<>;@b=<>;map{@a=1-$m;$m=0;map{push@a,$v=($b[$_]-$a[$_])*(-1)**$_;$m=$v-1if$m>=$v}0..$#b}0,1;print$m<0?-1:join$/,@a+0,@a