def printPrimeFactor(n):
div = 2
while n != 0:
if n % div != 0:
div = div + 1
else:
print(div, ",", end=" ")
n = n / div
if n == 1:
break
print()
n = 124
printPrimeFactor(n) # 2 x 2 x 31
printPrimeFactor(288) # 2 x 2 x 2 x 2 x 2 x 3 x 3
printPrimeFactor(1288) # 2 x 2 x 2 x 7 x 23
'''
run:
2 , 2 , 31 ,
2 , 2 , 2 , 2 , 2 , 3 , 3 ,
2 , 2 , 2 , 7 , 23 ,
'''