sub f { my$n=my$p=pop;1while$n%--$p;$p>1?(f($n/$p),f($p)):$n }