A,B,K=map(int,input().split()) import math LCM=A*B//math.gcd(A,B) a=A i=1 b=B j=1 data=[] while a*i<=LCM: data.append(a*i) i+=1 while b*j