Stop working if all factors are found and print exponents