import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); long a = sc.nextLong(); long b = sc.nextLong(); long g = gcd(a, b); long a2 = a / g; long b2 = b / g; long g2 = gcd(a2 + b2, g); System.out.println(g * g2); } public static long gcd(long a, long b) { if(b == 0) return a; return gcd(b, (a % b)); } }