a=int(raw_input('a'))b=int(raw_input('b'))su=[]if a>b: smaller=b else: smaller=a for i in range(1,smaller+1): if a%i==0 and b%i==0: su.append(i)l=len(su)p=su[l-1]print '最大公约数:',pprint '最小公倍数:',a*b/p