import math a,b,k=map(int,input().split()) l=a*b//math.gcd(a,b) x=y=0 while y