inputer = input() inputer_d = inputer.split(" ") first_n = int(inputer_d[0]) second_n = int(inputer_d[1]) result=0 wa = int(first_n+second_n) seki = int(first_n*second_n) saidai_sho=0 saidai_sa =0 tmp=0 if wa > seki: saidai_sa= int(wa%seki) saidai_sho= seki if saidai_sa>0: while(saidai_sho%saidai_sa >0): tmp=int(saidai_sho%saidai_sa) saidai_sho=saidai_sa saidai_sa = tmp result =saidai_sa else: result =saidai_sho elif wa < seki: saidai_sa= int(seki%wa) saidai_sho= wa if saidai_sa>0: while(saidai_sho%saidai_sa >0): tmp=int(saidai_sho%saidai_sa) saidai_sho=saidai_sa saidai_sa = tmp result =saidai_sa else: result =saidai_sho else: result=wa print(result)