$x+=(-1,99,1,-99)[$d=3&$d-(vec($_,$x||=3e3,8)^=3)%17]for($_=($/.$"x98)x99)x<>;s/^\s*^ //gmuntil/ #/;s/ $//gmuntil/# /;print