import java.math.BigInteger; import java.util.Scanner; class B{ static Scanner s = new Scanner(System.in); public static void main(String[] args) { BigInteger a=s.nextBigInteger(), b=s.nextBigInteger(), s = a.add(b), p = a.multiply(b); System.out.println(s.gcd(p)); } }