$e=1e18|0; ($n,@b)=<>; @a=1; for(0..1){ $m=$o=$a[0]; for(0..$#b){ $v=$a[$_+1]=($b[$_]-$a[$_])*(-1)**$_; $v=$e+1-$v if $_%4==1||$_%4==2; $m=$v if $m>$v; $o=$v if $o<$v; } if($m<1){ $a[0]=2-$m; }elsif($o<=$e){ print join$/,$n+1,@a; exit; } } print -1;