using System; using System.Collections.Generic; using System.Linq; static class Ext { public static Dictionary Frequencies(this IEnumerable xs) { var d = new Dictionary(); foreach (var x in xs) { if (!d.ContainsKey(x)) d[x] = 1; else d[x]++; } return d; } public static U GetOrDefault(this Dictionary dict, T key, U val = default(U)) { U x; return dict.TryGetValue(key, out x) ? x : val; } } class Program { static int ReadInt() { return int.Parse(Console.ReadLine()); } static int[] ReadInts() { return Console.ReadLine().Split().Select(int.Parse).ToArray(); } static string[] ReadStrings() { return Console.ReadLine().Split(); } static long Pow(long x, int n) { if (n == 0) return 1; if ((n & 1) == 0) return Pow(x * x, n / 2); return x * Pow(x, n - 1); } static List Fac(long n) { var factors = new List(); while (n % 2 == 0) { factors.Add(2); n /= 2; } long m = (long)Math.Sqrt(n); for (int i = 3; i <= m; i += 2) { while (n % i == 0) { factors.Add(i); n /= i; } if (i > n) break; } if (n > 1) factors.Add(n); return factors; } static long Calc(long a, long b) { var freq = Fac(a + b).Frequencies(); var ad = Fac(a).Frequencies(); var bd = Fac(b).Frequencies(); foreach (var k in ad.Keys.Union(bd.Keys).ToArray()) { ad[k] = ad.GetOrDefault(k) + bd.GetOrDefault(k); } long ans = 1; foreach (var k in freq.Keys) { int n = Math.Min(freq[k], ad.GetOrDefault(k)); ans *= Pow(k, n); } return ans; } static void Main() { var ab = Console.ReadLine().Split().Select(long.Parse).ToArray(); long a = ab[0], b = ab[1]; Console.WriteLine(Calc(a, b)); } }