sub factor { $n=$p=pop;1while$n%--$p;$n/$p,$p; }