use integer; <>; $x=1; $x=$x*($_%9)%9for glob<>; print$x?$x:9