# coding: utf-8 # Here your code ! import math a,b=map(int, input().split()) print(math.gcd(a+b,a*b))