import java.util.*; import java.math.BigDecimal; public class SumMultiply { public static void main(String[] args) { Scanner sc = new Scanner(System.in); BigDecimal a = new BigDecimal(sc.next()); BigDecimal b = new BigDecimal(sc.next()); BigDecimal c = a.add(b); BigDecimal d = a.multiply(b); if (c.compareTo(d) == -1){ System.out.println(gcd(d,c)); }else{ System.out.println(gcd(c,d)); } } public static long gcd(BigDecimal bigNum, BigDecimal smallNum) { BigDecimal remainder = bigNum.remainder(smallNum); if (remainder.compareTo(new BigDecimal(0)) == 0){ return smallNum.longValue(); } return gcd(smallNum, remainder); } }