import java.util.Scanner; import java.math.BigInteger; public class Yuki442{ public static void main(String[] args) { Scanner sc = new Scanner(System.in); long a = sc.nextLong(); long b = sc.nextLong(); String s_a = Long.toString(a); String s_b = Long.toString(b); BigInteger big_a = new BigInteger(s_a); BigInteger big_b = new BigInteger(s_b); BigInteger big_c = big_a; big_c = big_c.add(big_b); BigInteger big_d = big_a; big_d = big_d.multiply(big_b); BigInteger big_e = big_c; big_e = big_e.gcd(big_d); long c = big_e.longValue(); System.out.println(c); } }